Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy can't I authenticate to Facebook Chat in my iOS application?
    primarykey
    data
    text
    <p>I have been scouring the internet trying to find a solution to this problem. I understand the basic idea on how it is supposed to work, but I can't get the implementation to work and I can't find any decent examples to help me. So far I have successfully been able to log in a user using the iOS 6 authentication mechanism, but I cannot figure out how to authenticate a user to the Jabber server from there. Here is what I have:</p> <p>After the user has logged in <code>connect</code> is called</p> <pre><code>-(void)connect { [self setupStream]; NSError *error = nil; [_xmppStream authenticateWithFacebookAccessToken: FBSession.activeSession.accessTokenData.accessToken error:&amp;error]; NSLog(@"%@", error); [NSString stringWithFormat:@"%@", self]; } -(void)newSetupStream { _xmppStream = [[XMPPStream alloc] initWithFacebookAppId:@"611051652253156"]; #if !TARGET_IPHONE_SIMULATOR { xmppStream.enableBackgroundingOnSocket = YES; } #endif _xmppReconnect = [[XMPPReconnect alloc] init]; _xmppRosterStorage = [[XMPPRosterCoreDataStorage alloc] init]; _xmppRoster = [[XMPPRoster alloc] initWithRosterStorage:_xmppRosterStorage]; _xmppRoster.autoFetchRoster = YES; _xmppRoster.autoAcceptKnownPresenceSubscriptionRequests = YES; _xmppvCardStorage = [XMPPvCardCoreDataStorage sharedInstance]; _xmppvCardTempModule = [[XMPPvCardTempModule alloc] initWithvCardStorage:_xmppvCardStorage]; _xmppvCardAvatarModule = [[XMPPvCardAvatarModule alloc] initWithvCardTempModule:_xmppvCardTempModule]; _xmppCapabilitiesStorage = [XMPPCapabilitiesCoreDataStorage sharedInstance]; _xmppCapabilities = [[XMPPCapabilities alloc] initWithCapabilitiesStorage:_xmppCapabilitiesStorage]; _xmppCapabilities.autoFetchHashedCapabilities = YES; _xmppCapabilities.autoFetchNonHashedCapabilities = NO; [_xmppReconnect activate:_xmppStream]; [_xmppRoster activate:_xmppStream]; [_xmppvCardTempModule activate:_xmppStream]; [_xmppvCardAvatarModule activate:_xmppStream]; [_xmppCapabilities activate:_xmppStream]; [_xmppStream addDelegate:self delegateQueue:dispatch_get_main_queue()]; [_xmppRoster addDelegate:self delegateQueue:dispatch_get_main_queue()]; } </code></pre> <p>No matter what I try it always returns the same error: <code>Error Domain=XMPPStreamErrorDomain Code=4 "The server does not support X-FACEBOOK-PLATFORM authentication."</code></p> <p>I am not incredibly familiar with either XMPP or the Facebook API so I'm sure there is something simple I am missing, but I have been working on this forever and been unable to make any progress. Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload