Skip to content

Commit

Permalink
Merge pull request #68 from hansemannn/TIMOB-23904
Browse files Browse the repository at this point in the history
[TIMOB-23904] iOS 10: Fix threading-issues in authorize()
  • Loading branch information
cheekiatng authored Sep 17, 2016
2 parents b5d5aa1 + e4e994d commit 8099cf2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
8 changes: 4 additions & 4 deletions apidoc/Facebook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ description: |
* Sharing content using Facebook dialogs or the [Like button](Modules.Facebook.LikeButton).
**Using Ti.Facebook with iOS 10 and Xcode 8**
To log in using Facebook on iOS Simulator, you now must include an entitlements file that enables Keychain
Sharing Capabilities. While the entitlements file is not necessary for device build (it is self-generated),
it won't affect anything in your build. To do so, create a `/platform/ios/<name>.entitlements` file (replace
<name> with the name element in tiapp.xml) with this content:
To log in using Facebook on iOS Simulator, you now must include an entitlements file that enables Keychain
Sharing Capabilities. While the entitlements file is not necessary for device build (it is self-generated),
it won't affect anything in your build. To do so, create a `/platform/ios/name.entitlements` file (replace
name with the name element in tiapp.xml) with this content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
Expand Down
8 changes: 8 additions & 0 deletions documentation/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log
<pre>
v5.2.7 Fix iOS 10 login issue, update Facebook iOS-SDK to 4.15.1 to enhance iOS 10 / Xcode 8 support (TIMOB-23884)
Fix error with sending blobs to requestWithGraphPath (MOD-2286)
Fix permissions crash (MOD-2280)
Fix certain memory-leaks in share-dialogs
Update Facebook-SDK to 4.14.0
Fix typo in iOS-constant LOGIN_BEHAVIOR_SYSTEM_ACCOUNT
Fix presenting-mode in presentShareDialog (TIMOB-23521)

v5.2.0 Updated Facebook API to 4.11.0 in iOS and Android
Support `loginBehavior` on iOS and Android [MOD-2242]
Support new parameters in `logCustomEvent` on iOS and Android [MOD-2248]
Expand Down
4 changes: 3 additions & 1 deletion ios/Classes/FacebookModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,9 @@ -(void)authorize:(id)args
{
ENSURE_SINGLE_ARG_OR_NIL(args, NSNumber);
NSArray *permissions_ = permissions == nil ? [NSArray array] : permissions;
FBSDKLoginManager *loginManager = [[[FBSDKLoginManager alloc] init] autorelease];
__block FBSDKLoginManager *loginManager = [[FBSDKLoginManager new] retain];
[loginManager setLoginBehavior:loginBehavior];

TiThreadPerformOnMainThread(^{
[loginManager logInWithReadPermissions: permissions_ fromViewController:nil handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
if (error) {
Expand All @@ -413,6 +414,7 @@ -(void)authorize:(id)args
} else {
//DebugLog(@"[INFO] Logged in");
}
RELEASE_TO_NIL(loginManager);
}];
}, YES);
}
Expand Down
2 changes: 1 addition & 1 deletion ios/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 5.2.6
version: 5.2.7
apiversion: 2
description: Allows Facebook integration for Titanium apps
author: Mark Mokryn, Ng Chee Kiat and Hans Knoechel
Expand Down
8 changes: 4 additions & 4 deletions ios/module.xcconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//
// PLACE ANY BUILD DEFINITIONS IN THIS FILE AND THEY WILL BE
// PLACE ANY BUILD DEFINITIONS IN THIS FILE AND THEY WILL BE
// PICKED UP DURING THE APP BUILD FOR YOUR MODULE
//
// see the following webpage for instructions on the settings
// for this file:
// http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/400-Build_Configurations/build_configs.html
//
//

//
// How to add a Framework (example)
FRAMEWORK_SEARCH_PATHS=$(SRCROOT)/../../modules/iphone/facebook/5.2.6/platform "~/Library/Application Support/Titanium/modules/iphone/facebook/5.2.6/platform"
FRAMEWORK_SEARCH_PATHS=$(SRCROOT)/../../modules/iphone/facebook/5.2.7/platform "~/Library/Application Support/Titanium/modules/iphone/facebook/5.2.7/platform"
OTHER_LDFLAGS=$(inherited) -framework Social -framework FBSDKCoreKit -framework FBSDKLoginKit -framework FBSDKShareKit -framework FBSDKMessengerShareKit -framework Bolts
//
// OTHER_LDFLAGS=$(inherited) -framework Foo
Expand All @@ -25,4 +25,4 @@ OTHER_LDFLAGS=$(inherited) -framework Social -framework FBSDKCoreKit -framework
// OTHER_CFLAGS=$(inherited) -DFOO=1
//
// IMPORTANT NOTE: always use $(inherited) in your overrides
//
//

0 comments on commit 8099cf2

Please sign in to comment.