Skip to content

Latest commit

 

History

History
178 lines (129 loc) · 8.58 KB

TROUBLESHOOTING.md

File metadata and controls

178 lines (129 loc) · 8.58 KB

Troubleshooting

Can't solve your issue here? Check the existing issues on Github. If you still cannot find a solution please create and issue after reading the contributing guide.

When creating a Github issue remember to:

  • List your platform!
  • Provide sample code
  • Provide a log (Xcode console or adb logcat)

Troubleshooting contents

General

How do I Add a Like Button?

The better way to understand this little "workflow" is to manipulate the Graph API on the og.likes endpoint using the Facebook Graph Explorer tool.

Where is the init API?

  • Problem

    • I was using FB.init() and now it's not working.
  • Solution

    • You are using an out-dated API. Please check the new API with sample code and sample projects in platforms/ios and platforms/android.

Android

No Reply From Login?

  • Problem

    • facebookConnectPlugin.login doesn't call neither success nor faillure methods. - When I'm disconnected from Facebook and don't have the native app, the iframe fallback is blank. Checking on chrome inspector, the elements are set to display: none.
  • Solution

    • Copy and paste the following code to print your hash. Add the hash to your Facebook Developer Dashboard.
try {
  PackageInfo info =
  cordova.getActivity().getPackageManager().getPackageInfo("com.goapes.golearn", PackageManager.GET_SIGNATURES);

  for (Signature signature : info.signatures) {
      MessageDigest md = MessageDigest.getInstance("SHA");
      md.update(signature.toByteArray());
      Log.e("MY KEY HASH:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
  }

} catch (NameNotFoundException e) {

} catch (NoSuchAlgorithmException e) {

}

Facebook error: Session was closed and was not closed normally

  • Problem

    • Receiving the above error and no return from login.
  • Solution

My Hash Does Not Work, I am Using Windows

  • Problem

  • Solution

    • Use one of these versions when creating your hash: openssl-0.9.8e_X64.zip or openssl-0.9.8d_X64.rar

You should not use the openssl-0.9.8k_X64.zip.

Open Fullscreen Dialog in Landscape Orientation

  • Problem:

    • In landscape orientation the dialog is too small to use keyboard input
  • Solution:

    • One can force the dialog to be displayed fullscreen, providing additional screen space for the dialog

Add this import to facebookConnectPlugin.java

import android.content.res.Configuration;

Change the feed dialog from:

WebDialog feedDialog = (new WebDialog.FeedDialogBuilder(me.cordova.getActivity(), Session.getActiveSession(), paramBundle)).setOnCompleteListener(dialogCallback).build();
feedDialog.show();

to

WebDialog.FeedDialogBuilder feedDialog = (new WebDialog.FeedDialogBuilder(me.cordova.getActivity(), Session.getActiveSession(), paramBundle)).setOnCompleteListener(dialogCallback);
if (cordova.getActivity().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
	feedDialog.setTheme(android.R.style.Theme_Wallpaper_NoTitleBar_Fullscreen);
}
feedDialog.build().show();

Change the feed dialog from:

WebDialog requestsDialog = (new WebDialog.RequestsDialogBuilder(me.cordova.getActivity(), Session.getActiveSession(), paramBundle)).setOnCompleteListener(dialogCallback)
	.build();
requestsDialog.show();

to

WebDialog.RequestsDialogBuilder requestsDialog = (new WebDialog.RequestsDialogBuilder(me.cordova.getActivity(), Session.getActiveSession(), paramBundle)).setOnCompleteListener(dialogCallback);
if (cordova.getActivity().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
	requestsDialog.setTheme(android.R.style.Theme_Wallpaper_NoTitleBar_Fullscreen);
}
requestsDialog.build().show();

iOS

Missing FacebookConnectPlugin

  • Problem:
    • CDVPlugin class FacebookConnectPlugin (pluginName: facebookconnectplugin) does not exist.
  • Solution:
    1. Open up Xcode
    2. Go to "Build Phases"
    3. Ensure that the following file is added under "Compile Sources":
      • FacebookConnectPlugin.m
    4. Ensure that the following is added under "Link Binary With Libraris":
      • FacebookSDK.framework
      • libsqlite3.dylib
      • Social.framework
      • Accounts.framework
      • Security.framework

Cordova and plugman seems to have some problems adding frameworks etc. when re-installing/upgrading plugins.

Login Always Opens Web Dialog Even Though Native App is Installed

  • Problem:
    • Calling the login function always opens the web dialog even though the native app is installed on the device.
  • Solution:
    • Switch "deep linking" to ON in the Facebook developer website settings for your application

Login fails with devices running iOS 10