Skip to content

Commit

Permalink
Fix openUrl handling bugs and add support for cordova-ios-5 (jeduan#751)
Browse files Browse the repository at this point in the history
* Update FacebookConnectPlugin.m

Fix jeduan#750

* Update README.md

* Upgraded facebook sdk to 5.0.2

* Fix calls to deprecated facebook sdk functions on android which caused runtime crash when called.

* Removing Bolts framework ios dependency which is not used in ios sdk v5 facebook/facebook-ios-sdk@0bdd850

* Modernized FBSDKLoginKit usage according to
facebook/facebook-ios-sdk@6c4ac12
facebook/facebook-ios-sdk@5eae2d7:

1. Replaced FBSDKLoginManagerRequestTokenHandler by FBSDKLoginManagerLoginResultBlock
2. Replaced logInWithReadPermissions and logInWithPublishPermissions by logInWithPermissions

Modernized FBSDKShareKit usage according to facebook/facebook-ios-sdk@9b682bb:

1. Updated FBSDKShareOpenGraphAction init to actionWithType
2. Replaced FBSDKGraphRequestHandler by FBSDKGraphRequestBlock

* removed irrelevant files
  • Loading branch information
guylando authored and peterpeterparker committed Jun 29, 2019
1 parent 2bfb5ae commit ae682b7
Show file tree
Hide file tree
Showing 81 changed files with 542 additions and 2,027 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ $ cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID="12345678

If you need to change your `APP_ID` after installation, it's recommended that you remove and then re-add the plugin as above. Note that changes to the `APP_ID` value in your `config.xml` file will *not* be propagated to the individual platform builds.

IMPORTANT: This plugin works as is with cordova-ios 5 but if you use earlier version of cordova-ios then you need to add the code in the following comment to your CordovaLib/Classes/Public/CDVAppDelegate.m file which was added to your project as part of the cordova-ios ios platform template: https://github.com/apache/cordova-ios/issues/476#issuecomment-460907247

## Usage

This is a fork of the [official plugin for Facebook](https://github.com/Wizcorp/phonegap-facebook-plugin/) in Apache Cordova that implements the latest Facebook SDK. Unless noted, this is a drop-in replacement. You don't have to replace your client code.
Expand Down
5 changes: 1 addition & 4 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<preference name="APP_ID" />
<preference name="APP_NAME" />
<preference name="FACEBOOK_HYBRID_APP_EVENTS" default="false" />
<preference name="FACEBOOK_ANDROID_SDK_VERSION" default="4.40.0"/>
<preference name="FACEBOOK_ANDROID_SDK_VERSION" default="5.0.2"/>

<engines>
<!-- Requires > 3.5.0 because of the custom Framework tag for iOS [CB-6698] -->
Expand Down Expand Up @@ -160,9 +160,6 @@
</array>
</config-file>

<!-- Bolts framework -->
<framework src="src/ios/Bolts.framework" custom="true" />

<!-- Facebook framework -->
<framework src="src/ios/FBSDKCoreKit.framework" custom="true" />
<framework src="src/ios/FBSDKLoginKit.framework" custom="true" />
Expand Down
6 changes: 3 additions & 3 deletions src/android/ConnectPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@ public void onError(FacebookException e) {
public void onResume(boolean multitasking) {
super.onResume(multitasking);
// Developers can observe how frequently users activate their app by logging an app activation event.
AppEventsLogger.activateApp(cordova.getActivity());
AppEventsLogger.activateApp(cordova.getActivity().getApplication());
}

@Override
public void onPause(boolean multitasking) {
super.onPause(multitasking);
AppEventsLogger.deactivateApp(cordova.getActivity());
AppEventsLogger.deactivateApp(cordova.getActivity().getApplication());
}

@Override
Expand Down Expand Up @@ -305,7 +305,7 @@ public boolean execute(String action, JSONArray args, final CallbackContext call
cordova.getThreadPool().execute(new Runnable() {
@Override
public void run() {
AppEventsLogger.activateApp(cordova.getActivity());
AppEventsLogger.activateApp(cordova.getActivity().getApplication());
}
});

Expand Down
Binary file removed src/ios/Bolts.framework/Bolts
Binary file not shown.
49 changes: 0 additions & 49 deletions src/ios/Bolts.framework/Headers/BFAppLink.h

This file was deleted.

114 changes: 0 additions & 114 deletions src/ios/Bolts.framework/Headers/BFAppLinkNavigation.h

This file was deleted.

30 changes: 0 additions & 30 deletions src/ios/Bolts.framework/Headers/BFAppLinkResolving.h

This file was deleted.

This file was deleted.

Loading

0 comments on commit ae682b7

Please sign in to comment.