Skip to content

Commit 749ca05

Browse files
committed
Fixing Facebook authentication
1 parent 200298b commit 749ca05

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Authentication/X-Facebook-Platform/XMPPXFacebookPlatformAuthentication.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
static NSString *const XMPPFacebookChatHostName = @"chat.facebook.com";
2121

22+
static char facebookAppIdKey;
23+
2224
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2325
#pragma mark -
2426
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -241,7 +243,7 @@ - (NSString *)facebookAppId
241243
__block NSString *result = nil;
242244

243245
dispatch_block_t block = ^{
244-
result = objc_getAssociatedObject(self, "facebookAppId");
246+
result = objc_getAssociatedObject(self, &facebookAppIdKey);
245247
};
246248

247249
if (dispatch_get_current_queue() == xmppQueue)
@@ -257,7 +259,7 @@ - (void)setFacebookAppId:(NSString *)inFacebookAppId
257259
NSString *newFacebookAppId = [inFacebookAppId copy];
258260

259261
dispatch_block_t block = ^{
260-
objc_setAssociatedObject(self, @"facebookAppId", newFacebookAppId, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
262+
objc_setAssociatedObject(self, &facebookAppIdKey, newFacebookAppId, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
261263
};
262264

263265
if (dispatch_get_current_queue() == xmppQueue)
@@ -288,7 +290,7 @@ - (BOOL)authenticateWithFacebookAccessToken:(NSString *)accessToken error:(NSErr
288290
{
289291
XMPPXFacebookPlatformAuthentication *facebookAuth =
290292
[[XMPPXFacebookPlatformAuthentication alloc] initWithStream:self
291-
appId:nil
293+
appId:self.facebookAppId
292294
accessToken:accessToken];
293295

294296
result = [self authenticate:facebookAuth error:&err];

0 commit comments

Comments
 (0)