Git Product home page Git Product logo

cordova-plugin-facebook4's People

Contributors

antonfire avatar aogilvie avatar blaind avatar divyekhanna avatar dokterbob avatar dtritus avatar dudeofawesome avatar fme-nstokoe avatar gabrielctroia avatar goya avatar grmmph avatar jcvalerio avatar jeduan avatar jkassis avatar jkervine avatar josemedaglia avatar keab42 avatar levsa avatar matiasleidemer avatar matiassingers avatar mixtmeta avatar mkorganashvili avatar ngumby avatar pamelafox avatar peterpeterparker avatar pragunvohra avatar robertarnesson avatar shazron avatar simllll avatar stevengill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-facebook4's Issues

login and api return ONLY id and name

Facebook docs says that public_profile should return these items:
id
name
first_name
last_name
age_range
link
gender
locale
timezone
updated_time
verified

but I'm tried almost everything and I'm getting only id and name nothing else. Does enyone know why?

I also tried put instead of 'public_profile' -> 'email' but I get laso id and name. Really don't understand.

Thank for any help.

Given url is not allowed by the application configuration

Hello,

i installed this version of the facebook connect plugin and when i run it on a real device for debugging purposes i am constantly receiving this message "Given url is not allowed by the application configuration". I have tried to add many different valid auth redirect urls but no luck. Do i need to create hashes for my application if it is under debug mode?

Please help me because i can't find a solution that works..
Thank you in advance!

Duplicate Bolt Framework symbols in iOS build

I cannot build a clean install of this plugin anymore - it lists a sequence of duplicate symbols which breaks the link.

duplicate symbol _llvm.embedded.module in:
    TYK Concurso/Plugins/cordova-plugin-facebook4/Bolts.framework/Bolts(BFAppLinkTarget.o)
    TYK Concurso/Plugins/cordova-plugin-facebook4/Bolts.framework/Bolts(BFCancellationTokenRegistration.o)
duplicate symbol _llvm.cmdline in:
    TYK Concurso/Plugins/cordova-plugin-facebook4/Bolts.framework/Bolts(BFAppLinkTarget.o)
    TYK Concurso/Plugins/cordova-plugin-facebook4/Bolts.framework/Bolts(BFTaskCompletionSource.o)

These are just two from a long list.

Repro steps:

  1. Install Ionic starter app ionic start myApp
  2. Install Facebook4 plugin cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication"
  3. Build cordova ios build

My guess is this is related to the recent changes I can see in preparation for iOS 9. Should I take an older version of the plugin for now?

Question: will my old apps work without update on iOS 9

Hi @jeduan

just a short question: I've installed iOS 9 Public Beta 3, and my old Apps are still working fine with facebook-login, even when I see a warning message inside of console that a plist-file is missing (new network guidelines for iOS9)

But I can login without any problems. Will my old app work without an update to version 1.4.0-1 of your plugin? At least, iOS 9 Beta 3 works fine, dunno if this will change in GM or final. Or do I have to submit a new version now?

