【发布时间】:2014-04-21 16:30:41
【问题描述】:
我在 Unity 中创建了一个支持 Google Play 排行榜的应用。我可以很容易地让它在 Android 上运行,然后我转移到 OSX 来为 iPhone 构建它。 首先我遇到了一个问题,Apple 不会接受任何带有“_”字符的包标识符,但我的 Android 应用包标识符有 2 个...... 但是我发现,在 Google Developer Console 中,我也可以将另一个应用程序链接到我的 iOS 应用程序(使用相同的排行榜),所以我很高兴。不幸的是,这似乎不起作用。每次我尝试登录时都会收到 *redirect_uri_mismatch* 错误消息。
在 Android 上,我使用了 UnityGPGPlugin,但由于它在 iOS 上对我不起作用,我也尝试了 PlayGameServices。在 UnityGPGPlugin 中我只能设置应用程序 ID,所以我认为这就是它不起作用的原因。在 PlayGameServices 插件中,有两个字段,一个用于应用程序 ID,另一个用于客户端 ID,这使它看起来确实是我需要的。不幸的是,错误仍然存在,我真的不知道我能用它做什么。这是众所周知的消息:
Error: redirect_uri_mismatch
Request Details
cookie_policy_enforce=false
scope=https://www.googleapis.com/auth/appstate
https://www.googleapis.com/auth/games
https://www.googleapis.com/auth/plus.login
https://www.googleapis.com/auth/plus.moments.write
https://www.googleapis.com/auth/plus.me
https://www.googleapis.com/auth/plus.profile.agerange.read
https://www.googleapis.com/auth/plus.profile.language.read
https://www.googleapis.com/auth/plus.circles.members.read
response_type=code
access_type=offline
redirect_uri= < my bundle identifier without '_' characters >:/oauth2callback
state=16885367
gpsdk=1.5.0
verifier=12647966
display=page
client_id=123456789123-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
hl=en
调试日志只包含以下内容:
2014-03-16 14:21:19.507 <my app>[1699:60b] GPGSAuthenticateWithCallback.
2014-03-16 14:21:19.509 <my app>[1699:60b] GPGSManager initializing and authenticating.
2014-03-16 14:21:19.512 <my app>[1699:60b] GPPSignIn initialized.
2014-03-16 14:21:19.514 <my app>[1699:60b] GPPSignIn attempting sign in now.
-> applicationWillResignActive()
-> applicationDidEnterBackground()
有谁知道我该如何解决这个问题? 提前致谢!
编辑: 也许这并不明显,但我有 2 个捆绑标识符,它们都链接到 Google Play Developer Console 中的同一个游戏服务。 com.x.a_b_c 属于 Android 应用,com.x.abc 属于 iOS 应用。
【问题讨论】:
标签: ios iphone unity3d oauth-2.0 google-play-services