0

How can I pass additional data in my notifications im currently using Onesignal to send notification. im not sure if im using the key additionalData to send the additional data. I receive the notification but I do not receive the additional Data

//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])
                }
            })
rmaddy
  • 314,917
  • 42
  • 532
  • 579
SwiftER
  • 1,235
  • 4
  • 17
  • 40

1 Answers1

0

Instead of using additionalData, just use data

SwiftER
  • 1,235
  • 4
  • 17
  • 40