cordova-plugin-facebook-connect / cordova-plugin-facebook-connect

Use the latest Facebook SDK in your Cordova and Ionic projects
Other
63 stars 90 forks source link

Facebook SDK Update #109

Open localteampartners opened 2 years ago

localteampartners commented 2 years ago

Will updating the Facebook SDK from 11 to 12 prevent this plugin from working properly?

jbfm commented 2 years ago

Yes, will fail during build


> Task :app:compileDebugJavaWithJavac FAILED
/Users/johnmick/code/360player/app/cordova/platforms/android/app/src/main/java/org/apache/cordova/facebook/ConnectPlugin.java:257: error: cannot find symbol
        AppEventsLogger.deactivateApp(cordova.getActivity().getApplication());
                       ^
  symbol:   method deactivateApp(android.app.Application)
  location: class com.facebook.appevents.AppEventsLogger
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/johnmick/code/360player/app/cordova/platforms/android/app/src/main/java/com/adobe/phonegap/push/PushPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
pelkamarcin commented 2 years ago

How about this PR? https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect/pull/87

R1Daneel commented 2 years ago

Is there news about this issue?

Moghul commented 2 years ago

Any news on this? There's already an SDK 13

ijomah commented 2 years ago

Any solution with this below? I need help please. This is from ionic project

\apache\cordova\facebook\ConnectPlugin.java:257: error: cannot find symbol AppEventsLogger.deactivateApp(cordova.getActivity().getApplication()); ^ symbol: method deactivateApp(Application) location: class AppEventsLogger Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error

Task :app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

ndinhphi commented 1 year ago

Please update. Thanks

ijomah commented 1 year ago

Sorry for late reply. Kindly, navigate to this path in the specific plugin folder \apache\cordova\facebook\ConnectPlugin.java:257 comment out this line in the java file. line 257 in my case AppEventsLogger.deactivateApp(cordova.getActivity().getApplication());

Immediately I did this, my build went on successful. I discovered from research that the method is no longer needed in Facebook SDK version 12. So why keeping it

Also, if you encounter such error in Facebook SDK 13, do same by commenting the methods that cannot be found. It may not be only this in your case: AppEventsLogger.deactivateApp(cordova.getActivity().getApplication());

I hope this helps Thanks

ndinhphi commented 1 year ago

How about iOS, sir? I got a lot of error when trying to upgrade to Facebook SDK 12 for iOS

Sorry for late reply. Kindly, navigate to this path in the specific plugin folder \apache\cordova\facebook\ConnectPlugin.java:257 comment out this line in the java file. line 257 in my case AppEventsLogger.deactivateApp(cordova.getActivity().getApplication());

Immediately I did this, my build went on successful. I discovered from research that the method is no longer needed in Facebook SDK version 12. So why keeping it

Also, if you encounter such error in Facebook SDK 13, do same by commenting the methods that cannot be found. It may not be only this in your case: AppEventsLogger.deactivateApp(cordova.getActivity().getApplication());

I hope this helps Thanks

ijomah commented 1 year ago

@ndinhphi Please can you share the specific error message you got when trying to upgrade to a higher version of the SDK on iOS.

dimaskarsa commented 1 year ago

This issue still exists I choose FACEBOOK_ANDROID_SDK_VERSION to 15.2.0

pradeept-patra commented 1 year ago

activateApp(Application application): Notifies the events system that the app has launched and activate and deactivate events should start being logged automatically.

activateApp(Context context): Deprecated. Use activateApp(Application) -- In the above function call.

deactivateApp(Context context, java.lang.String applicationId): Deprecated. When using activateApp(Application) deactivate app will be logged automatically.

Reference: https://developers.facebook.com/docs/reference/androidsdk/current/facebook/com/facebook/appevents/appeventslogger.html/

So commenting out AppEventsLogger.deactivateApp(cordova.getActivity().getApplication()); will be helpful