如何处理userLoggedIn在Android端


#1

在iOS中提供了userLoggedIn的方法,但是Android中没有这个方法呀?怎么搞得?如何处理用户登录和撤销,在Android端


#2

你好,Login 和 Logout的处理逻辑是更换device id, 可以尝试手动处理这部分逻辑:

Changing a device ID

In case your application authenticates users, you can also change device ID to your user ID later. This helps you identify a specific user with a specific ID on a device she logs in, and the same scenario can also be used in cases this user logs in using a different way (e.g tablet, another mobile phone or web). In this case any data stored in Countly server database and associated with temporary device ID will be transferred into user profile with device id you specified in the following method call:

Java
Countly.sharedInstance().changeDeviceId("new device ID")
Whenever your authenticated user logs out, in case you want to track history and further activity under another Countly user, call:

Java
Countly.sharedInstance().changeDeviceId(DeviceId.Type.OPEN_UDID, null)