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];
source share