cordova


Ionic/Cordova Facebook login stopped working


I have been using Ionic 3.1.1 with the Cordova Facebook Plugin with AngularFire2 to log into Firebase. It has been working perfectly for months, and has now stopped working. (I am not sure if it is a result of an upgrade from Ionic 2 to Ionic 3.1.1)
Here is my code:
login.ts
loginFacebookCordova(): Promise<FirebaseAuthState> {
return new Promise<FirebaseAuthState>((resolve) => {
Facebook.login(['public_profile', 'email']).then(facebookData => {
let cred: firebase.auth.AuthCredential = firebase.auth.FacebookAuthProvider.credential(facebookData.authResponse.accessToken);
firebase.auth().signInWithCredential(cred).then((data: FirebaseAuthState) => {
resolve(data);
});
}, error => {
this.loading.dismiss();
console.error('loginFacebook: ' + error);
this.doAlert('loginFacebook: ' + error.message);
});
});
}
loginFacebookBrowser(): Promise<FirebaseAuthState> {
return new Promise<FirebaseAuthState>((resolve) => {
this.af.auth.login({ provider: AuthProviders.Facebook, method: AuthMethods.Popup }).then((data: FirebaseAuthState) => {
resolve(data);
}).catch((error) => {
this.loading.dismiss();
console.error('loginFacebook', error);
this.doAlert('loginFacebook: ' + error.message);
});
});
}
config.xml
<plugin name="cordova-plugin-facebook4" spec="~1.7.4">
<variable name="APP_ID" value="XXXXXXXXXXX" />
<variable name="APP_NAME" value="theWhoZoo" />
</plugin>
1. Browser
If I try login with a browser (non Cordova), I get the following warning in the console:
auth.js:101 firebase.auth.AuthCredential.provider is deprecated.
Please use the providerId field instead.
I then get a verification email, which I verify as usual, and then attempt to log in. It fails with the following error message:
core.es5.js:1084 ERROR Error: Uncaught (in promise): Error: Loading
chunk 4 failed. Error: Loading chunk 4 failed.
2. Android Devise
When I try login with an Android device (Cordova plugin), I get the following:
Invalid key has: The key has xXXXXXXXXXXX= does not match any stored
hashes. Configure your app key hashes at
https://developers.facebook.com/apps/XXXXXXXXXXX/
When I look at the basic settings at developers.facebook.com, my APP ID matches the variable APP_ID in my config.xml.
I am using:
"angularfire2": "^2.0.0-beta.8",
"firebase": "^3.7.5",
I have looked through documentation, and I cannot find what has changed or what may have affected this Facebook login. If anyone can assist I would greatly appreciate it.
I need help with both browser and Cordova login.
Thanks
The issue was in developers.facebook.com my Key Hash was incorrect. This fixed the issue for the Android login as well as the browser login (not sure why?).
developers.facebook.com -> Settings -> Basic - Android -> Key Hashes.

Related Links

How can I stop using the radio in my app?
Phonegap can't pair tablet and desktop app or command line, Phonegap server never receives any calls.
Estimote iBeacons and Cordova - sending push notifications when app is killed iOS
Error adb.exe when running Visual Studio 2015 RC
Cordova get device display density
href='geo:' for navigation with PhoneGap
Twitter API POST in cordova/ionic
cannot uninstall Cordova plugin
Local notifications plugin cause the Ionic app to crash on device
Cordova-supported Node.js version
Storing Application Settings in a Visual Studio Cordova Project
phonegap plugin onload=false has no effect
Building Cordova using Sencha CMD
using cordova VS tools how to I add preprocessor directives like “DISABLE_PUSH_NOTIFICATIONS”
InAppBrowser prevent from closing when close button pressed
Building combined armv7/x86 apk after Crosswalk integration in an Ionic project

Categories

HOME
logic
amazon-dynamodb
jsoup
rabbitmq
junit
environment-variables
ios8
distributed-database
purescript
spring-transactions
fluent-assertions
twitter-typeahead
android-constraintlayout
twitter-streaming-api
greedy
virtuoso
jsx
ddos
pywavelets
android-appbarlayout
master-detail
spring-4
kafka-python
ggiraph
hp-quality-center
android-adapter
word
package-name
rrd4j
transitions
gobject
uievent
gulp-usemin
libphonenumber
reduce
winlims
evosuite
lpc
matlab-uitable
allegro5
terminal-emulator
lab-color-space
google-gadget
nsoutlineview
stdio
swig-template
raptor
flowgear
rational-team-concert
onbeforeunload
lzma
powergrep
idfa
pysqlite
tstringgrid
openembedded
materialized-views
mpmediapickercontroller
kermit
hashbytes
ngen
interspire-shopping-cart
kismet-wireless
vin
stop-words
freetextbox
angularjs-e2e
remotipart
pull-to-refresh
cgimagesource
clang-complete
struts-config
assetslibrary
looper
fibonacci-heap
set-include-path
blogml
ipod-nano
vmwaretasks
pia

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile