getPushToken

fun getPushToken(context: Context): String?

Deprecated

FCM has deprecated the registration token. This API stops working when FCM removes the legacy token support, or it will be removed in MoEngage-Android-SDK version 16.00.00. Use getInstallationId() instead.

Replace with

getInstallationId(context)

Get saved Push Token(if any) for the account configured as default.

Return

Saved Push token, else null

Since

12.0.00

Parameters

context

Instance of Context

Throws

if the SDK is not initialized.


fun getPushToken(context: Context, appId: String): String?

Deprecated

FCM has deprecated the registration token. This API stops working when FCM removes the legacy token support, or it will be removed in MoEngage-Android-SDK version 16.00.00. Use getInstallationId() instead.

Replace with

getInstallationId(context, workspaceId)

Get saved Push Token(if any) for the given account.

Return

Saved Push token, else null

Since

12.0.00

Parameters

context

Instance of Context

appId

Account identifier, APP ID on the MoEngage Dashboard.

Throws

if the SDK is not initialized.