Question

NSString *facebookIDString = [NSString stringWithFormat:@"%lld", facebookID];
// Put together the dialog parameters
NSMutableDictionary *params =
[NSMutableDictionary dictionaryWithObjectsAndKeys:
 facebookIDString, @"to",
 @"MY APP NAME", @"name",
 @"MY APP CAPTION", @"caption",
 @"MY APP DESCRIPTION", @"description",
 @"http://www.myApp.com", @"link",
 @"https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png", @"picture",
 FACEBOOK_APP_ID, @"app_id",
 nil];

// Invoke the dialog
[FBWebDialogs presentDialogModallyWithSession:[FBSession activeSession]
                                           dialog:@"feed"
                                       parameters:params
                                          handler:
 ^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
    //My code here
 }];

UPDATE: I just commented out the @"picture" key in params and now I see a "Post to Wall" header with "Okay" button but the content of the modal says "Cannot post to user's Wall" (actually this is random and happens sometimes...Most of the time I still get empty view)

If I remove the @"to" key, the modal seems to work as expected with the content to post to my own wall, but I want to post to friends' walls.

I thought it was a permissions issue, but I printed out [FBSession activeSession] and I have publish_stream

<FBSession: 0x146a72d0, state: FBSessionStateOpen, loginHandler: 0x146a77d0, appID: <My APP_ID>, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x145c3b20>, expirationDate: 4001-01-01 00:00:00 +0000, refreshDate: 2014-02-22 18:14:14 +0000, attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(
    "create_note",
    "basic_info",
    "share_item",
    "status_update",
    "user_friends",
    "publish_actions",
    "publish_checkins",
    "video_upload",
    "publish_stream",
    "photo_upload",
    installed,
    email,
    "public_profile",
    "user_birthday",
    "user_location"
)>
Était-ce utile?

La solution

I figured out my problem. I assumed FBGraphUser.id was of type long long instead of NSString* so I was casting it and converting, which generated an invalid id I guess.. Now it shows correctly.

Guess I should have checked the doc: https://developers.facebook.com/docs/reference/ios/3.0/protocol/FBGraphUser/

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top