onNotificationClicked property
Implementation
Function({required String ext, String? userID, String? groupID})? get onNotificationClicked =>
_onNotificationClicked;
set
onNotificationClicked
(dynamic callback({required String ext, String? groupID, String? userID})?)
Implementation
set onNotificationClicked(
Function({required String ext, String? userID, String? groupID})? callback) {
_onNotificationClicked = callback;
// 语义:`_pendingOnClickExt == null` 表示没有 pending;空串 `''` 也是合法的 pending
// (腾讯云控制台推送不填 ext 时 native 派发的就是空串),必须 replay,否则业务回调
// 会永久丢事件。
final pending = _pendingOnClickExt;
if (callback != null && pending != null) {
_pendingOnClickExt = null;
try {
final ParseExtInfoResult conversationInfo =
TencentCloudChatPushUtils.parseExtInfo(pending);
callback(
ext: pending,
userID: conversationInfo.userID,
groupID: conversationInfo.groupID,
);
} catch (err, errorStack) {
debugPrint("$err $errorStack");
}
}
}