Disable Push Token Upon Channel Registration

This document is intended to provide a way to disable sending the FCM token, ADM ID or device token during channel registration. Disabling this will cause analytics and push notifications to not work correctly.

Android

By default, we send the FCM token or ADM ID during channel registration.

Disable sending the FCM token or ADM ID

To disable sending the FCM token or ADM ID during channel registration, you need to disable analytics and disable sending the token during takeOff.

Disable analytics:

UAirship.shared().getAnalytics().setEnabled(false);

Note: When disabling analytics, any locally stored events will be deleted. Features that depend on analytics being enabled may not work properly if it’s disabled (reports, region triggers, location segmentation, push to local time).

Disable sending the FCM token or ADM ID during channel registration:

UAirship.shared().getPushManager().setPushTokenRegistrationEnabled(false);

Note: If you set this flag to false, the app will not be able to receive push notifications. The app may receive rich push messages, if it has an inbox.

Enable sending the FCM token or ADM ID

To enable sending the FCM token or ADM ID during channel registration, you need to enable analytics and enable sending the token during takeOff.

Enable analytics:

UAirship.shared().getAnalytics().setEnabled(true);

Enable sending the FCM token or ADM ID during channel registration:

UAirship.shared().getPushManager().setPushTokenRegistrationEnabled(true);

Retrieving the channel ID and platform

String channelID = UAirship.shared().getPushManager().getChannelId();

if (UAirship.shared().getPlatformType() == UAirship.AMAZON_PLATFORM) {
    // Amazon platform
} else if (UAirship.shared().getPlatformType() == UAirship.ANDROID_PLATFORM) {
    // Android platform
}

iOS

By default we send the device token during channel registration.

Disable sending the device token

To disable sending the device token during channel registration, you need to disable analytics and disable sending the token during takeOff.

Disable analytics:

[UAirship shared].analytics.enabled = NO;

Note: Disabling analytics will delete any locally stored events and prevent any events from uploading. Features that depend on analytics being enabled may not work properly if it’s disabled (reports, region triggers, location segmentation, push to local time).

Disable sending the device token during channel registration:

// Disable sending device token and update registration
[UAirship push].pushTokenRegistrationEnabled = NO;
[[UAirship push] updateRegistration];

Note: If you set this flag to false, the app will not be able to receive push notifications. The app may receive rich push messages, if it has an inbox.

Enable sending the device token

To enable sending the device token during channel registration, you need to enable analytics and enable sending the token during takeOff.

Enable analytics:

[UAirship shared].analytics.enabled = YES;

Enable sending the device token during channel registration:

// Enable sending device token and update registration
[UAirship push].pushTokenRegistrationEnabled = YES;
[[UAirship push] updateRegistration];

Retrieving the channel ID

NSString *channelID = [UAirship push].channelID;