Skip to main content

SDK Reference - login

React native
Flutter
Swift
Kotlin

The login method authenticate the user with IAPHUB.

By authenticating your users with IAPHUB, you gain the ability to search for users on the IAPHUB dashboard using your own user ID, and through the IAPHUB API. Authenticated users can access their subscriptions from any device when logged into the same account.

If authentication with IAPHUB is not implemented, an anonymous user ID is generated on the device to identify the user. While users can still access their subscriptions on different devices, they will need to use the restore method. A subscription can be shared on up to five devices maximum after a successful restore using the same Apple/Google account.

When an anonymous user ID owns an active subscription or non-consumable product and the user is authenticated, the user accounts are merged.
This means that the active products purchased by the anonymous user ID will also become available for the authenticated user.

It's important to note that calling the login or logout method will reset the current user. Subsequently, you won't receive any onUserUpdate events until after calling getActiveProducts, getProductsForSale or getProducts.

Example

await Iaphub.login("1e5494930c48ed07aa275fd2");
React Native
Flutter
Swift
Kotlin

Parameters

StringUser id. Should be non-guessable, non-public. Email not allowed.

Response

This method does not return any response.