[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[5]

This error crashes the app and seems to happen quite often in all plugin versions.

"FacebookConnectPlugin.m" line 480 in -[FacebookConnectPlugin responseObject]
"FacebookConnectPlugin.m" line 58 in -[FacebookConnectPlugin getLoginStatus:]

One of the response values it's trying to apply is nil.
response[@"authResponse"] = @{
@"accessToken" : token.tokenString,
@"expiresIn" : expiresIn,
@"secret" : @"...",
@"session_key" : [NSNumber numberWithBool:YES],
@"sig" : @"...",
@"userID" : token.userID
};

Urgent: does not work in playstore

Hi @jeduan

just submitted my app to the playstore. When I try to login (newest version of your plugin 1.4.0-1)
I get:

screenshot_2015-09-16-12-30-03

Works fine on genymotion, but seems like it is not working on a real device. My event is starting tomorrow, what's wrong? Should I downgrade the plugin?

Invalid Key Hash

When my App is first launched I get an 'Invalid Key Hash' which asks me to check my facebook settings. The hash in the error does not match the hash that's generated with the keytool or the hash I placed in facebook.

If I press 'Okay' my App launches and everything works as expected until I remove my app and add back.

Xcode 7 build not running the Facebook App to login and uses the browser instead

Clean install using cordova 5.1.1

cordova create ftest com.domain.ftest ftest
cordova plugin add [email protected]
cordova platform add ios
cordova plugin add https://github.com/jeduan/cordova-plugin-facebook4.git --save --variable APP_ID="MYID" --variable APP_NAME="MY NAME"

add to index.js

        console.log('facebook logging in');
        window.facebookConnectPlugin.login(['public_profile'],
          function (res) {
            console.log('login ', res);

            var postInfo = {
              method: 'share',
              href: 'http://someurl.html',
            };

            window.facebookConnectPlugin.showDialog(
                         postInfo,
                         function (res) {
                           console.log('post ', res);
                         },
                         function (err) {
                           console.log('error', err);
                         });

          },
          function (err) {
            console.log('error ', err);
          });

Open Xcode 7, build and run on real device

I get a login page which looks like the browser login rather than the app. When I post I get a message that says I need to login.

Using an AppLink in the share dialog

I have generated an AppLink using the Facebook hosting API (mobile-only app), and it is of the form "https://fb.me/123456789". I am now trying to show a "share" dialog using your plugin and this link doesn't work for me on iOS. Any other link works fine, but using an app link results in the "share" dialog just having an infinite spinner on it and clicking post returns me to my app but doesn't actually post. It does work fine when testing in the browser, however. This approach used to work fine with Cordova 3.x and the WizCorp Facebook plugin, but having upgraded to Cordova 5.x and your plugin this problem has appeared.

App keeps crashing

Hi Jeduan. I had been using the facebook phonegap plugin for login on my app and it worked fine just that it would open a popup for the login instead of using the already installed facebook app on the device. Saw that updating for SDK4 can solve this issue. Tried to rebuild the app about 4 times with your updated plugin but it crashes right after it loads.

I have setup APP_ID, SECRET and VERSION just like the previous plugin asks. Does any of this needs to change. How can I make the facebook4 plugin work ?

Thanks!

Share Dialog empty

So I am using the following code as per the readme but the dialog is completely empty with no image or any of the text. I did complete the share and entered my own text, which worked, but pointless. The sharing works fine when the native Facebook app is not installed on the device.

facebookConnectPlugin.showDialog({
    method: "share",
    picture:'https://www.google.co.jp/logos/doodles/2014/doodle-4-google-2014-japan-winner-5109465267306496.2-hp.png',
    name:'Test Post',
    message:'First photo post',
    caption: 'Testing using phonegap plugin',
    description: 'Posting photo using phonegap facebook plugin'
  }, function (response) {
    console.log(response)
  }, function (response) {
    console.log(response)
  }
);

Cordova version 5.2.0
Cordova Android version 4.1.1

Any help would be greatly appreciated.

FAILED BUILD Android with cordova-plugin-facebook4

Hello.
I use OS Ubuntu 12, cordova 5.3.3, ionic 1.6.4.
Without the use of a plugin (cordova-plugin-facebook4)[https://github.com/jeduan/cordova-plugin-facebook4] assembly is successful.
Build with plugin (cordova-plugin-facebook4)[https://github.com/jeduan/cordova-plugin-facebook4] have error:

org.xwalk:xwalk_core_library:14+

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_armv7DebugCompile'.
   > Could not find any version that matches com.android.support:support-v4:[22,23).
     Searched in the following locations:
         https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml
         https://repo1.maven.org/maven2/com/android/support/support-v4/
         https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/android/support/support-v4/maven-metadata.xml
         https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/android/support/support-v4/
     Required by:
         :android:unspecified > com.facebook.android:facebook-android-sdk:4.6.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.404 secs

/home/artem/android/stretch/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error code 1 for command: /home/artem/android/stretch/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/artem/android/stretch/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /home/artem/android/stretch/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /home/artem/android/stretch/platforms/android/cordova/build: Command failed with exit code 1
    at ChildProcess.whenDone (/usr/local/node/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

The decision from issue #39 does not help me.

Multiple dex files define Landroid/support/v4/...

Hi,
I ran into this error when I try to build:

    UNEXPECTED TOP-LEVEL EXCEPTION:
    com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompatIcs;

I think it is a conflict with another plugin.

I try to follow the following link, but it doesn't work.

http://stackoverflow.com/questions/20989317/multiple-dex-files-define-landroid-support-v4-accessibilityservice-accessibility?answertab=active#tab-top

Applauding your efforts to update: What are your plans for this version?

Hi, I, for one, am very glad that you're taking up updating this very important plugin. It would be good if you updated the README to announce your plans or intent.
I'm particularly curious as to whether you will:

  1. add functionality to support full HTTP verbs: e.g. DELETE (which is required to remove Game invites & app requests
  2. Will you support the new Facebook SDK now v2.4

Cannot remove cordova-plugin-facebook4 1.3

Trying to remove 1.3 so that I can install 1.4. But when entering :
ionic plugin remove cordova-plugin-facebook4

I am getting :
TypeError: Cannot read property 'buffer' of undefined at walk_obj (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/plist/lib/build.js:131:18) at walk_obj (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/plist/lib/build.js:98:7) at walk_obj (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/plist/lib/build.js:109:9) at Object.build (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/plist/lib/build.js:76:3) at ConfigFile_save [as save] (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/ConfigFile.js:97:47) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/ConfigKeeper.js:61:49 at Array.forEach (native) at ConfigKeeper_save_all [as save_all] (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/ConfigKeeper.js:59:31) at PlatformMunger_save_all [as save_all] (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/config-changes.js:82:24) at Object.exports.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/config-changes.js:59:12)

Open in native Facebook app?

Hey I just replaced the Wizcorp facebook plugin with this one. I was hoping that it'd open in the native Facebook app. Does this plugin not do this in iOS 9? Thanks.

I also followed all the Facebook steps found here.

img_1482

User cancelled

Hey guys,

when I start my app and want to log in on iOS I get "User cancelled". But when I try log in again immediately after this issue I can log in successfuly. And then when I log out and try log in it's working fine again. This is happening just when I start the app on IOS.

Any idea? please help. Thank you

Thanks for any help

facebookConnectPlugin is not defined

When calling browserInit method to use facebookConnectPlugin to test in the browser facebookConnectPlugin is undefined. (I'm calling it on deviceReady and only on browser, but it really doesn't work).

There are a few issues about this on the original repo but it seems like no one is supporting it.

Xcode 7 errors

I'm getting the following errors with Xcode 7

Undefined symbols for architecture x86_64:
"_FBSDKErrorLocalizedDescriptionKey", referenced from:
___31-[FacebookConnectPlugin login:]_block_invoke in FacebookConnectPlugin.o
___34-[FacebookConnectPlugin graphApi:]_block_invoke in FacebookConnectPlugin.o
___34-[FacebookConnectPlugin graphApi:]_block_invoke246 in FacebookConnectPlugin.o
-[FacebookConnectPlugin loginWithPermissions:withHandler:] in FacebookConnectPlugin.o
"OBJC_CLASS$_FBSDKAccessToken", referenced from:
objc-class-ref in FacebookConnectPlugin.o
"OBJC_CLASS$_FBSDKAppEvents", referenced from:
objc-class-ref in FacebookConnectPlugin.o
"OBJC_CLASS$_FBSDKAppInviteContent", referenced from:
objc-class-ref in FacebookConnectPlugin.o
"OBJC_CLASS$_FBSDKAppInviteDialog", referenced from:
objc-class-ref in FacebookConnectPlugin.o
"OBJC_CLASS$_FBSDKApplicationDelegate", referenced from:
objc-class-ref in FacebookConnectPlugin.o
"OBJC_CLASS$_FBSDKGameRequestContent", referenced from:
objc-class-ref in FacebookConnectPlugin.o
"OBJC_CLASS$_FBSDKGameRequestDialog", referenced from:
objc-class-ref in FacebookConnectPlugin.o
"OBJC_CLASS$_FBSDKGraphRequest", referenced from:
objc-class-ref in FacebookConnectPlugin.o
"OBJC_CLASS$_FBSDKLoginManager", referenced from:
objc-class-ref in FacebookConnectPlugin.o
"OBJC_CLASS$_FBSDKMessageDialog", referenced from:
objc-class-ref in FacebookConnectPlugin.o
"OBJC_CLASS$_FBSDKShareDialog", referenced from:
objc-class-ref in FacebookConnectPlugin.o
"OBJC_CLASS$_FBSDKShareLinkContent", referenced from:
objc-class-ref in FacebookConnectPlugin.o
ld: symbol(s) not found for architecture x86_64

iOS don't work

Hi,

when I try to use this plugin on iOS, (eg. login) I get:

 -[__NSCFString count]: unrecognized selector sent to instance 0x7ff1b3c4eb60
2015-08-11 17:00:45.044 Zeltapp[20925:2927833] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInvalidArgumentException> -[__NSCFString count]: unrecognized selector sent to instance 0x7ff1b3c4eb60

Is this related to the whitelist plugin or something like this?

window.facebookConnectPlugin.showDialog always return "OK"

var options = { method:"feed",name:title,caption: "test",description: desc,"link": url,"picture": pic};
window.facebookConnectPlugin.showDialog(options,
function (result) {
alert(JSON.stringify(result));
$(this).alertmsg('Thanks for sharing','short','center');
},
function (e) {
});

window.facebookConnectPlugin.showDialog always return "OK", but nothing shared.

Android Build Failed

With the following error:

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lbolts/AggregateException;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)

Any idea why?

Can't upload archive to App Store iTunes Connect

After running the guide, I have a working build for emulator. When I try to archive and send to the App Store, it reports Found an unexpected Mach-O header code: 1918975009 which the logs point to files missing in this plugin.

[MT] Beginning distribution assistant for archive: push-tutorial, task: Submit
[MT] Automatically selecting the only availaable distribution method <IDEDistributionMethodiOSAppStoreDistribution: 0x7f912faedf40>
[MT] [OPTIONAL] Didn't find archived user entitlements for <DVTFilePath:0x7f9137813a30:'/Users/user/Library/Developer/Xcode/Archives/2015-08-31/push-tutorial 8-31-15, 2.04 AM.xcarchive/Products/Applications/push-tutorial.app/www/lib/phonegap-facebook-plugin/platforms/ios/FacebookSDK.framework/Versions/A'>: Error Domain=NSCocoaErrorDomain Code=4 "Item at "/Users/user/Library/Developer/Xcode/Archives/2015-08-31/push-tutorial 8-31-15, 2.04 AM.xcarchive/Products/Applications/push-tutorial.app/www/lib/phonegap-facebook-plugin/platforms/ios/FacebookSDK.framework/Versions/A" did not contain a "archived-expanded-entitlements.xcent" resource." UserInfo={NSLocalizedDescription=Item at "/Users/user/Library/Developer/Xcode/Archives/2015-08-31/push-tutorial 8-31-15, 2.04 AM.xcarchive/Products/Applications/push-tutorial.app/www/lib/phonegap-facebook-plugin/platforms/ios/FacebookSDK.framework/Versions/A" did not contain a "archived-expanded-entitlements.xcent" resource.}
2015-08-31 07:06:09 +0000 [MT] Canceled distribution assistant

phonegap-facebook-plugin/platforms/ios/FacebookSDK.framework/Versions/A" did not contain a "archived-expanded-entitlements.xcent" resource."

Sharedialog Graph 2.4 error

Hi,

tried to use the .showDialog(). Nothing happens, but in console, I see:

FBSDKLog: starting with Graph API v2.4, GET requests for /me/apprequestformerrecipients should contain an explicit "fields" parameter

How can I fix that?

Add this specific plugin in phonegap build?

Is there a way at all to use this one?

< gap:plugin name="com.phonegap.plugins.facebookconnect" >
< param name="APP_ID" value="" />
< param name="APP_NAME" value="" />
< /gap:plugin>

This is the old one, what i need to do to use this one?

No events being logged on the Android version

You say: "Activation events are automatically tracked for you in the plugin."
Meaning you must be calling the AppEventsLogger.activateApp.

Problem is I am getting no events from the Android version.

This is an issue you inherited from the previous now deprecated version of this plugin since it had the exact same problem.

Instead, I get this message from FB:

Why am I seeing this message: "Your app’s using an older version of the Android SDK and may not count all installs. Update your app to use the latest Android SDK."?

If you are using version 3.19.0 or earlier of the Facebook Android SDK, there is an issue with counting all installs. We recommend upgrading to the latest version of the Facebook Android SDK. This guide walks through updating to the latest version of the Android SDK.

iOS Dialog after Posting

After posting a new link I get an OK dialog with text 'index.html {}' OK.
Everything works as expected other than the unexpected dialog.

          facebookConnectPlugin.showDialog({
              method: 'share',
              href: articleInfo.url
            },

XCode issues with iOS9

Hi! I'd love to use the recent Facebook SDK version, so I tried your fork. However I'm getting the following error in XCode when I try to build on my test device:

ld: 'AppProject/Plugins/cordova-plugin-facebook4/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKGraphRequestPiggybackManager.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture

Honestly I have no idea what that means or how to solve it. Could you help?
I use Xcode 7 beta and try to build for iOS 9.

Facebook4 1.3.0 Android GraphRequest Warning

On Android I get now the following warning when requesting friendlist:
"Request without access token missing application ID or client token"
nothing more happens then. It is linked with my Facebook Login Button.
And the Plugin gets the following Logentry:
"D/ConnectPlugin﹕ activity result in plugin: requestCode(64206), resultCode(-1)"

But if I click 2 , 3 or 4 Times then it is working sometime. Very rarely it is working with one click and that is dumb because should work all the time with 1st click.

EDIT:
Only happens on Android.
I do save signed in people with fb_access_token and id for example. And if this error happens every entry is "null". Very strange, don't know where this comes from because neither error nor success function gets called. I only experienced this on Browser till now. But when updated to Facebook4 1.3.0 now this happens also for android. (Already have browser issue here and then changed to this fork because thought this would maybe fix it but it didn't: Wizcorp#1114)

App crash when clicking back on App Invite dialog

09-09 15:53:08.388: E/AndroidRuntime(28564): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=64213, result=-1, data=Intent { (has extras) }} to activity {be.xxxxxxxxxx.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.error(org.json.JSONObject)' on a null object reference
09-09 15:53:08.388: E/AndroidRuntime(28564): at android.app.ActivityThread.deliverResults(ActivityThread.java:4058)
09-09 15:53:08.388: E/AndroidRuntime(28564): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4101)
09-09 15:53:08.388: E/AndroidRuntime(28564): at android.app.ActivityThread.access$1400(ActivityThread.java:177)
09-09 15:53:08.388: E/AndroidRuntime(28564): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1497)
09-09 15:53:08.388: E/AndroidRuntime(28564): at android.os.Handler.dispatchMessage(Handler.java:102)
09-09 15:53:08.388: E/AndroidRuntime(28564): at android.os.Looper.loop(Looper.java:145)
09-09 15:53:08.388: E/AndroidRuntime(28564): at android.app.ActivityThread.main(ActivityThread.java:5942)
09-09 15:53:08.388: E/AndroidRuntime(28564): at java.lang.reflect.Method.invoke(Native Method)
09-09 15:53:08.388: E/AndroidRuntime(28564): at java.lang.reflect.Method.invoke(Method.java:372)
09-09 15:53:08.388: E/AndroidRuntime(28564): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
09-09 15:53:08.388: E/AndroidRuntime(28564): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
09-09 15:53:08.388: E/AndroidRuntime(28564): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.error(org.json.JSONObject)' on a null object reference
09-09 15:53:08.388: E/AndroidRuntime(28564): at org.apache.cordova.facebook.ConnectPlugin.handleError(ConnectPlugin.java:724)
09-09 15:53:08.388: E/AndroidRuntime(28564): at org.apache.cordova.facebook.ConnectPlugin.access$4(ConnectPlugin.java:709)
09-09 15:53:08.388: E/AndroidRuntime(28564): at org.apache.cordova.facebook.ConnectPlugin$6.onCancel(ConnectPlugin.java:223)
09-09 15:53:08.388: E/AndroidRuntime(28564): at com.facebook.share.widget.AppInviteDialog$1.onSuccess(AppInviteDialog.java:149)
09-09 15:53:08.388: E/AndroidRuntime(28564): at com.facebook.share.internal.ShareInternalUtility.handleActivityResult(ShareInternalUtility.java:174)
09-09 15:53:08.388: E/AndroidRuntime(28564): at com.facebook.share.widget.AppInviteDialog$2.onActivityResult(AppInviteDialog.java:159)
09-09 15:53:08.388: E/AndroidRuntime(28564): at com.facebook.internal.CallbackManagerImpl.onActivityResult(CallbackManagerImpl.java:82)
09-09 15:53:08.388: E/AndroidRuntime(28564): at org.apache.cordova.facebook.ConnectPlugin.onActivityResult(ConnectPlugin.java:251)
09-09 15:53:08.388: E/AndroidRuntime(28564): at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:120)
09-09 15:53:08.388: E/AndroidRuntime(28564): at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:353)
09-09 15:53:08.388: E/AndroidRuntime(28564): at android.app.Activity.dispatchActivityResult(Activity.java:6549)
09-09 15:53:08.388: E/AndroidRuntime(28564): at android.app.ActivityThread.deliverResults(ActivityThread.java:4054)
09-09 15:53:08.388: E/AndroidRuntime(28564): ... 10 more

