1

iOSにロケーションチェックイン機能を実装したいです。私のアプリケーションは google+ ios SDK を使用しています。私が直面している問題は、Google+ チェックイン機能を実装した後、その投稿が Google+ アカウントに表示されないことです。

私が試して実装したテクニックを以下に示します。

  -(IBAction)checkIn
  {
   GTMOAuth2Authentication *auth = [GPPSignIn sharedInstance].authentication;

   GTLServicePlus* plusService = [[GTLServicePlus alloc] init] ;
   plusService.retryEnabled = YES;
    [plusService setAuthorizer:auth];

GTLPlusMoment *moment = [[GTLPlusMoment alloc] init];
moment.type =  @"http://schemas.google.com/CheckInActivity";
GTLPlusItemScope *target = [[GTLPlusItemScope alloc] init] ;
target.url =@"https://developers.google.com/+/plugins/snippet/examples/place";

moment.target = target;

 GTLQueryPlus *query =
[GTLQueryPlus queryForMomentsInsertWithObject:moment
                                       userId:@"me"
                                  collection:kGTLPlusCollectionVault];

[plusService executeQuery:query
        completionHandler:^(GTLServiceTicket *ticket,
                            id object,
                            NSError *error) {
            if (error) {
                GTMLoggerError(@"Error: %@", error);
                NSString *failure =
                [NSString stringWithFormat:@"Status: Error: %@", error];
                NSLog(@"%@",failure);

            } else {
               NSString *result = @"CheckedIn Saved in Google+";
                NSLog(@"%@",result);
            }
        }];

        }

誰でも私を助けてください。これは google+ のロケーション チェックイン機能を実装する正しい方法ですか、それとも他の方法はありますか?

4

1 に答える 1