Android

TIMPushManager

public abstract class TIMPushManager: Push Plugin Interface Class.

API overview

Register/Unregister Push Service Interface

After initializing and successfully logging in to IM, you can register for push services.
API
Description
To register for push services, read the configuration file timpush-configs.json from the project.
Unregister to close offline push services, call before logging out of the IM account.
To disable the plugin from automatically registering for push services after logging in, call before registering for push services.

FCM Custom Ringtone Configuration Interface

Once configured, the custom ringtone is effective. The sender must include the channelId in the offline message sent.
API
Description
To configure FCM's custom ringtone, it needs to be called before registering for push services.
The custom replacement plugin by default reads the push service registration configuration file timpush-configs.json, which needs to be called before registering for push services

Interface Details

Static Public Member Functions

static TIMPushManager getInstance(): Retrieves the TIMPushManager manager instance.

Member Function Description

abstract void registerPush(Context context, TIMPushCallback callback)

Register offline push service, call upon successful login to the IM account. (To facilitate the easiest possible integration into the push service, the plugin will automatically read the configuration file timpush-configs.json in the project to obtain the information needed to register for the push service)
Note:
You need to use the login API provided by TUILogin of the TUICore component to log in; the plugin will automatically detect this and register the push service.
If you do not wish to use the API provided by TUILogin, you need to manually call this interface to register the service after completing the login operation.

abstract void unRegisterPush(TIMPushCallback callback)

Unregister to close offline push services, call before logging out of the IM account.
Note:
If you do not wish to use the push service, you can manually call this interface to unregister the service.
If you log out using the logout API provided by TUILogin of the TUICore component, the plugin will automatically detect this and unregister the push service.

abstract void disableAutoRegisterPush()

To disable the plugin from automatically registering for the push service, it's necessary to call this before logging in.
Note:
If you log in using the login API provided by TUILogin in the TUICore component, the plugin will by default automatically register for the push service. Calling this interface can disable the automatic registration.

abstract void setCustomFCMRing(String channelId, String ringName, boolean enable)

To configure FCM's custom ringtone, it needs to be called before registering for push services.
Note:
Once configured, the custom ringtone is effective. The sender must include the channelId in the offline message sent.
Parameter description:
API
Description
channelId
FCM channel uniquely defines the channel ID of the notification bar within the app.
ringName
FCM channel defines the name of the push ringtone for the notification bar, located in the raw directory and does not require a file suffix.
enable
Set whether the offline push prompt ringtone uses a custom ringtone.

abstract void setCustomConfigFile(String configs)

The custom replacement plugin by default reads the push service registration configuration file timpush-configs.json, which needs to be called before registering for push services.
Note:
Mainly used for dynamically switching different configuration files for push registration in multiple environments, for example: push feature integration and testing under different configuration files in production and test environments;
For methods to switch during the static compilation period, please refer to: buildConfigField("String", "custom_timpush_configs", "\"Custom Definition File Name\"")
Parameter description:
Parameter
Description
configs
The name of the custom Definition configuration file should remain unchanged: "Engineering Root Directory/app/src/assets/"