If I comment

        @Override
        public void onCancel() {
        //    FacebookOperationCanceledException e = new FacebookOperationCanceledException();
        //    handleError(e, showDialogContext);
        }

        @Override
        public void onError(FacebookException e) {
         //   Log.e("Activity", String.format("Error: %s", e.toString()));
          //  handleError(e, showDialogContext);
        }

if works

App Invites

I see reference to App Invites in the readme of this plugin but the code doesn't appear to support them. Is this planned for the future?

Bolts framework bitcode issue...

Hi there,

Thanks for the awesome plugin. Works seamlessly... Except until after updating to XCode 7.
Bolts framework needs to be rebuilt with bitcode enabled. Seems like an update will be needed next week. (BoltsFramework/Bolts-ObjC#153)

1> cd /Users/dogu/.taco_home/remote-builds/taco-remote/builds/96573/cordovaApp/platforms/ios
1> export IPHONEOS_DEPLOYMENT_TARGET=7.0
1> export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/dogu/.taco_home/node_modules/taco-remote-lib/1.0.1/node_modules/taco-remote-lib/node_modules/ios-sim/build/release:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
1> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -L/Users/dogu/.taco_home/remote-builds/taco-remote/builds/96573/cordovaApp/platforms/ios/build/device -F/Users/dogu/.taco_home/remote-builds/taco-remote/builds/96573/cordovaApp/platforms/ios/build/device -FMyApp/Plugins/cordova-plugin-facebook4 -filelist /Users/dogu/.taco_home/remote-builds/taco-remote/builds/96573/cordovaApp/platforms/ios/build/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/armv7/MyApp.LinkFileList -miphoneos-version-min=7.0 -dead_strip -fembed-bitcode-marker -weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -ObjC -fobjc-arc -fobjc-link-runtime -framework AssetsLibrary /Users/dogu/.taco_home/remote-builds/taco-remote/builds/96573/cordovaApp/platforms/ios/build/device/libCordova.a -framework CoreGraphics -framework MobileCoreServices -framework CoreBluetooth -framework CoreLocation -weak_framework AudioToolbox -framework Bolts -framework FBSDKCoreKit -framework FBSDKLoginKit -framework FBSDKShareKit -weak_framework SystemConfiguration -weak_framework Social -weak_framework MessageUI -framework QuartzCore -Xlinker -dependency_info -Xlinker /Users/dogu/.taco_home/remote-builds/taco-remote/builds/96573/cordovaApp/platforms/ios/build/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/armv7/MyApp_dependency_info.dat -o /Users/dogu/.taco_home/remote-builds/taco-remote/builds/96573/cordovaApp/platforms/ios/build/device/MyApp.app/MyApp

1> ld: 'MyApp/Plugins/cordova-plugin-facebook4/Bolts.framework/Bolts(BFAppLinkTarget.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7
1>clang : error : linker command failed with exit code 1 (use -v to see invocation)

1>
1> ** BUILD FAILED **

showDialog empty content

I use this code to show share dialog

var post_id = fid.split('_');
            var options = {
                method: "feed",
                link: 'http://www.facebook.com/permalink.php?story_fbid=' + post_id[1] + '&id=' + post_id[0]
            };

            $cordovaFacebook.showDialog(options)
                .then(function(success) {
                    console.log(success)
                    alert('options');
                },
                function(error) {
                    console.log(error)
                });

on iOS it's work ok, but on Android I get empty content
http://prntscr.com/8m9vm1

What can be the reason for it?

App crash when calling graph API batch request

Hi,

I switched to this fork from the main one and for now everything is working OK except for "batch" graph API requests (which used to work correctly in the main repo).

Other API requests work fine, but whenever I perform a request like:

?batch=%5B%7B%22method%22%3A%22GET%22%2C%22relative_url%22%3A%22435396597909517_822187284564581%22%7D%5D&method=post

which is the url-encoded version of:

?batch=[{"method":"GET","relative_url":"435396597909517_822187284564581"}]&method=post

the app crashes. I can see these lines in the output:

2015-07-22 14:36:31.757 TestApp[560:70463] -[__NSCFArray objectForKeyedSubscript:]: unrecognized selector sent to instance 0x17446f7c0
2015-07-22 14:36:31.761 TestApp[560:70463] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFArray objectForKeyedSubscript:]: unrecognized selector sent to instance 0x17446f7c0'

