A useful feature from Crashlytics by Firebase is to set a userID for a session, to later look up that particular user's crash events.
It doesn't seem to be working in my Android app however. I am debugging with my device. Here is the DebugView of my device:
Where the user_id is properly set via setUserID on the Firebase Analytics object.
I then triggered a crash. But...
It can't find my userID? (I can find the crash I triggered though.)
I don't even know what else to try, according to DebugView the userID was properly set?
Well, it was as simple as:
FirebaseAnalytics.getInstance(this).setUserId(uuid); // wrong
Crashlytics.setUserIdentifier(uuid); // correct
Was overlooking "FirebaseCrashlytics" vs "FirebaseAnalytics" https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=android
After getting first crash on installed application, you can search with the user id in Firebase Crashlytics
FirebaseCrashlytics.getInstance().setUserId(uuid);
Add FirebaseCrashlytics.getInstance().setUserId(uuid); in all screens (activities). If you add only in login screen then userid will not share to crashlytics, when app is crashed after reopening. Since we will ask user to login only once.
In Sep 2021 using -
com.google.firebase:firebase-bom - version 28.4.0
com.google.firebase:firebase-analytics-ktx - version 19.0.1
com.google.firebase:firebase-crashlytics-ktx - version 18.2.1
I resolved this with : FirebaseCrashlytics.getInstance().setUserId();
Related
This is a Xamarin.Forms app running on Android, based on the Azure getting started Mobile App example.
I'm trying to register a device's id for notification services. Originally I was getting unauthorized, so I relaxed authorization settings on the backend. Now I am getting this error and cannot find a reason why.
I checked and double checked that notification hub has the correct Firebase details that align with the app and cannot see what the problem is here, any help appreciated.
John,
If you set WEBSITE_PUSH_ENABLED=false in your appsettings, does the problem go away?
Can you check your Mobile App's app settings?
Specifically, I am looking for the existence of the app setting "MS_NotificationHubName". If that app setting doesn't exist, you need to add it, with the name of your notification hub.
There is a bug in the Azure App Service Push blade right now. A fix is being rolled out. In the interim, instead of using RegisterAsync(), use the method described in the book http://aka.ms/zumobook - chapter 5.
I am using Crashlytics in my application and I wanted to get user id and email along with each crash. I did something like this:
Crashlytics.setUserEmail(tokenModel.getEmail());
Crashlytics.setUserIdentifier(String.valueOf(tokenModel.getPk()));
I am doing this in my login screen, after the user has provided his email and successfully registered with the app, so as to get user id. The problem is, I am not getting these data in the crash reports.
What is the lifecycle and working of Crashlytics in above context? Do I need to set these fields every time the app opens?
I am not sure if it needs to be done every time you launch the app and the Crashlytics docs don't explicitly say it neither.
I know that we do it with every launch and it works - provided user info is displayed properly in the dashboard.
My suggestion would be to try send this information every time you initalize Crashlytics with Fabric.with(this, new Crashlytics());, as soon as you have your user data provided (for example after fetching his user profile from your server).
You need to select the issue, click in more details and at the top right corner you can see a label with Identifier.
You need to set it every time you initialise the Crashlytics. At least doing this it works.
if you are using this Crashlytics.setUserIdentifier(""); you can check in data tab in firebase. Fabric.with(this, new Crashlytics()); working fine.
If you look into codes of FirebaseCrashlytics than you can see that userId is being saved into the session. So I am sure that after restarting application your id will be restored.
I'm following documentation as states:
https://developers.facebook.com/docs/ads-for-apps/mobile-app-ads/#advanced
Specifically: Measure App Installs
However, I did the following code:
com.facebook.AppEventsLogger.activateApp( this, APPLICATION_ID_FACEBOOK );
However, in dashboard, it doesn't detect the install:
Any tips?
LogCat outputs the following:
FacebookException: No attribution id returned from the Facebook application
Ok. Solved.
Basically for whoever faces this:
FACEBOOK APP must be installed in device.
USER must be logged in.
Thats it.
=)
Another great but hidden hint is to enable verbose logging via
FacebookSdk.addLoggingBehavior(APP_EVENTS)
The output is actually very helpful and even contains error analysis and descriptions.
Unable to receive crash reports on my Test flight account even though application gets crashed.
I integrated the SDK in my application. I did following steps -
1. Integrated SDK in code
2. Used proper Application ID
3. Started session using TestFlight.startSession();
4. Called TestFlight.sendCrash(121213, "XXX", "YYY"); method
4. Ended session using TestFlight.endSession(); in one of my destroy() method.
Let me know if I am doing anything wrong or missing anything.
Thanks in advance, your answers will be much appropriated.
Crash sessions should be sent back to TestFlight automatically. There is no need to specify startSession, sendCrash, and endSession. Please contact TestFlight support here (http://help.testflightapp.com/customer/portal/emails/new) so we can further investigate. Please include the URL to the build's permissions page in the email.
Thanks,
Justin (TestFlight Support)
First of all I'm sure that my fb app id is valid because users can log in my Android app using facebook credentials until some days ago (I think it's before Feb break change).
Recently new users cannot log in my Android app using facebook any more because facebook keep saying that my fb app invalid (Error is: Invalid application fb-app-id) BUT old users who already authorized my Android app for accessing their info can still log in using facebook. (Old users can still login to my app using facebook credentials but new users cannot)
Does anyone know why this happen to my facebook app and how to fix it?
Edit: When access to https://graph.facebook.com/facebook-app-id I get this error
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
Thanks you.
If you're sure the app is not in sandbox mode (which was gema.megantara's answer), and hasn't been deleted for policy reasons by Facebook the only explanation I can think of is that you've restricted the app demographically (i.e by country or age)
If that's the case the API won't return the app's details unless you make the API call using a user access token for a user who meets whatever restrictions you've applied, and users who don't meet the requirements won't be able to use the app.
If that's what you've done, you can remove the restrictions via the API (via the restrictions field of the Application object or in the ''Advanced'' tab in the app settings in the App Dashboard
If using the frontend interface to change the settings, it's the ''App Restrictions'' field you want to edit, screenshot attached
Basically the same solution as the accepted answer, just updated for the latest FB developer site has been updated so you need do this:
Apps->Your App
Status+Review
Do you want to make this app and all its live features available to the general public? -> Yes
Usually if you get error like that when visit https://graph.facebook.com/523132271032907 is because the sandbox mode is on. Have you try to reset the secret key ?
I think, this is because FB does not check whether application id is valid when the user has already logged in. It likely assumes that if the check passed, the id is valid. Apparently, locking out the users after making the app id invalid has never been a design goal.
try replacing:
<string name="facebook_app_id">CHANGE-ME</string>
with:
<string name="facebook_application_id">CHANGE-ME</string>