Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOD-2297] Retain Ti-SDK < 5.5.0 compatibility #66

Merged
merged 4 commits into from
Sep 13, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ To enable the use of Facebook dialogs (e.g., Login, Share), you also need to inc
</array>
```

For iOS9 and titanium 5.0.0.GA and above, App Transport Security is disabled by default so you don't need these keys.
For iOS 9+ and Titanium 5.0.0.GA and above, App Transport Security is disabled by default so you don't need these keys.
If you choose to enable it, you have to set the following keys and values in tiapp.xml:
```xml
<key>NSAppTransportSecurity</key>
Expand Down Expand Up @@ -92,6 +92,23 @@ If you choose to enable it, you have to set the following keys and values in tia
</dict>
```

For iOS 10+ and Titanium 5.5.0.GA and above, to log in using Facebook, we now have to include an entitlements file that enables
Keychain Sharing Capabilities. To do so, create a `/platform/ios/<appname>.entitlements` file with the following content:

```xml
<?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">
<plist version="1.0">
<dict>
<key>keychain-access-groups</key>
<array>
<!-- APP_ID same as the id value in the tiapp.xml file -->
<string>$(AppIdentifierPrefix)APP_ID</string>
</array>
</dict>
</plist>
```

On the android platform, in tiapp.xml or AndroidManifest.xml you must declare the following inside the \<application\> node
```xml
<activity android:name="com.facebook.FacebookActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:label="YourAppName" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" />
Expand Down
2 changes: 1 addition & 1 deletion apidoc/Facebook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ description: |

* Sharing content using Facebook dialogs or the [Like button](Modules.Facebook.LikeButton).

**Using Facebook module with iOS 10 and Xcode 8**
**Using Ti.Facebook with iOS 10 and Xcode 8**
To log in using Facebook, we now have to include an entitlements file that enables Keychain Sharing
Capabilities. To do so, create a `/platform/ios/<appname>.entitlements` file with this content

Expand Down
17 changes: 5 additions & 12 deletions ios/Classes/FacebookModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ -(void)handleRelaunch:(NSNotification *)notification

-(void)resumed:(id)note
{
// NSLog(@"[DEBUG] facebook resumed");
[self handleRelaunch:nil];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To note for the CR: This is only called by iOS < 10 and was used before.

[FBSDKAppEvents activateApp];
}

Expand Down Expand Up @@ -91,16 +91,6 @@ -(void)shutdown:(id)sender
[super shutdown:sender];
}

-(void)suspend:(id)sender
{
// NSLog(@"[DEBUG] facebook suspend");
}

-(void)paused:(id)sender
{
// NSLog(@"[DEBUG] facebook paused");
}

#pragma mark Auth Internals

- (void)populateUserDetails {
Expand Down Expand Up @@ -445,7 +435,10 @@ -(void)initialize:(id)args
[nc addObserver:self selector:@selector(accessTokenChanged:) name:FBSDKAccessTokenDidChangeNotification object:nil];
[nc addObserver:self selector:@selector(activateApp:) name:UIApplicationDidFinishLaunchingNotification object:nil];
[nc addObserver:self selector:@selector(currentProfileChanged:) name:FBSDKProfileDidChangeNotification object:nil];
[nc addObserver:self selector:@selector(handleRelaunch:) name:kTiApplicationLaunchedFromURL object:nil];

// Only triggered by Titanium SDK 5.5.0+
// Older SDK's get notified by the `resumed:` delegate
[nc addObserver:self selector:@selector(handleRelaunch:) name:@"TiApplicationLaunchedFromURL" object:nil];

if ([FBSDKAccessToken currentAccessToken] == nil) {
[self activateApp:nil];
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.5
version: 5.2.6
apiversion: 2
description: Allows Facebook integration for Titanium apps
author: Mark Mokryn, Ng Chee Kiat and Hans Knoechel
Expand Down
2 changes: 1 addition & 1 deletion ios/module.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

//
// How to add a Framework (example)
FRAMEWORK_SEARCH_PATHS=$(SRCROOT)/../../modules/iphone/facebook/5.2.5/platform "~/Library/Application Support/Titanium/modules/iphone/facebook/5.2.5/platform"
FRAMEWORK_SEARCH_PATHS=$(SRCROOT)/../../modules/iphone/facebook/5.2.6/platform "~/Library/Application Support/Titanium/modules/iphone/facebook/5.2.6/platform"
OTHER_LDFLAGS=$(inherited) -framework Social -framework FBSDKCoreKit -framework FBSDKLoginKit -framework FBSDKShareKit -framework FBSDKMessengerShareKit -framework Bolts
//
// OTHER_LDFLAGS=$(inherited) -framework Foo
Expand Down