reset()
Clear all stored data and generate a new install ID. Use for account deletion or testing.
Method Signature#
Mobana.reset(): Promise<void>Usage#
// Clear all stored data
await Mobana.reset();What Gets Cleared#
- Install ID: A new unique install ID is generated. The device will appear as a new install.
- Attribution cache: Cached attribution data is cleared. Next call to getAttribution() will fetch fresh data.
- Conversion queue: Any queued (unsent) conversions are discarded.
- Flow cache: Cached flow content is cleared.
- Local data: Data stored via setLocalData() in flows is cleared.
Account Deletion#
When a user deletes their account, call reset() to clear attribution data:
settings.tsx
// When user deletes their account
async function handleAccountDeletion() {
// Delete user data from your backend
await api.deleteAccount();
// Clear Mobana data
await Mobana.reset();
// Clear other local data
await AsyncStorage.clear();
// Navigate to sign-in
navigation.reset({ index: 0, routes: [{ name: 'SignIn' }] });
}GDPR Compliance
If a user requests their data be deleted under GDPR, calling reset() clears all locally stored attribution data. Server-side data is retained for analytics but is not personally identifiable (only install IDs and UTM parameters).
Testing#
Useful during development to simulate a fresh install:
// Useful for testing - simulate a fresh install
async function simulateFreshInstall() {
await Mobana.reset();
// Re-initialize
await Mobana.init({ appId: 'a1b2c3d4' });
// Attribution will be fetched fresh
const attribution = await Mobana.getAttribution();
}Warnings#
This action is irreversible. The previous install ID is lost, and the device will be treated as a new install. Conversion history is also lost.