How to use Facebook Open fitness api chart for walking through FacebookSDK

I want to publish Open Graph fitness: walk action on Facebook, and I want it to display with a map of my path. How can I do it? The action below is published in the method, and I can see the text for the action in my Facebook activity log and in my timeline. But I do not see the map when I look at any element of the published action. What am I doing wrong?

NSMutableDictionary<FBGraphObject> *action = [FBGraphObject graphObject];action[@"course"] = @"http://samples.ogp.me/136756249803614"; [FBRequestConnection startForPostWithGraphPath:@"me/fitness.walks" graphObject:action completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { // handle the result NSLog(@"error:%@",error.description); NSLog(@"Result:%@",result); }]; 
+4
source share
1 answer

try it

  [FBRequestConnection startForPostWithGraphPath:[NSString stringWithFormat:@"me/fitness.%@?access_token=%@",walkType,appDelegate.session.accessTokenData.accessToken] graphObject:action completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { // handle the result //NSLog(@"error description:%@",error); NSLog(@"Result:%@",result); [SVProgressHUD dismiss]; if (error == nil) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Track My Walks" message:[NSString stringWithFormat:@"You successfully post a route and your id is:%@",[result valueForKey:@"id"]] delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil, nil]; [alert show]; } else { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Track My Walks" message:error.description delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil, nil]; [alert show]; } }]; }]; [request setFailedBlock:^{ [SVProgressHUD dismiss]; NSError *error = [request error]; NSLog(@"Error: %@", error.localizedDescription); [self directionsDidFailedDirections:error.localizedDescription]; }]; [request startAsynchronous]; 
+1
source

All Articles