Incoming call/message reminder
Device call reminder, message reminder
method
setV2CallEvt(contactText:phoneNumber:completion:)
v2 sends incoming call reminder as well as the incoming call phone number and incoming call contact (implemented by some devices)
- Parameters:
- contactText: contact name
- phoneNumber: number
- Returns: Success or not
setV2NoticeEvt(type:contactText:phoneNumber:dataText:completion:)
v2 sends information reminders and information content (implemented by some devices)
[!WARNING] The method using
IDONoticeMessageTypeenum parameter in Kotlin has been marked as deprecated. For flexibility and backward compatibility, it is recommended to directly use the overloaded method withInttype for thetypeparameter.
- Parameters:
- type: information type (In Kotlin, it is recommended to directly pass an
Intvalue, e.g.,0x01. Refer to Message Event type for details) - contactText: notification content
- phoneNumber: number
- dataText: message content
- type: information type (In Kotlin, it is recommended to directly pass an
- Returns: Success or not
stopV2CallEvt(completion:)
v2 sends an incoming call reminder status as the call has been answered, telling the device to stop reminding the user (implemented by some devices)
- Returns: Success or not
missedV2MissedCallEvt(completion:)
v2 sends an incoming call reminder status as call rejected, telling the device to stop reminding the user (implemented by some devices)
- Returns: Success or not
hangUpV2InCallEvt(completion:)
v2 sends an incoming call reminder status as hang up during call, telling the device to stop reminding the user (implemented by some devices). Requires function table setNoticeHangUpInCallV2 to be true.
- Returns: Success or not
Example
Swift:
//Send incoming call reminder along with incoming phone number and incoming call contact
sdk.cmd.setV2CallEvt(contactText: "xx", phoneNumber: "33333") { rs in
if (rs) {
// success
} else {
// fail
}
}
// Notify the phone to hang up
sdk.cmd.stopV2CallEvt { rs in
}
Kotlin:
//Send incoming call reminder along with incoming phone number and incoming call contact
sdk.cmd.setV2CallEvt("xxx", "3333") {
if (it) {
// success
}else {
// fail
}
}
// Send message reminder (Recommended for Kotlin, using overloaded Int parameter)
sdk.cmd.setV2NoticeEvt(0x01, "ContactName", "13800000000", "Message content") { success ->
if (success) {
// success
} else {
// fail
}
}
// Notify the phone to hang up
sdk.cmd.stopV2CallEvt {
}
// Hang up during call (requires setNoticeHangUpInCallV2)
if (sdk.funcTable.setNoticeHangUpInCallV2) {
sdk.cmd.hangUpV2InCallEvt {
// success or fail
}
}