Application User ID
User ID Usage
User ID is a unique Identifier that will differentiate between your different users. IronSource systems use it to know which user to reward upon successful ad completion through server-to-server callbacks.
Most of the calls to ironSource systems must include the User ID in order to sync the user data of your app with ironSource database.
Create a User ID
There are a couple of ways to generate a User ID, while it must be a unique string for each one of your users.
- Method 1: assign an incremental number to each of your signed up users.
- Method 2: use IDFV (Identifier for Vendor) for iOS or AID (Advertising ID) for Android.
iOS
SDK 6.4 and below:
NSString *idfv = [[[UIDevice currentDevice] identifierForVendor]UUIDString];
SDK 6.5 and above:
NSString *idfv = [IronSource advertiserId];
Android
Note: This method cannot be called in the main thread as it may block leading to ANRs; we recommend running this on a different thread in the background. For more information, read more on Google APIs References.
SDK 6.4 and below:
final String id = AdvertisingIdClient.getAdvertisingIdInfo(this).getId();
SDK 6.5 and above:
final String id = IronSource.getAdvertiserId(Activity);
Unity
For Unity you can use the following Unity’s guidelines.