如何在我目前使用Onesignal发送通知的通知中传递其他数据。我不确定我是否使用密钥additionalData
发送附加数据。我收到通知但我没有收到额外的数据
//my custom completion handler to retrieve user token
self.getUserInfoCustom(userIdSearching: sendNotifToUser, completion: { (userInfo) in
// send notif
if let notif = userInfo?.deviceToken {
let value:NSMutableDictionary = [:]
value["include_player_ids"] = [notif]
value["contents"] = ["en": "Test Message"]
let additionalData = ["name":"Pierre"]
value["additionalData"] = additionalData
OneSignal.postNotification((value as NSDictionary) as! [AnyHashable:Any])
}
})
答案 0 :(得分:0)
不要使用additionalData
,只需使用data