Google Play服务iOS SDK:权限不足

时间:2014-12-20 23:59:10

标签: google-play google-play-services

我做了一些搜索但到目前为止没有找到任何解决方案。我们有一个基于iOS的游戏,我们正在尝试整合Google Play服务。按照这里的说明进行操作:

https://developers.google.com/games/services/ios/quickstart

我在Google Dev Console中设置了以下权限:(可能更多我需要的)

驱动器API
驱动SDK Google Play游戏管理
Google Play游戏服务
Google+ API
Google+域名API

当我尝试使用我的谷歌电子邮件/密码登录时,它会在控制台上抛出以下内容,即使它验证正常。

这就是我请求权限和登录的方式:

GPGManager.sharedInstance().signInWithClientID(GOOGLE_CLIENT_ID, silently: false,
    withExtraScopes: [
        "https://www.googleapis.com/auth/plus.login",
        "https://www.googleapis.com/auth/plus.me",
        "https://www.googleapis.com/auth/userinfo.email",
        "https://www.googleapis.com/auth/userinfo.profile",
        "https://www.googleapis.com/auth/games",
        "https://www.googleapis.com/auth/drive.appdata"
    ]
)
2014-12-20 15:49:17.352 TriviaBurst[24003:2677075] -[PFCommandResult boolValue]: unrecognized selector sent to instance 0x7d974120
2014-12-20 15:52:55.403 TriviaBurst[24003:2679986] INFO: Auth operation started: SIGN IN
2014-12-20 15:52:55.404 TriviaBurst[24003:2679986] INFO: Auth operation SIGN IN finished with status VALID
2014-12-20 15:52:55.408 TriviaBurst[24003:2677075] ERROR: Attempting to get name of an invalid Player
2014-12-20 15:52:55.408 TriviaBurst[24003:2677075] ERROR: Attempting to get avatar URL of an invalid Player
2014-12-20 15:52:55.408 TriviaBurst[24003:2677075] ERROR: Attempting to get id of an invalid Player
2014-12-20 15:52:55.408 TriviaBurst[24003:2677075] ERROR: Attempting to get title of an invalid Player
2014-12-20 15:52:55.408 TriviaBurst[24003:2677075] ERROR: Attempting to get current xp of an invalid Player
2014-12-20 15:52:55.408 TriviaBurst[24003:2677075] ERROR: Attempting to get last level up timestamp of an invalid Player
2014-12-20 15:52:55.408 TriviaBurst[24003:2677075] ERROR: Attempting to get current level of an invalid Player
2014-12-20 15:52:55.408 TriviaBurst[24003:2677075] ERROR: Attempting to get level number of an invalid PlayerLevel
2014-12-20 15:52:55.408 TriviaBurst[24003:2677075] ERROR: Attempting to get minimum xp of an invalid PlayerLevel
2014-12-20 15:52:55.408 TriviaBurst[24003:2677075] ERROR: Attempting to get maximum xp of an invalid PlayerLevel
2014-12-20 15:52:55.415 TriviaBurst[24003:2677075] ERROR: Attempting to get next level of an invalid Player
2014-12-20 15:52:55.416 TriviaBurst[24003:2677075] ERROR: Attempting to get level number of an invalid PlayerLevel
2014-12-20 15:52:55.416 TriviaBurst[24003:2677075] ERROR: Attempting to get minimum xp of an invalid PlayerLevel
2014-12-20 15:52:55.416 TriviaBurst[24003:2677075] ERROR: Attempting to get maximum xp of an invalid PlayerLevel
2014-12-20 15:52:55.527 [Core] (Error) __49-[GPGService executeOperation:completionHandler:]_block_invoke:[main] Server Operation Failed [appstate.states.list]
    Error: The operation couldn’t be completed. (Insufficient Permission)
    Error Full: Error Domain=com.google.GTLJSONRPCErrorDomain Code=403 "The operation couldn’t be completed. (Insufficient Permission)" UserInfo=0x7a6bfd00 {error=Insufficient Permission, GTLStructuredError=GTLErrorObject 0x7a6be700: {message:"Insufficient Permission" code:403 data:[1]}, NSLocalizedFailureReason=(Insufficient Permission)}
2014-12-20 15:52:55.674 TriviaBurst[24003:2677075] VERBOSE: Automatically seeded event cache.
2014-12-20 15:52:55.746 TriviaBurst[24003:2677075] VERBOSE: Automatically seeded achievement cache.
2014-12-20 15:52:56.138 TriviaBurst[24003:2677075] WARNING: Could not automatically seed snapshot cache.

1 个答案:

答案 0 :(得分:1)

检查身份验证请求中的OAuth 2.0范围。它应该是只读的。这是一个日历OAuth 2.0示例。

    // Creates the auth controller for authorizing access to Google Calendar API.
    - (GTMOAuth2ViewControllerTouch *)createAuthController {
        GTMOAuth2ViewControllerTouch *authController;
        NSArray *scopes = [NSArray arrayWithObjects:kGTLAuthScopeCalendar, nil];
        authController = [[GTMOAuth2ViewControllerTouch alloc]
                          initWithScope:[scopes componentsJoinedByString:@" "]
                          clientID:kClientID
                          clientSecret:kClientSecret
                          keychainItemName:kKeychainItemName
                          delegate:self
                          finishedSelector:@selector(viewController:finishedWithAuth:error:)];
    return authController;
}