Question

My app needs to send a private message to the user's Facebook friend. The user needs to grant the XMPP permission before my app can do this.

[[FBSession activeSession]
    requestNewPublishPermissions:[NSArray arrayWithObjects:
        @"publish_stream",
        @"xmpp_login",
        nil
    ]
    defaultAudience:FBSessionDefaultAudienceEveryone
    completionHandler:^(FBSession *session, NSError *error) {
    }
];

The above code will pop up this alert view as expected:

enter image description here

However, even before tapping any button, this warning is printed out in the debug log:

FBSDKLog: FBSession: a permission request for publish or manage permissions contains unexpected read permissions

Surely enough, after tapping the "OK" button, the completion handler comes back with an error, containing the same warning. I understand that the Facebook API requires asking for read and write permissions separately, but the xmpp_login permission seems to need both read and write at the same time. I'm at a dead end here.

  • iOS 7.1
  • Facebook SDK 3.12.0
  • Xcode 5.1
Was it helpful?

Solution

See the section Extended Permissions in this link.

According to this, xmpp_login is the read permission, not the write/publish permission. So you should add that the readPermission

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top