FirebaseCrashlytics setUserId - Should we need set it on every app launch
Asked Answered
C

1

7

For FirebaseCrashlytics i am setting the user id once user logged in then store its credentials in sharedpreference.

FirebaseCrashlytics.getInstance().setUserId("12345");

On next App launch User will be automatically logged in. So Should I set user id on every app launch or its the one time function call. What should I do in case on user logged out and switch to another account on same device

Colorado answered 17/5, 2020 at 0:36 Comment(1)
Did you get to know the proper way yet?Afoot
W
-1

You will have to implement a method to associate User ID's with devices/users. You can do something like this UUID uuid = UUID.randomUUID();, to associate randomized UUID's to the setUserId method. You can read more about this here https://www.baeldung.com/java-uuid.

Depending on your method, you can log certain identifiable information based on how your user logs into your app. Such as via email or something, but that's discouraged for privacy reasons.

Wrightson answered 21/5, 2020 at 20:45 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.