Create an open graphical story with a map - iOS

I want to share current work on fb with my iOS app.

     NSDictionary *properties = @{
                               @"og:type": @"fitness.course",
                               @"og:title": @"Sample Course",
                               @"og:description": @"This is a sample course.",
                               @"fitness:duration:value": @100,
                               @"fitness:duration:units": @"s",
                               @"fitness:distance:value": @5,
                               @"fitness:distance:units": @"km",
                               @"fitness:speed:value": @5,
                               @"fitness:speed:units": @"m/s",


                               @"fitness:metrics:location:latitude": @37.416382,
                               @"fitness:metrics:location:longitude": @-122.152659,
                               @"fitness:metrics:location:altitude" :@42,
                               @"fitness:metrics:timestamp" :@"2011-01-26T00:00",
                               @"fitness:metrics:distance:value" :@0,
                               @"fitness:metrics:distance:units":@"mi" ,
                               @"fitness:metrics:pace:value" :@0,
                               @"fitness:metrics:pace:units" :@"s/m",
                               @"fitness:metrics:calories":@0,

                               };
  FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];
  FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
  action.actionType = @"fitness.runs";
  [action setObject:object forKey:@"fitness:course"];
  FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
  content.action = action;
  content.previewPropertyName = @"fitness:course";

      

I can split this activity to fb using this. But now I want to add geo-points on the fb post view map (same as in Nike app fb posts). How to add additional data points to a graph object.

+3


source to share


1 answer


If you want to add more points, just add them in order.

NSDictionary *properties = @{
                           @"og:type": @"fitness.course",
                           @"og:title": @"Sample Course",
                           @"og:description": @"This is a sample course.",
                           @"fitness:duration:value": @100,
                           @"fitness:duration:units": @"s",
                           @"fitness:distance:value": @5,
                           @"fitness:distance:units": @"km",
                           @"fitness:speed:value": @5,
                           @"fitness:speed:units": @"m/s",


                           @"fitness:metrics:location:latitude": @37.416382,
                           @"fitness:metrics:location:longitude": @-122.152659,
                           @"fitness:metrics:location:altitude" :@42,
//Enter point 2
                           @"fitness:metrics:location:latitude": @xx.xxx,
                           @"fitness:metrics:location:longitude": @-xxx.xxx,
                           @"fitness:metrics:location:altitude" :@xx,
//Enter point 3, 4, 5 ...
... ...
                           @"fitness:metrics:timestamp" :@"2011-01-26T00:00",
                           @"fitness:metrics:distance:value" :@0,
                           @"fitness:metrics:distance:units":@"mi" ,
                           @"fitness:metrics:pace:value" :@0,
                           @"fitness:metrics:pace:units" :@"s/m",
                           @"fitness:metrics:calories":@0,

                           };

      



https://developers.facebook.com/docs/reference/opengraph/object-type/place

0


source







All Articles