@Perfecter

Как исправить ошибку OK.GetCurrentUser (android, unity3d sdk)?

Исходный код:
OK.Init(initResult =>
{
OK.Auth(callback =>
{


OK.GetCurrentUser(r =>
{
Debug.Log("Age=" + r.age);
});

});
});

Инициализация и авторизация проходят успешно.
При получении информации о пользователе падает эксепшн в конструкторе OKUserInfo относительно приведения типов. Полный лог:

02-22 15:45:59.251: I/Unity(7379): OUT -> https://api.ok.ru/fb.do?sig=249502d274720dedf62f90...
02-22 15:45:59.251: I/Unity(7379):
02-22 15:45:59.251: I/Unity(7379): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
02-22 15:45:59.741: I/Unity(7379): IN www <- {"session_key":"$a$fYvk3v\"7:19:\"}huKD6XipIS\"N{k4OE\"K\"IF:\"b,CSD\"3El\":6527a,RPc\"\"sQ\"3154e,tqJfT650_X\"9","session_secret_key":"YW3YviSDiF7Ye9rk4XLk","api_server":"https://api.odnoklassniki.ru/","activated_profile":false}
02-22 15:45:59.741: I/Unity(7379):
02-22 15:45:59.741: I/Unity(7379): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
02-22 15:45:59.781: I/Unity(7379): Auth with SSO
02-22 15:45:59.781: I/Unity(7379):
02-22 15:45:59.781: I/Unity(7379): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
02-22 15:45:59.921: I/Unity(7379): Odnoklassniki API initialized successfully
02-22 15:45:59.921: I/Unity(7379):
02-22 15:45:59.921: I/Unity(7379): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
02-22 15:45:59.991: I/Unity(7379): Received SSO Auth failed callback: cancelled:false
02-22 15:45:59.991: I/Unity(7379):
02-22 15:45:59.991: I/Unity(7379): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
02-22 15:46:00.011: I/Unity(7379): Fallback to OAuth
02-22 15:46:00.011: I/Unity(7379):
02-22 15:46:00.011: I/Unity(7379): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
02-22 15:46:00.091: I/Unity(7379): Webview RESIZE
02-22 15:46:00.091: I/Unity(7379):
02-22 15:46:00.091: I/Unity(7379): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
02-22 15:46:04.111: I/Unity(7379): Authorized via OAuth!
02-22 15:46:04.111: I/Unity(7379):
02-22 15:46:04.111: I/Unity(7379): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
02-22 15:46:04.141: I/Unity(7379): OUT -> https://api.odnoklassniki.ru/fb.do?access_token=59...
02-22 15:46:04.141: I/Unity(7379):
02-22 15:46:04.141: I/Unity(7379): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
02-22 15:46:04.451: I/Unity(7379): IN www <- {"uid":"569484885060","birthday":"1993-12-12","age":22,"name":"Разработчик Unity3d","locale":"ru","gender":"male","location":{"city":"","country":"BELARUS","countryCode":"BY","countryName":"Беларусь"},"online":"web","first_name":"Разработчик","last_name":"Unity3d","has_email":true,"pic_1":"https://i508.mycdn.me/res/stub_50x50.gif","pic_2":"https://usd1.mycdn.me/res/stub_128x96.gif","pic_3":"https://i504.mycdn.me/res/stub_128x96.gif"}
02-22 15:46:04.451: I/Unity(7379):
02-22 15:46:04.451: I/Unity(7379): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
02-22 15:46:04.671: I/Unity(7379): InvalidCastException: Cannot cast from source type to destination type.
02-22 15:46:04.671: I/Unity(7379): at OKUserInfo..ctor (System.Collections.Hashtable hashtable) [0x00000] in :0
02-22 15:46:04.671: I/Unity(7379): at Odnoklassniki.AbstractOdnoklassniki+c__AnonStorey5.<>m__4 (HTTP.Response response) [0x00000] in :0
02-22 15:46:04.671: I/Unity(7379): at Odnoklassniki.AbstractOdnoklassniki+c__AnonStorey3.<>m__2 (HTTP.Request request) [0x00000] in :0
02-22 15:46:04.671: I/Unity(7379): at HTTP.ResponseCallbackDispatcher+d__0.MoveNext () [0x00000] in :0
02-22 15:46:04.671: I/Unity(7379):
02-22 15:46:04.671: I/Unity(7379): (Filename: Line: -1)
  • Вопрос задан
  • 558 просмотров
Решения вопроса 1
@XLIII
Добрый день.

На Github доступно обновление Unity Odnoklassniki SDK, где был исправлен указанный вами баг

https://github.com/odnoklassniki/ok-unity3d-sdk
Ответ написан
Пригласить эксперта
Ответы на вопрос 1
@Viertual
+ 1
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы