IMSDK
IM features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication. It also provides complete app access and backend management APIs.
V2TIMOfflinePushInfo

Public Member Functions

 V2TIMOfflinePushInfo ()
 
String getTitle ()
 
void setTitle (String title)
 
String getDesc ()
 
void setDesc (String description)
 
void setExt (byte[] ext)
 
byte [] getExt ()
 
void disablePush (boolean disable)
 
boolean isDisablePush ()
 
void setIOSSound (String sound)
 
void setAndroidSound (String sound)
 
void setIgnoreIOSBadge (boolean ignoreIOSBadge)
 
void setAndroidOPPOChannelID (String channelID)
 
void setAndroidFCMChannelID (String channelID)
 
void setAndroidXiaoMiChannelID (String channelID)
 
void setAndroidVIVOClassification (int classification)
 
void setAndroidVIVOCategory (String category)
 
void setIOSPushType (int iosPushType)
 
void setAndroidHuaWeiCategory (String category)
 

Static Public Attributes

static final String IOS_OFFLINE_PUSH_NO_SOUND = "push.no_sound"
 
static final String IOS_OFFLINE_PUSH_DEFAULT_SOUND = "default"
 
static final int IOS_OFFLINE_PUSH_TYPE_APNS = 0
 
static final int IOS_OFFLINE_PUSH_TYPE_VOIP = 1
 

Constructor & Destructor Documentation

◆ V2TIMOfflinePushInfo()

Member Function Documentation

◆ getTitle()

String getTitle ( )
inline

Get the offline push notification title

Returns
Notification title

◆ setTitle()

void setTitle ( String  title)
inline

Set the offline push display title

Parameters
titleNotification bar title

◆ getDesc()

String getDesc ( )
inline

Get the offline push notification content

Returns
Notification content

◆ setDesc()

void setDesc ( String  description)
inline

Set the offline push display content

Attention
This field must be set for custom message offline push.
Parameters
descriptionNotification bar content

◆ setExt()

void setExt ( byte []  ext)
inline

Set the extended field passed through by offline push

Parameters
extNotification bar passthrough message

◆ getExt()

byte [] getExt ( )
inline

Get the extended field passed through by offline push

◆ disablePush()

void disablePush ( boolean  disable)
inline

Whether to disable push (push enabled by default)

Parameters
disabletrue: disable; false: enable

◆ isDisablePush()

boolean isDisablePush ( )
inline

Get the offline push disablement status

Returns
Disabled. true: disabled; false: enabled

◆ setIOSSound()

void setIOSSound ( String  sound)
inline

Offline push sound setting (valid only for iOS) When sound is IOS_OFFLINE_PUSH_NO_SOUND, no sound is played when a message is received. When sound is IOS_OFFLINE_PUSH_DEFAULT_SOUND, the system alert sound is played when a message is received. To customize iOSSound, link the audio file to the Xcode project and set iOSSound to the audio filename (with the extension name).

Parameters
soundiOS Sound path

◆ setAndroidSound()

void setAndroidSound ( String  sound)
inline

Offline push sound setting (valid only for Android, supported only in imsdk 6.1 and later versions)

Only Huawei and Google phones support setting ringtone. And Xiaomi needs refer to https://dev.mi.com/console/doc/detail?pId=1278%23_3_0 . In addition, Google phones using FCM to set the sound prompt on Android 8.0 and above systems, which needs to be configured in notification channel, please refer to the interface setAndroidFCMChannelID

Parameters
soundThe ringtone file name in the raw directory of the Android project, no suffix is required.

◆ setIgnoreIOSBadge()

void setIgnoreIOSBadge ( boolean  ignoreIOSBadge)
inline

Whether to ignore the badge count for offline push (valid only for iOS) If this parameter is set to true, the unread message count on the app badge will not increase when the message is received by the iOS device.

Parameters
ignoreIOSBadgeiOS Status of the unread message count on the app badge. true: ignore; false: enable

◆ setAndroidOPPOChannelID()

void setAndroidOPPOChannelID ( String  channelID)
inline

Offline push channel ID for OPPO phones that run Android 8.0 or later

Parameters
channelIDOPPO phone channel ID

◆ setAndroidFCMChannelID()

void setAndroidFCMChannelID ( String  channelID)
inline

Offline push channel ID for Google FCM phones that run Android 8.0 or later

Parameters
channelIDFCM Channel ID

◆ setAndroidXiaoMiChannelID()

void setAndroidXiaoMiChannelID ( String  channelID)
inline

Offline push channel ID for XiaoMi phones that run Android 8.0 or later

Parameters
channelIDXiaoMi Channel ID

◆ setAndroidVIVOClassification()

void setAndroidVIVOClassification ( int  classification)
inline

Offline push setting for VIVO push classification. (It is deprecated and discouraged to call this function. The VIVO push service has optimize the message classification rules on April 3, 2023. Please call API setAndroidVIVOCategory instead.)

Parameters
classificationOffline push message classification for vivo phones. 0: operation message; 1: system message. The default value is 1.

◆ setAndroidVIVOCategory()

void setAndroidVIVOCategory ( String  category)
inline

Offline push setting for VIVO push category,See details:https://dev.vivo.com.cn/documentCenter/doc/359. (The VIVO push service has optimize the message classification rules on April 3, 2023. Please call API setAndroidVIVOCategory instead.)

Parameters
categoryvivo message category

◆ setIOSPushType()

void setIOSPushType ( int  iosPushType)
inline

The type of offline push on iOS (valid only for iOS)

Parameters
iosPushTypeIOS_OFFLINE_PUSH_TYPE_APNS: APNs; IOS_OFFLINE_PUSH_TYPE_VOIP: VoIP. The default value is IOS_OFFLINE_PUSH_TYPE_APNS

◆ setAndroidHuaWeiCategory()

void setAndroidHuaWeiCategory ( String  category)
inline

Offline push setting for HuaWei push category,See details:https://developer.huawei.com/consumer/cn/doc/development/HMSCore-Guides/message-classification-0000001149358835

Parameters
categoryHuaWei push category

Field Documentation

◆ IOS_OFFLINE_PUSH_NO_SOUND

final String IOS_OFFLINE_PUSH_NO_SOUND = "push.no_sound"
static

◆ IOS_OFFLINE_PUSH_DEFAULT_SOUND

final String IOS_OFFLINE_PUSH_DEFAULT_SOUND = "default"
static

◆ IOS_OFFLINE_PUSH_TYPE_APNS

final int IOS_OFFLINE_PUSH_TYPE_APNS = 0
static

◆ IOS_OFFLINE_PUSH_TYPE_VOIP

final int IOS_OFFLINE_PUSH_TYPE_VOIP = 1
static