If I call bt in the LLDB console, this output is displayed:

* thread #1: tid = 0x1133f, 0x00000001941d7270 libsystem_kernel.dylib`__pthread_kill + 8, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001941d7270 libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x0000000194275170 libsystem_pthread.dylib`pthread_kill + 112
    frame #2: 0x000000019414eb18 libsystem_c.dylib`abort + 112
    frame #3: 0x00000001931e1418 libc++abi.dylib`abort_message + 116
    frame #4: 0x0000000193200b8c libc++abi.dylib`default_terminate_handler() + 304
    frame #5: 0x0000000193a143c0 libobjc.A.dylib`_objc_terminate() + 128
    frame #6: 0x00000001931fdbb4 libc++abi.dylib`std::__terminate(void (*)()) + 16
    frame #7: 0x00000001931fd73c libc++abi.dylib`__cxa_rethrow + 144
    frame #8: 0x0000000193a14294 libobjc.A.dylib`objc_exception_rethrow + 44
  * frame #9: 0x000000010013ad00 TestApp`-[FBSDKURLConnection connectionDidFinishLoading:](self=<unavailable>, _cmd=<unavailable>, connection=<unavailable>) + 272 at FBSDKURLConnection.m:146
    frame #10: 0x00000001817c4300 CFNetwork`__65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 80
    frame #11: 0x00000001817c4290 CFNetwork`-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 208
    frame #12: 0x00000001817c440c CFNetwork`-[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 60
    frame #13: 0x000000018169763c CFNetwork`___ZN27URLConnectionClient_Classic26_delegate_didFinishLoadingEU13block_pointerFvvE_block_invoke + 104
    frame #14: 0x0000000181761238 CFNetwork`___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 104
    frame #15: 0x000000018168373c CFNetwork`RunloopBlockContext::_invoke_block(void const*, void*) + 76
    frame #16: 0x0000000181c28cdc CoreFoundation`CFArrayApplyFunction + 68
    frame #17: 0x00000001816835e8 CFNetwork`RunloopBlockContext::perform() + 136
    frame #18: 0x000000018168349c CFNetwork`MultiplexerSource::perform() + 312
    frame #19: 0x00000001816832c8 CFNetwork`MultiplexerSource::_perform(void*) + 68
    frame #20: 0x0000000181d00240 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    frame #21: 0x0000000181cff4e4 CoreFoundation`__CFRunLoopDoSources0 + 264
    frame #22: 0x0000000181cfd594 CoreFoundation`__CFRunLoopRun + 712
    frame #23: 0x0000000181c292d4 CoreFoundation`CFRunLoopRunSpecific + 396
    frame #24: 0x000000018b67f6fc GraphicsServices`GSEventRunModal + 168
    frame #25: 0x0000000186826f40 UIKit`UIApplicationMain + 1488
    frame #26: 0x000000010009ed5c TestApp`main(argc=1, argv=0x000000016fd679e8) + 76 at main.m:32
    frame #27: 0x00000001940bea08 libdyld.dylib`start + 4

