Closed wwwguy closed 3 years ago
This plugin is support capacitor3. Please check demo. https://github.com/capacitor-community/facebook-login/tree/master/demo/angular
and https://github.com/capacitor-community/facebook-login/issues/47 is issue of docs(migration guide)
Humm... ok. Well since @rdlabo/capacitor-facebook-login is a different plugin from @capacitor-community/facebook-login, it would be good to mention that in the instructions here (if the @capacitor-community/facebook-login plugin does not work for capacitor v3 angular).
That said, after installing the @rdlabo/capacitor-facebook-login plugin and following the iOS and Android configuration instructions listed here (https://github.com/capacitor-community/facebook-login), the same error posted above occurs?
Also, in looking at the angular code in the demo you reference (https://github.com/capacitor-community/facebook-login/blob/master/demo/angular/src/app/auth/auth.service.ts) it shows:
import { FacebookLogin } from '@capacitor-community/facebook-login';
So... it appears to be using @capacitor-community/facebook-login and not @rdlabo/capacitor-facebook-login so I'm not sure what to take away from the demo code?
Does anyone have this plugin working using ionic capacitor v3 angualar?
@rdlabo are the installation/configuration instructions found here the correct ones to use? I have been trying to get this to build for a week but continue getting this error on Android. To help, here are the steps I'm following:
npm install @capacitor-community/facebook-login
npx cap update
Copy/pasted the updated code into android/app/src/main/java///MainActivity.java
Copy/pasted the updated code into android/app/src/main/AndroidManifest.xml
Copy/pasted the updated code into android/app/src/main/res/values/strings.xml (customized app id/token)
npx cap sync
ionic cap copy
ionic build
ionic cap run android -l --external
But when attempting to run (and before even getting to the app code itself), I get the following errors:
Task :capacitor-community-facebook-login:bundleLibCompileToJarDebug [capacitor] Note: /Users//Documents//node_modules/@capacitor-community/facebook-login/android/src/main/java/com/getcapacitor/community/facebooklogin/FacebookLogin.java uses or overrides a deprecated API.
Task :app:compileDebugJavaWithJavac FAILED [capacitor] /Users//Documents//android/app/src/main/java/io/ionic/starter/MainActivity.java:7: error: cannot find symbol [capacitor] public void onCreate(Bundle savedInstanceState) { [capacitor] ^ [capacitor] symbol: class Bundle [capacitor] location: class io.ionic.starter.MainActivity [capacitor] 1 error
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. [capacitor] Use '--warning-mode all' to show the individual deprecation warnings. [capacitor] See https://docs.gradle.org/7.0/userguide/command_line_interface.html#sec:command_line_warnings [capacitor] 303 actionable tasks: 44 executed, 259 up-to-date [capacitor]
[capacitor] FAILURE: Build failed with an exception.
I have also looked at the demo at @rdlabo/capacitor-facebook-login but am not seeing anything there to require changes to the basic install/config process outlined here.
Any help would be appreicated!
@rdlabo/capacitor-facebook-login is be for capacitor 2, and old Facebook SDK. This plugin is changed few settings. Please remove @rdlabo/capacitor-facebook-login and check this repository's demo: https://github.com/capacitor-community/facebook-login/tree/master/demo/angular
...you added this line? https://github.com/capacitor-community/facebook-login/blob/master/demo/angular/android/app/src/main/java/io/ionic/starter/MainActivity.java#L3-L8
Perfect! The additional MainActivity code is what was missing. That did it... thank you!
Throws this error when attempting to buildrun:
Execution failed for task ':app:compileDebugJavaWithJavac'. Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Appears to be related to this... in MainActivity.java
public class MainActivity extends BridgeActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); registerPlugin(com.getcapacitor.community.facebooklogin.FacebookLogin.class); } }
Is this because I'm using Capacitor v3? (looks like there's an open topic on that so perhaps the plugin isn't supporting it yet). Should we just use cordova plug for facebook login on v3 or is there a fix expected soon?