Setting the Customer User ID
Optional
The Customer User ID (CUID) is a unique user identifier created by the app owner outside the SDK. The CUID lets app owners follow user journeys across different devices.
Set the Customer User ID
Once the CUID is available, set it by calling setCustomerUserId:
AppsFlyerLib.getInstance().setCustomerUserId(<MY_CUID>);The CUID can only be associated with in-app events after it has been set. If start was called before setCustomerUserId, the install event will not be associated with the CUID. To associate the install event with the CUID, see below.
NoteIn SDK V7, setter values are not persisted between sessions. Re-apply
setCustomerUserIdon every cold start.
Associate the CUID with the install event
If you need the CUID to be associated with the install event, set it before calling start().
In SDK V7, this is straightforward: since you control when start() is called, set the CUID inside your session ready listener callback, before calling start():
AppsFlyerLib.getInstance().init(<YOUR_DEV_KEY>, null, this);
AppsFlyerLib.getInstance().registerSessionReadyListener(() -> {
AppsFlyerLib.getInstance().setCustomerUserId(<MY_CUID>);
AppsFlyerLib.getInstance().start();
});AppsFlyerLib.getInstance().init(<YOUR_DEV_KEY>, null, this)
AppsFlyerLib.getInstance().registerSessionReadyListener {
AppsFlyerLib.getInstance().setCustomerUserId(<MY_CUID>)
AppsFlyerLib.getInstance().start()
}
NoteThe
waitForCustomerUserIdandsetCustomerIdAndLogSessionAPIs have been removed in SDK V7. The new session model makes them unnecessary: since you control whenstart()is called, there is no need for a waiting mechanism.
Updated 1 day ago