我想在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+位置签到功能的正确方式吗?或者有其他方法可以实现它吗?
发布于 2013-04-12 18:35:54
您正在使用的方法是将一个“应用程序活动”写入Google+,它在用户的应用程序活动库中存储一个“时刻”。正如在https://developers.google.com/+/mobile/ios/app-activities上指出的那样,这些时刻在用户的流媒体上不直接可见,尽管用户可以选择将它们分享到流媒体上。
要查看已共享的朋友圈,您需要使用桌面应用程序。你的个人资料包含正在使用Google+登录的应用程序列表,你可以查看、共享和删除其中每个应用程序的活动。移动Google+客户端还不允许您查看活动。
https://stackoverflow.com/questions/15968670
复制相似问题