If there is a login system within your app, the "login" method should be called to set account ID for users who actually log in. Once set successfully, events triggered after this will be attached the account ID. When users log out, the "logout" method should be called to clear the account ID and events triggered later will not have the account ID anymore.
Note:
Once the account ID is set, it will be retained until the "logout" method is called to clear the account ID.
Function
public void login(String accountID);
Parameter | Description | Type | Required |
---|---|---|---|
accountID | Account ID to be set | String | Yes |
Sample Code
import com.reyun.solar.engine.SolarEngineManager;
SolarEngineManager.getInstance().login("xxxAccountIDxxx");
Note:
1.This call only passes account IDs to the SDK and does not report user login events.
2.The length of the account ID cannot exceed 128 characters, otherwise it will fail to be set.
Function
public String getAccountID();
Return the set account ID. (Default "")
Sample Code
import com.reyun.solar.engine.SolarEngineManager;
String getAccountID = SolarEngineManager.getInstance().getAccountID("xxxAccountIDxxx");
Call logout to clear the account ID.
Function
public void logout();
Sample Code
import com.reyun.solar.engine.SolarEngineManager;
SolarEngineManager.getInstance().logout();
Note:
This call only notifies the SDK to clear the account ID and will not report the user logout event.