◆ getFCMPushToken()
String com.hyphenate.push.EMPushHelper.getFCMPushToken |
( |
| ) |
|
Gets the FCM's push token.
- Returns
- The FCM's push token.
◆ getInstance()
static EMPushHelper com.hyphenate.push.EMPushHelper.getInstance |
( |
| ) |
|
|
static |
◆ getPushToken()
String com.hyphenate.push.EMPushHelper.getPushToken |
( |
| ) |
|
Gets the push token.
- Returns
- The push token.
◆ getPushTokenWithType()
String com.hyphenate.push.EMPushHelper.getPushTokenWithType |
( |
EMPushType |
type | ) |
|
Gets the push token with the push type.
- Parameters
-
- Returns
- The push token.
◆ getPushType()
EMPushType com.hyphenate.push.EMPushHelper.getPushType |
( |
| ) |
|
Gets the push type.
- Returns
- The push type.
◆ init()
void com.hyphenate.push.EMPushHelper.init |
( |
Context |
context, |
|
|
EMPushConfig |
config |
|
) |
| |
Initializes the EMPushHelper.
- Parameters
-
context | The context of Android Activity or Application. |
config | The Push configurations. |
◆ onErrorResponse()
void com.hyphenate.push.EMPushHelper.onErrorResponse |
( |
EMPushType |
type, |
|
|
long |
resultCode |
|
) |
| |
Occurs when a push error occurs. The SDK triggers this callback when a push error, such as push token binding failure (PUSH_BIND_FAILED), push token unbinding failure (PUSH_UNBIND_FAILED), or unsupported custom types (PUSH_NOT_SUPPORT), occurs. You can have more detailed information on the error from the returned resultCode. If the customized PushListener is not null, pass error info to PushListener#onError(EMPushType, long).
- Parameters
-
type | The push type. |
resultCode | The error code. |
◆ onReceiveToken()
void com.hyphenate.push.EMPushHelper.onReceiveToken |
( |
EMPushType |
type, |
|
|
final String |
token |
|
) |
| |
Receives and uploads the device token。
- Parameters
-
type | The push type. |
token | The device token. |
◆ register()
void com.hyphenate.push.EMPushHelper.register |
( |
| ) |
|
Registers the push service. After successful login, the SDK calls the method instead of you.
◆ setFCMPushToken()
void com.hyphenate.push.EMPushHelper.setFCMPushToken |
( |
String |
token | ) |
|
Saves the FCM's push token.
- Returns
- The FCM's push token.
◆ setPushListener()
void com.hyphenate.push.EMPushHelper.setPushListener |
( |
PushListener |
callback | ) |
|
Sets the push listener. You can override PushListener#isSupportPush(EMPushType, EMPushConfig) to set the push types. Supported push types are EMPushType.FCM,EMPushType.MIPUSH,EMPushType.HMSPUSH,EMPushType.MEIZUPUSH,EMPushType.OPPOPUSH,EMPushType.VIVOPUSH. If you set a push type beyond this scope, the SDK will choose the Normal push of the chat service without error information without reporting error information.
- Parameters
-
callback | The push listener. |
◆ setPushTokenWithType()
void com.hyphenate.push.EMPushHelper.setPushTokenWithType |
( |
EMPushType |
type, |
|
|
final String |
token |
|
) |
| |
Sets the push token with the push type.
- Parameters
-
type | The push type. |
token | The push token. |
◆ unregister()
boolean com.hyphenate.push.EMPushHelper.unregister |
( |
boolean |
unbindToken | ) |
|
Unregisters the push service. This method is called by SDK during the call of EMClient#logout(boolean)}.
- Parameters
-
unbindToken | Whether to unbind the device. |
- Returns
- Whether the unregistering push succeeds.
The documentation for this class was generated from the following file:
- com/hyphenate/push/EMPushHelper.java