I seem to have gotten farther in Android, but still have some issues that I have asked about on another thread. In iOS, I also get different behavior for Facebook and Google login, but neither work.
Facebook login on iOS
The first time I choose Facebook, the browser opens at the Facebook login screen. After I complete the login, the browser changes to a different screen that shows about:blank at the top. Everything stops there. If I choose Done on the left side of the browser, I go back to the app with a tiny popup for the user, "The redirect operation has been cancelled by the user before finalizing. Dismiss" There is no output on the console. When I choose Facebook a second time, I do not get the facebook login screen, it behaves like google below.
Google login on iOS
When I press the Sign in with Google button I momentarily see a blank page with the url PROJECTID.firebaseapp.com. No login/account screen is ever shown. After a moment it switches to an about:blank screen and sits there. Pressing Done gives the same message as above.
Thanks for any help you can give!
Please make sure you follow the instructions:
https://firebase.google.com/docs/auth/web/cordova
You need to make sure you run this:
cordova plugin add cordova-plugin-customurlscheme --variable \
URL_SCHEME=com.firebase.cordova --save
Replace com.firebase.cordova with your iOS bundle ID. Make sure that bundle ID is also a registered Firebase iOS app for your project.
I speculate the redirect is not getting picked up by your app. There is something wrong you your cuystomurlscheme plugin.
I've done that and checked it and can't see any problems.
If I type the following in Safari on the iPad
com.qualint.readWithMeKids://
I am asked "Open this page in "Read With Me Kids"? and if I press Open my app opens.
Can you also pass the customParameters for Google here too. By the way, if you have an error in that provider, it will not work for either (android or iOS).
One good way to make sure those have been set up correctly is to first try in a browser web app.
Can you also add in your root html file and provide it back (you can truncate codes in it).
function handleOpenURL(url) {
console.log("received url: " + url);
}
This will help log the incoming URL link. I want to see if the app is receiving any app link when you finish sign in.
Since google seems broken on both platforms, this is from Facebook on iOS. I logged in, browser went to about:blank and stayed stuck there, but console printed :
received url: com.qualint.readwithmekids://google/link?deep_link_id=https%3A%2F%2Fread-with-me-kids.firebaseapp.com%2F__%2Fauth%2Fcallback%3Fcode%3DAQD_BmIGib7OvKBXvYlIs0tl7c0si45CIxuGgoK9g6nBtkBLIY...%26granted_scopes%3Demail%252Cpublic_profile%26denied_scopes%26state%3DAFD_5tlh_Xok1WI2qt_dQNvhIFA6OLgSlc4vomHq-yIWr5er816obYT5RWfi_eyqu80Q7TvqscRC8vLPOvAoOpcDZV_Z86M9Lg7-tHCBdAjvg-VhAmuGAZT7sb5xpemr5gd7I5qS6nV9VkLKP9EvnhXfSJ-0im5FGbznn7sgT0Sesd3B0qS_yjT6-BgopooKbzQRwxlYyOONmlyIciKe1TrtjMBgP8GdQOjQ2jpY6X-FpYsAyH4qoKUqzz7Ub-q9FzoCKP1zxcwZEA3BSijdDRSLxp0cIxZi3KwuQZ4HT_m1amWbUfBg6YW8v-b4QO2T1bN_C0tg98_yQvpe4FvQoPnm3o4nUoc8v_lvyz3EnJQeJvxHwxStrnBiVDiI4f1U1HF-kQHaUfLAxEdqpQNgpZLlt7w8gOaSJRyGNjvtYVyD%23_%3D_
Pressing Done says redirect operation has been cancelled.
Hmm, seems like the SDK is unable to detect the incoming link even though the plugin is actually detecting it. Can you check BuildInfo.packageName.indexOf('com.qualint.readwithmekids://') returns 0?
No it returns -1
The value of packageName is:
"com.qualint.readWithMeKids"
Yeah I think that's the reason. I am not sure what is lower casing this in the flow. We will need to look into it. To unblock yourself, can you lower case your bundle ID and test it again? We rely on BuildInfo.packageName to get the bundle ID of your app and to make sure we don't intercept links that are not intended to your app.
When I lowercase it Xcode says it can't be registered to my team and the cordova build says that there isn't a provisioning profile for it.
That's not an issue on our end. We will make the check case insensitive. We'll try to get it into the next release. If not, the one after.
Great, thanks! How often are you projecting to do releases?
This is a firebase.js change and not firebaseui related. You can check the history of releases:
https://firebase.google.com/support/release-notes/js
I suggest you create a temporary app with lower cased bundle ID to test this to make sure you get it to work.
Firebase JS SDK v4.1.3 came out today and it corrects the general OAuth problem on IOS with mixed case bundle ID.
Thanks for the quick help and updates!
Glad you got it working!
Most helpful comment
Please make sure you follow the instructions:
https://firebase.google.com/docs/auth/web/cordova
You need to make sure you run this:
cordova plugin add cordova-plugin-customurlscheme --variable \
URL_SCHEME=com.firebase.cordova --save
Replace com.firebase.cordova with your iOS bundle ID. Make sure that bundle ID is also a registered Firebase iOS app for your project.
I speculate the redirect is not getting picked up by your app. There is something wrong you your cuystomurlscheme plugin.