I tried following the issue in the debugger and it seems to me that it comes from the FB SDK itself, but I'm not 100% sure. Can you take a look to see where the problem comes from? Thank you

duplicate symbol _llvm.embedded.module errors with latest code

I'm getting the following errors when building [email protected] with Xcode 6.4. Any ideas how to fix this? Does this have anything to do with bitcode in the FB SDK 4.6?

duplicate symbol _llvm.embedded.module in:
/Plugins/cordova-plugin-facebook4/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKGraphRequestPiggybackManager.o)
/Plugins/cordova-plugin-facebook4/FBSDKShareKit.framework/FBSDKShareKit(FBSDKAppInviteContent.o)
...
ld: 226 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

App won't open in iOS

Everything appears to be setup fine, and the Deep Linking is set to Yes, however whenever I run the login() method it still brings up the web browser. Any ideas?

Issues with android Versioning

Hi,

I am not sure why exactly but the plugin is complaining in Phonegap Build that the version is not supported:

Error - Plugin error (you probably need to remove plugin files from your app): 
npm http GET https://registry.npmjs.org/cordova-plugin-facebook4/1.0.1 
npm http 200 https://registry.npmjs.org/cordova-plugin-facebook4/1.0.1 
npm http GET https://registry.npmjs.org/cordova-plugin-facebook4/-/cordova-plugin-facebook4-1.0.1.tgz 
npm http 200 https://registry.npmjs.org/cordova-plugin-facebook4/-/cordova-plugin-facebook4-1.0.1.tgz 
Failed to install 'cordova-plugin-facebook4':CordovaError: 
Plugin doesn't support this project's cordova-android version. cordova-android: 3.6.3, failed version requirement: >=4.0.0-dev 
at checkEngines (/home/ec2-user/.npm/lib/node_modules/plugman-npm/node_modules/cordova-lib/src/plugman/install.js:116:29) 
at /home/ec2-user/.npm/lib/node_modules/plugman-npm/node_modules/cordova-lib/src/plugman/install.js:289:16 
at _fulfilled (/home/ec2-user/.npm/lib/node_modules/plugman-npm/node_modules/q/q.js:787:54) 
at self.promiseDispatch.done (/home/ec2-user/.npm/lib/node_modules/plugman-npm/node_modules/q/q.js:816:30) 
at Promise.promise.promiseDispatch (/home/ec2-user/.npm/lib/node_modules/plugman-npm/node_modules/q/q.js:749:13) 
at /home/ec2-user/.npm/lib/node_modules/plugman-npm/node_modules/q/q.js:557:44 
at flush (/home/ec2-user/.npm/lib/node_modules/plugman-npm/node_modules/q/q.js:108:17) 
at process._tickCallback (node.js:442:13) 
Plugin doesn't support this project's cordova-android version. cordova-android: 3.6.3, failed version requirement: >=4.0.0-dev

Which confuses me since I am using 3.6.3 and this plugin requires > 4. Could you maybe change it from -dev to just > 4. Maybe that would help.

[Android] Login dialog cancel crashes the app

Hi,

First of all, thanks for the great work of updating the plugin.

Our app crashes if the user cancels the login dialog. Device is running Lollipop 5.1.

handleError method logging at line 120 fails if exception is the type of FacebookOperationCanceledException, because the message and toString() is null.
Seems there are more messageless exception types in SDK, so probably should wrap the logger.

Here's the exception happening:
https://www.dropbox.com/s/xp47cdr4vo8mz79/Screenshot%202015-07-24%2014.32.51.png?dl=0

and here's the stack:

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=64206, result=0, data=Intent { (has extras) }} to activity {org.teleport.teleportmobile/org.teleport.teleportmobile.MainActivity}: java.lang.NullPointerException: println needs a message
at android.app.ActivityThread.deliverResults(ActivityThread.java:3659)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3702)
at android.app.ActivityThread.access$1300(ActivityThread.java:155)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1366)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5343)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
Caused by: java.lang.NullPointerException: println needs a message
at android.util.Log.println_native_inner(Native Method)
at android.util.Log.println_native(Log.java:290)
at android.util.Log.e(Log.java:416)
at org.apache.cordova.facebook.ConnectPlugin.handleError(ConnectPlugin.java:647)
at org.apache.cordova.facebook.ConnectPlugin.access$300(ConnectPlugin.java:50)
at org.apache.cordova.facebook.ConnectPlugin$2.onCancel(ConnectPlugin.java:120)
at com.facebook.login.LoginManager.finishLogin(LoginManager.java:509)
at com.facebook.login.LoginManager.onActivityResult(LoginManager.java:191)
at com.facebook.login.LoginManager$1.onActivityResult(LoginManager.java:139)
at com.facebook.internal.CallbackManagerImpl.onActivityResult(CallbackManagerImpl.java:82)
at org.apache.cordova.facebook.ConnectPlugin.onActivityResult(ConnectPlugin.java:225)
at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:120)
at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:320)
at android.app.Activity.dispatchActivityResult(Activity.java:6218)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3655)
... 10 more

