I'm trying to add the Google-plus login to my app, but no matter what I do I cannot get it working on a real Android device.
So far I was able to get the idToken from this plugin
cordova-plugin-googleplus
Using Firebase's singInWithCredential(idToken) I get an error that said:
This app, identified by the domain where it is hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.
I want to point out that I follow all the steps for the installation, SHA1 key are correct and I am using signed APKs.
Using the facebook plugin, retrieving the token and signInWithCredential worked without any issue.
Thanks in advance!
it seems like you have some API key restrictions that are not met by your ionic application.
To begin with, please check you are using the API key from the "Web setup" popup, under the auth section of the Firebase console for your project. This one should work out of the box if you have not changed your configuration in the API console.
If that doesn't fix the issue, go to the credentials section of the Google API console for your Firebase project, look for the API key that you are using, and check which referrer restrictions are set there and ensure they are met by your application. Read this answer for several options that you have to set up your API key restrictions for a Cordova app.
In my Ionic2 RC1 + Firebase3.5 + AngularFire2.beta5 project I had the same problem... Google Auth with Popup worked in Browser but not in my Android .APK
Note.- I didn't use Tokens in my App
Firstly, I add 192.168.1.172 to my Firebase Console authorized domain list and <allow-navigation href="http://192.168.1.172:8100"/> to my config.xml.
After this, I found that installing Cordova InAppBrowser plugin solves my problem definitively.
I didn't need to modify my code, only plug and play, exactly like David East says in his Social login with Ionic blog.
Related
I implemented google login in flutter without using firebase in flutter (google cloud console). It was working in apk then later I needed push notification service for which I used firebase (fcm token and all) then I released the app to playstore but google login does not work. I keep getting apiexception error. Has anybody faced this issue? if yes any help would be highly appreciated.
I do not have a specific answer to your problem but I have also faced this problem once, I accidentally resolved it though.
But Error 12500 is a general error code that may occur when attempting to use the Google Sign-In feature and is caused by a few potensial issues:
An issue with the SHA-1 fingerprint of your app's signing
certificate: To use Google Sign-In, you need to configure your app's
SHA-1 fingerprint and package name in the Firebase console. Make
sure that the fingerprint and package name you have configured in
the Firebase console match the ones you are using to sign your app.
An issue with the Google Services configuration file: Make sure you
have properly added the Google Services configuration file to your
app.
An issue with the Google Play Services library: Make sure you have
the latest version of the Google Play Services library installed in
your app.
An issue with the device or emulator you are using: Make sure you
are testing on a device or emulator that has Google Play Services
installed and is up to date.
Possible fixes to try/check:
Double-check the SHA-1 fingerprint and package name: Make sure that
the SHA-1 fingerprint and package name you have configured in the
Firebase console match the ones you are using to sign your app.
Make sure you have added the Google Services configuration file: The
Google Services configuration file is required for your app to
communicate with Google services, including Google Sign-In. Make
sure you have properly added this file to your app.
Update the Google Play Services library: Make sure you have the
latest version of the Google Play Services library installed in your
app. You can check for updates by going to the "SDK Manager" in
Android Studio.
Test on a device or emulator with Google Play Services installed:
Make sure you are testing on a device or emulator that has Google
Play Services installed and is up to date.
I hope this helps! I will quickly search if I can find any other solution.
My Flutter app for Android uses the place_picker plugin, to which I pass the Maps API key as follows (from the docs):
PlacePicker("YOUR API KEY");
Everything works fine until I restrict the API usage to Android apps with my SHA1 signature, which works for all other packages I am using, namely the google_maps_flutter plugin, which uses that same API key.
Why does the API not work with the plugin? It's still running in my app signed by me.
Thanks in advance.
Everyone I am using vidyo library in android. I am able to see preview but not able to connect to api. Anyone can help me. I generate token with cmd in Windows. There is any problem with vidyo library versions. Please Tell me which version work for Android 6.0.
Can you copy paste the error messages shown on the console?
The most common error during connecting is an invalid token. Double check if the token is valid. to test you can create a token on this helper website - https://vidyocreatetoken.appspot.com/
Note, in your username do not include any special characters (especially '#'). And get your developer key and app Id from the vidyo dashboard - https://developer.vidyo.io/dashboard
I am trying to setup Firebase in my Nativescript app(Angular 2- TypeScript). However, It prompts me the error as below.
A valid Facebook app id must be set in the AndroidManifest.xml or set by calling Facebook.setApplicationId before Initializing the sdk.
Why should I provide the Facebook app ID for the start-up?
Any idea?
Much appreciate.
I have resolved by reinstalling the native-script-firebase-plugin without initialized the Facebook's Authentication for this error message "A valid Facebook app id must be set in the AndroidManifest.xml or set by calling Facebook.setApplicationId before Initializing the SDK"
As for the second error message "Google Play Service is required on this device", I just installed and upgraded the Google Play Service on the particular Android Emulator, and it works fine now.
In conclusion, is worth to check the Google Play Service it has been installed and upgraded to the appropriate version or not.
I'm using Xamarin Forms in Visual Studio 2015 with the new MSAL preview v.1.1.0. The app calls the PublicClientApplication.AcquireTokenAsync which pulls up the login form in Chrome on the mobile device. The login is successful, but when it redirects I get the error message "This site can't be reached. The webpage at msal[my app id]://auth/?code=[auth code]... might be temporarily down or it may have moved permanently to a new web address.
When stepping through the app I see that the PublicClientApplication's redirect uri property is set to msal[my app id]://auth. And that is the same custom redirect uri that I entered into the Azure B2C tenant application.
Does anyone have any suggestions from that error of what I should check? Thanks.
OK. I figured it out. I missed the instruction in step 6b on the new sample app: https://github.com/Azure-Samples/active-directory-b2c-xamarin-native. There needs to be a BrowserTabActivity added inside the application element of the AndroidManifest.xml file. See the link on github for specifics.
You should check out the Integrate Azure AD B2C into a Xamarin forms app using MSAL sample.
This issue generally has the following causes:
You haven't configured your RedirectURI correctly in your AndroidManifest.xml, double check that you've populated both the scheme and the host correctly, where scheme only includes msal[APPLICATIONID] without colon, slashes or 'auth' and the host while the host only includes 'auth'
You haven't configured your RedirectURI correctly in your MainActivity.cs, double check that it matches the full redirect URI, meaning that it does include colon, slash and 'auth' like so: msal[APPLICATIONID]://auth
You're missing the OnActivityResult method that calls the AuthenticationContinuationHelper.
You need to use Chrome which is not installed on all images inside your emulator.
Running in an Android Emulator
MSAL in Android requires support for Custom Chrome Tabs for displaying authentication prompts. Not every emulator image comes with Chrome on board: please refer to this document for instructions on how to ensure that your emulator supports the features required by MSAL.