Play services API suggests that there is something called Instance ID
However, after including the following in Android Studio, I am unable to import InstanceID class
compile "com.google.android.gms:play-services-identity:${googlePlayServicesVersion}"
compile "com.google.android.gms:play-services-auth:${googlePlayServicesVersion}"
Per this SO Post, InstanceID class should work if I include the identity play services library.
Following conversion of google cloud messaging to firebase cloud messaging, I believe, it must have been replaced by Firebase Instance ID as mentioned in the red message here.
Now I am not sure if using Firebase ID should have indeed "replaced" Instance ID.
Or, maybe I am missing some library which includes InstanceID?
Yap,
I had the issue, and finally I realize that InstanceID class is a part of 'com.google.android.gms:play-services-iid' library , so you just have to add this line in your gradle build file:
compile "com.google.android.gms:play-services-iid:${googlePlayServicesVersion}"
Unless this works for me :) ...
Related
I have the following setup in my grade files:
project:
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
app:
implementation platform('com.google.firebase:firebase-bom:29.0.0')
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-messaging'
After the users logs in, I'm doing
FirebaseMessaging.getInstance().getToken().addOnCompleteListener(task -> {
String refreshToken = task.getResult();
....
}
which is fine for most users, but for some (not only a few) get errors like FIS_AUTH_ERROR, MISSING_INSTANCEID_SERVICE, SERVICE_NOT_AVAILABLE.
I guess (!), MISSING_INSTANCEID_SERVICE is no Google API on the device, SERVICE_NOT_AVAILABLE missing network (?) but I'm not sure at all. And I have absolutely no clue about the FIS_AUTH_ERROR. Is there some documentation about this?
MISSING_INSTANCEID_SERVICE
Tokens can't be generated.
SERVICE_NOT_AVAILABLE
The device cannot read the response, or there was a server error.
FIS_AUTH_ERROR
you need to check the documentation get token and get id methods had changed
I think it has to do with firebase dependencies versions mismatch. Try to import the BoM for the Firebase platform. By using BoM your app will always use compatible versions of the Firebase Android libraries.
dependencies {
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:30.0.2')
// .... }
FIS_AUTH_ERROR suggests, that the local installation cannot be authenticated:
Firebase Cloud Messaging uses Firebase installation IDs to target devices for message delivery.
Source: Manage Firebase installations
It's a little difficult, unless having a device available, which would show this issue - or somehow being able to narrow this down - by hardware vendor, Android version or package version - because "some (not only a few)" is relatively meaningless, from a technical perspective.
It could well be, that the SHA1/SHA265 key fingerprint might have been changed (you should know) and "some (not only a few)" might still haven't updated to the latest version of the APK/AAB package, signed with the new signing key. Crashlytics would show the package version. You could add the old SHA1/SHA265 key fingerprint back in, so that their instances could authenticate again.
I have integrated my Firebase and Fabric projects since it's available few days ago.
I have such kind of fabric events tracking configured in my code:
Answers.getInstance().logCustom(new CustomEvent("Entity Click").putCustomAttribute("domain", entity.getDomain()).putCustomAttribute("entity", entity.entityId));
But in my Firebase console under Analytics -> Events and Analytics -> StreamView, I can't seem to see Fabric events get integrated over. All I can see is the normal generic Firebase events:
ad_click
ad_impression
app_clear_data
app_remove
app_update
first_open
os_update
screen_view
session_start
Did I misunderstand something?
UPDATE:
Portion of my build.gradle file:
classpath 'io.fabric.tools:gradle:1.24.4'
compile('com.crashlytics.sdk.android:crashlytics:2.7.1#aar') {
transitive = true;
}
#I did not use firebase-core
compile 'com.google.firebase:firebase-config:11.6.0'
compile 'com.google.firebase:firebase-ads:11.6.0'
compile 'com.google.firebase:firebase-messaging:11.6.0'
UPDATE 2:
In Fabric Console, Tools -> Firebase shows the linking in green:
UPDATE 3:
I'm using the new Firebase UI. Under Spark Plan, did not currently link to Big Query.
I did not really pay attention to my firebase events the past few days. But this morning I integrated my Firebase project over to Google Analytics at https://analytics.google.com in hope to gain some missing features like city/state level real-time location info. Turns out there's nothing new and it's the same info that I can find from Firebase Console. But when I check out the Events tab, I can now see my Fabric events. I then headed back to Firebase Console, and found my fabric events are showing now.
It could be the Analytics triggered the integration, or could have already populated in my Firebase prior to any of this. Either way, it's working for me now. :)
After I successfully integrated flurry SDK into the library by using this code in my build.gradle file.
compile 'com.flurry.android:analytics:6.2.0'
I created java Class to integrate my API Key into my code, but I faced this probleme and I have no clue what should I do to successfully integrate it
-cannot resolve symbol FlurryAgent
-cannot resolve symbol flurrylistener
PS: I'm new to Flurry analytics and Android Studio
For now just remove the withListener() line.
It's not necessary to initialize Flurry.
Once you have your integration working, you can go back and set it up if you want, I've found it only to be necessary if you need to send events before Flurry completes initialization.
Flurry is working to get this corrected. Joel Duggan is correct the listener is "only necessary if you need to send events before Flurry completes initialization."
We will be removing this line of code from the basic instructions:
.withListener(flurryListener)
And here is the correct syntax for those who need it:
import com.flurry.android.FlurryAgentListener;
....
FlurryAgent.Builder()
.withLogEnabled(true)
.withListener(new FlurryAgentListener() {
#Override
public void onSessionStarted() {
// Session handling code
}
})
.build(this, 'your_api_key');
I was facing same problem, I have updated gradle and my problem is solved. Use latest gradle as follows,
//Flurry
compile 'com.flurry.android:analytics:7.0.0#aar'
for more reference use this url
We integrated libGoogleAnalyticsServices.jar in our app and it is working fine. By default it includes 'VERSION_CODE' from BuildConfig.java when sending messages to Google Analytics service. I'd like to include 'VERSION_NAME' instead of 'VERSION_CODE'.
1. Is there a way to get a project for libGoogleAnalyticsServices.jar?
2. Is there a way to configure libGoogleAnalyticsServices class to send version_name instead of version_code?
I'm following the tutorial on GCM here http://developer.android.com/guide/google/gcm/gs.html
At point 5 of Step 2, it says:
Add the following intent service:
service android:name=".GCMIntentService"
This intent service will be called by the GCMBroadcastReceiver (which is is provided by GCM library), as shown in the next step. It must be a subclass of com.google.android.gcm.GCMBaseIntentService, must contain a public constructor, and should be named my_app_package.GCMIntentService (unless you use a subclass of GCMBroadcastReceiver that overrides the method used to name the service).
However, I can't subclass com.google.android.gcm.GCMBaseIntentService, the import can't be resolved. How do I fix this?
You have to install the libraries: http://developer.android.com/guide/google/gcm/gs.html#libs
From the SDK Manager, install Extras > Google Cloud Messaging for Android Library. This creates a gcm directory under YOUR_SDK_ROOT/extras/google/ containing these subdirectories: gcm-client, gcm-server, samples/gcm-demo-client, samples/gcm-demo-server, and samples/gcm-demo-appengine.
Download gcm.jar from here and place it in YOUR_PROJECT/app/libs directory
and then add compile files('libs/gcm.jar') line in build.gradle file