Using Facebook Open Graph Story with map attachment (GeoPoint)

前端 未结 2 920
青春惊慌失措
青春惊慌失措 2020-12-20 07:22

I\'m trying to create some Open Graph Story with map attachment using iOS SDK and I\'m have some issues.

First of all I\'m having issues with the object creation...

2条回答
  •  一向
    一向 (楼主)
    2020-12-20 07:55

    Your custom properties should be added in a dictionary named data. In my Facebook app I have an object (inheriting from Object) with a property named position which is a geo_point.

    This is the code I use to create the object:

    NSMutableDictionary *object = [FBGraphObject openGraphObjectForPost];
    object.provisionedForPost = YES;
    object[ @"title"] = @"Title";   // for og:title
    object[ @"type"] = @"my_namespace:my_object";
    object[ @"data" ] = @{ @"position": @{ @"latitude": @55, @"longitude": @12 }};
    

提交回复
热议问题