Hello,
Currently we are trying to implement Remote Push Notifications through CloudScript.
We are executing the following CloudScript function extending the basics article:
var testObject = { "TestKey" : "TestValue" }; var jsonString = JSON.stringify(testObject); try { server.SendPushNotification({ Recipient : currentPlayerId, Package : { Message : "Test challenges you for a battle!", Title: "You have been challenged", CustomData : jsonString }, }); } catch (ex) { // Target player has not registered for Push Notifications }
On Android we properly receive the CustomData in the MessageReceivedEventArgs.Message.Data field.
However on iOS with Unity's built-in RemoteNotification I can't seem to find the Custom Data anywhere. The alertBody is present, but the userData Hashtable is empty.
Are we missing something or are we suppose to use a custom plug-in/native implementation?
Are we perhaps suppose to use AdvancedPlatformDelivery instead of Package to get custom data to iOS users?
Cheers,
Ted