0

ユーザーのサークルを取得する必要がある Google Plus 統合を使用しています。

URL を渡しています: https://www.googleapis.com/plus/v1/people/Your_User_Id/people/visible?key=APP_Key

次のような応答が得られます。

{ error = { code = 403; errors = ( { domain = global; message = Forbidden; reason = forbidden; } ); message = Forbidden; }; }

このリクエストにはどのような許可が必要ですか?

4

1 に答える 1

5

これは、サインインしているユーザーに対してのみ実行できます。そのため、「Your_User_Id」は常に「me」である必要があります。アプリ キーを渡すことも問題ありませんが、アプリにサインインしているユーザーから oAuth 2.0 トークンを使用して呼び出しを行う必要があります。ここですべての詳細を確認できます: https://developers.google.com/+/mobile/ios/people#retrieve_a_collection_of_people

基本的に、サインインを実装する必要があります。まだ実装していない場合は、GPPSignIn sharedInstance で plusService を使用できます。

GTLQueryPlus *query =
    [GTLQueryPlus queryForPeopleListWithUserId:@"me"
                                    collection:kGTLPlusCollectionVisible];
[[[GPPSignIn sharedInstance] plusService] executeQuery:query
        completionHandler:^(GTLServiceTicket *ticket,
                            GTLPlusPeopleFeed *peopleFeed,
                            NSError *error) {
            if (error) {
              GTMLoggerError(@"Error: %@", error);
            } else {
              // Get an array of people from GTLPlusPeopleFeed
              NSArray* peopleList = [peopleFeed.items retain];
            }
        }];

それはあなたがそこに与えているURLを呼び出しています。

于 2013-07-10T19:22:15.950 に答える