We are developing an SDK for developers which in core depends on Firebase to get tokens, therefore we are using FirebaseOptions to initialize our firebaseInstance
In the new firebase updates they said: we should provide APP_ID and API_KEY.
Is there any alternative for that as SDK developers?
If not, is there a way to get API_KEY from dashboard instead of download the googel-service.json and extract from it manually?
Both API key and App ID can be found in the Firebase console too.
The API key you need is called Web API Key and can be found in the general gettings screen in the Firebase console.
The App ID can be found when you select a specific app from that general setting screen, and is under the label App ID
Related
I have one query regarding usage of client Id in Google Developers console.
For one project, someone had created one clientId for using Google fit API's for storing fitness data. And I don't have the credentials for account used for creating the Client-id. Also I'm not able to find the client-id anywhere in code.
Now I want to add Google Sign-in using "AppAuth for Android". For which I need to add clientId and redirectUri in code.
My question is, can I create new clientId and redirectUri with any other account using same SHA1 fingerprint and package name? or Do I have to use the same existing client-id? (which doesn't seem to be a possible way)
Edit1:
As #iainmcgin mentioned I tried to create one using the same SHA-1 and package name, but getting below error.
The fingerprint that you specified is already being used by an Android OAuth2 client ID in this project or another project.
Google engineer on the Google Identity Platform team here - we enforce a 1:1 mapping between client IDs and package name + certificate hash, so you can't create another client ID. You'll need to regain access to the project that defined the original client ID; if you are not able to do that, contact me at iainmcgin#google.com with the details of your app and I'll try and put you in touch with people that can verify your ownership of the app and either delete the original client, or give you access to the original project, whichever turns out to be more appropriate.
I need to use Google analytics services in my app (android and ios). I created a project in Google API Console and imported it into Firebase for FCM services. But after that, I cannot link the Google project into Google Analytics and get configuration file. When I try to get configuration file and select app name, it jumps to Firebase console.
If I add Android or iOS in the Firebase project, the configuration file I got doesn't have google analytics info.
Anyone know how to solve this. I need to use Google Analytics in my app but not the Firebase analytics.
I also need to support both standalone Google Analytics SDK and Firebase Analytics, and I was finally able to find a solution in this Google Analytics Support answer (Analytics for mobile apps).
Google Analytics without Firebase:
Go to Google Analytics > Admin > Create new Property
Select Website, using your app name as Website Name, and optionally your company website as Website URL.
Back up to the Admin page.
For the Property you just created, in the right-most column (View), there should be an "All Website Data" view. Create a new View.
Select Mobile App, naming the view something appropriate, like "All Mobile Data".
Note: Property Settings will now contain a valid GA Tracking ID you'll need for client set-up.
Google Analytics with Firebase:
Create a Firebase project for your app.
Go to Google Analytics > Admin > Create new Property
Select Mobile App, then use the "Link to Firebase" dropdown to connect to the Firebase project you created in Step 1.
Keep in mind that while there is still a standalone, non-Firebase Google Analytics API to support legacy applications, Google is definitely pushing all new application-development over to Firebase APIs. My opinion is that this solution is mainly good for libraries that need to support new & legacy apps, or during a transitional period.
Refill and Re-enter your application name in App name field manually, so that you will not have to select the routing to the Firebase option and it will not take you to the firebase console.
It's a silly thing by google
TO go to enable or disable the api like map , drive and other of google apis from Firebase project go to this link and will see all api , hope this help.
1. If you don't have GoogleAnalytcs library in your project, get it.
You can use cocoapods: pod 'Google/Analytics'.
2. Get Tracking ID from https://analytics.google.com. If you have not created an analytics account yet, you can do it there:
3. Add this Tracking ID to GoogleService-info.plistwith key TRACKING_ID:
4. Configure the app:
// Configure tracker from GoogleService-Info.plist.
var configureError:NSError?
GGLContext.sharedInstance().configureWithError(&configureError)
5. Example - sending screenView:
func sendScreenView(name: String) {
let tracker:GAITracker = GAI.sharedInstance().defaultTracker as GAITracker
let build = GAIDictionaryBuilder.createScreenView().set(name, forKey: kGAIScreenName).build() as NSDictionary
tracker.send(build as [NSObject : AnyObject])
}
Note: Above procedure is for iOS, Android configurations should be similar.
I have an Android app with push notifications send by GCM. I set this up a few years ago. All works fine.
Now i want to manage my API keys but the Google Play Developer Console is not showing the API keys anymore, like they use to do. They always link to the new Firebase API.
I tried https://console.cloud.google.com/apis/credentials but the new API keys won't be accepted by Google and the old one doesn't show up there. That's maybe because I can't link it to my Android app.
Where can I still manage my GCM API keys? I want to create a new one but I don't want to migrate my project to Firebase. Is this still possible?
Go to Android Start and click Get a Configuration File. There you'll be able to generate GCM API keys. The same goes if you're using iOS.
If you are like me and gave in to FCM, you can still use the GCM project identity: its under console, FCM settings and contains the server key and identity.
Visit this link and follow the steps
https://developers.google.com/mobile/add?platform=android
Download the google-service.json file, it contains the keys you need
So, I am building an Android module that will be provided to android apps as a Gradle dependency (or AAR package). Eg. Just like Mixpanel, Google Analytics provide their modules to interact with their services, we will be providing our service's SDK to interact easily with our service.
I'll refer our module as SDK and the app in which it is included as Parent App.
For enhances user experience, we would like to fetch an ID_TOKEN of the user using the Parent App. But fetching an ID_TOKEN involves creating a Client ID in cloud.google.com using the SHA1 signature of the build key and the name of the package.
When someone would be including our SDK in their apps (Parent App), we cannot know what the SHA1 signature of their build key is and what the name of their package is.
I was wondering how we can achieve this. Or a better question: Is it something that can be done only if we ask in OUR OWN apps?
Thanks for this.
I assume you are referring to ID token for a Google account (i.e. sign in with Google).
First of all, GoogleAuthUtil.getToken was the legacy way of retrieving an ID token, which won't give you the best user experience. Check out this blog post for details:
http://android-developers.blogspot.com/2016/05/improving-security-and-user-experience.html
You should use Auth.GOOGLE_SIGN_IN_API instead for ID token retrieval:
https://developers.google.com/identity/sign-in/android/backend-auth#send-the-id-token-to-your-server
Second, if it's "Parent App" that requests a token, the app's identity will be "Parent App" to Google's OAuth backend, and you are right, no way you can masquerade the token retrieval as your app. (And it doesn't make sense if you could masquerade as one single app. Assuming you distribute your SDK to 100 apps, user giving OAuth grant to app 1 should not make app 2 auto get the grant).
But as long as you:
Ask your SDK consumers to register with Google:
https://developers.google.com/identity/sign-in/android/start-integrating#get-config
Ask them to share with you their registered client ID for "Web
Application" type and you can help them generate a config file your
SDK is capable of reading.
In your Android SDK / module, you read the config file and use the client id when GoogleSignInOptions.Builder.requestIdToken(CLIENT_ID_FROM_CONFIG_FILE)
On your server, make sure to check ID token's 'audience' is one of
the registered client IDs.
Then it should work.
Hope it helps.
I created an application that displays emergency numbers and allows the user to add their own emergency numbers to the list.
I also created a web application project to handle the server part of the app.
I can run it locally, but I need to store it globally on the GAE.
I am aware that I need an application ID, but how do I link my android application to that web application that I have deployed?
Do I need to insert the API key somewhere and switch on any services?
Its not creating my numbers now if I deploy so I know Im doing it wrong. Please please help.
In the Api Console you need to enable the "Google Cloud Messaging For Android" service.
Then, In "API Access" tab, you need to add a Server Key, and an Android Key (actually two android keys - one for debug and one later for the released version - don't forget that!)
Then in the Endpoint classes you need to add the following to the #Api annotation:
clientIds - The Ids of the Android Client Keys
audiences - The "Client ID for web applications"
Which will eventually look like this:
#Api(name = "endpoint_name"
clientIds = {"porject_number-android_debug_key.apps.googleusercontent.com",
"porject_number-android_release_key.apps.googleusercontent.com"},
audiences = {"project_number.apps.googleusercontent.com"})
Above the class declaration.