Class PushManager
-
- All Implemented Interfaces:
public class PushManager
The primary management class for push notification initialization configuration
-
-
Field Summary
Fields Modifier and Type Field Description public PushConfig
pushConfig
public long
configId
public PushType
serverPushType
-
Method Summary
Modifier and Type Method Description PushConfig
getPushConfig()
long
getConfigId()
PushType
getServerPushType()
static PushManager
getInstance()
void
init(Context context, PushConfig pushConfig)
void
onReceiveToken(Context context, PushType pushType, String token)
Receives the token information returned by the third-party push notification platform. void
onReceiveToken(Context context, PushType pushType, String token, String area)
Receives the token information returned by the third-party push notification platform. void
onReceiveToken(Context context, PushType pushType, String token, String area, boolean internal)
void
onSuccessResponse(Context context, PushType pushType, List<TokenBean> tokenList, Map<String, String> failMap)
Configuration successful handling void
onNetworkChangeEvent(Context context)
Network change reconfiguration event void
registerRong(Context context, PushType pushType)
Registers the corresponding platform's registration interface based on the push type. void
onErrorResponse(Context context, PushType pushType, String action, long resultCode)
Handling of failed token request to third-party platform event void
onNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage pushNotificationMessage)
Callback triggered when a push notification is received. void
onNotificationMessageClicked(Context context, Intent pushIntent, PushType pushType, PushNotificationMessage pushNotificationMessage)
Callback triggered when a push notification is clicked Push click events from RongCloud's built-in channel will not trigger here due to cross-process communication. void
onPushRawData(Context context, PushType pushType, String data)
Receives transparently transmitted message data void
updatePushServerInfoFromToken(String token)
-
-
Method Detail
-
getPushConfig
PushConfig getPushConfig()
-
getConfigId
long getConfigId()
-
getServerPushType
PushType getServerPushType()
-
getInstance
static PushManager getInstance()
-
init
void init(Context context, PushConfig pushConfig)
-
onReceiveToken
void onReceiveToken(Context context, PushType pushType, String token)
Receives the token information returned by the third-party push notification platform.
- Parameters:
context
- The context.pushType
- The push notification type.token
- The token information returned by the third-party push notification platform.
-
onReceiveToken
void onReceiveToken(Context context, PushType pushType, String token, String area)
Receives the token information returned by the third-party push notification platform.
- Parameters:
context
- The context.pushType
- The push notification type.token
- The token information returned by the third-party push notification platform.
-
onReceiveToken
void onReceiveToken(Context context, PushType pushType, String token, String area, boolean internal)
-
onSuccessResponse
void onSuccessResponse(Context context, PushType pushType, List<TokenBean> tokenList, Map<String, String> failMap)
Configuration successful handling
-
onNetworkChangeEvent
void onNetworkChangeEvent(Context context)
Network change reconfiguration event
- Parameters:
context
- The context
-
registerRong
void registerRong(Context context, PushType pushType)
Registers the corresponding platform's registration interface based on the push type.
- Parameters:
pushType
- The push type
-
onErrorResponse
void onErrorResponse(Context context, PushType pushType, String action, long resultCode)
Handling of failed token request to third-party platform event
- Parameters:
context
- The contextpushType
- The push notification typeaction
- The action corresponding to this errorresultCode
- The error code returned by the third-party platform
-
onNotificationMessageArrived
void onNotificationMessageArrived(Context context, PushType pushType, PushNotificationMessage pushNotificationMessage)
Callback triggered when a push notification is received. When using third-party notification methods, this event is called after the notification is displayed by the mobile system layer.
When this method is called, the notification has already been displayed, so it is not possible to customize the notification appearance.
- Parameters:
context
- The contextpushType
- The type of push notificationpushNotificationMessage
- The notification message
-
onNotificationMessageClicked
void onNotificationMessageClicked(Context context, Intent pushIntent, PushType pushType, PushNotificationMessage pushNotificationMessage)
Callback triggered when a push notification is clicked
Push click events from RongCloud's built-in channel will not trigger here due to cross-process communication. They are directly handled by the broadcast receiver .
- Parameters:
context
- ContextpushType
- Push typepushNotificationMessage
- Notification message
-
onPushRawData
void onPushRawData(Context context, PushType pushType, String data)
Receives transparently transmitted message data
-
updatePushServerInfoFromToken
void updatePushServerInfoFromToken(String token)
-
-
-
-