Success/error callbacks are not getting called on Android

I tested this on Android 4.4.4 and on 5.0. In both cases, login works fine, and returns data back to the app, but after doing a showDialog(share) or appInvite nothing gets returned. My logcat shows:

W/CordovaInterfaceImpl(28060): Got an activity result, but no plugin was registered to receive it.

This works fine on iOS.

Anyone?

Integrate native alert permission on iOS instead of jumping around apps

Please provide the native facebook permission alert. "Jumping" around the apps is so ugly and so 2013.
ccsoft/cordova-facebook#65

I would love to do this by myself, but I really don't have enough know how on this. I hope we could see some of this features. If you want, I could open an own ticket for my wishes but I thought this thread is a good place for it.

There was a ticket on the original Facebook plugin.
Wizcorp#910

Seems like this is not a big deal to implement. Only a few code changes inside of the FacebookConnect.m file. I don't know if this has any sideeffects.

facebookConnectPlugin always returns null

I have a simple app to login to Facebook.
But everytime I try to connect to facebook the plugin returns null.
What am I missing?
thanks

angular.module('starter', ['ionic'])
//... extra code removed

.controller('loginCtrl', ['$scope', '$state', function($scope, $state) {
  var fbLogged = new Parse.Promise();

  var fbLoginSuccess = function(response) {
    if (!response.authResponse){
      fbLoginError("Cannot find the authResponse");
      return;
    }
    var expDate = new Date(
      new Date().getTime() + response.authResponse.expiresIn * 1000
    ).toISOString();

    var authData = {
      id: String(response.authResponse.userID),
      access_token: response.authResponse.accessToken,
      expiration_date: expDate
    }
    fbLogged.resolve(authData);
    console.log(response);
  };

  var fbLoginError = function(error){
    fbLogged.reject(error);
  };

  $scope.login = function() {
    console.log('Login');
    if (!window.cordova) {
        console.log('Login.cordova');
      facebookConnectPlugin.browserInit('FACEBOOK_APP_ID');
    }
///facebookConnectPlugin is always null
    facebookConnectPlugin.login(['email'], fbLoginSuccess, fbLoginError);

    fbLogged.then( function(authData) {
      console.log('Promised');
      return Parse.FacebookUtils.logIn(authData);
    })
    .then( function(userObject) {
      facebookConnectPlugin.api('/me', null, 
        function(response) {
          console.log(response);
          userObject.set('name', response.name);
          userObject.set('email', response.email);
          userObject.save();
        },
        function(error) {
          console.log(error);
        }
      );
      $state.go('home');
    }, function(error) {
      console.log(error);
    });
  };
}])

index.html's body

<head>
  <script src="lib/ionic/js/ionic.bundle.js"></script>
 <script src="js/app.js"></script>
  </head>
 <body ng-app="starter">
    <ion-pane>
      <div ui-view></div>
    </ion-pane>

    <div id="fb-root"></div>

    <!-- Need to place at the end to prevent appendChild error -->
    <script src="lib/facebookConnectPlugin.js"></script>    
  </body>

login.html

<ion-content>
  <div style="padding: 10px; height: 100%;">
    <button class="button button-block button-positive" ng-click="login()">
      Log in with Facebook
    </button>
  </div>
</ion-content>

Urgent Problem: facebook connect in app a) jumps into app b)

Hi,

I have two apps with your plugin installed. When I try to login using App A, it opens the facebook-app and after signing in, it jumps to App B.

I need to submit the app tomorrow and I just stepped trough this issue by accident. Do you have a quick fix or workaround for that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.