Hi, I'm trying to send a push notification to an iOS device. The code below is working perfectly for Android devices but on iOS MessageReceivedEventArgs reference e.Message.Data returns empty. e.Message.Notification.Body and e.Message.Notification.Title is working as expected and they are not empty. Also, notification is receiving from the device without a problem. Only problem is CustomData.
I already tried AdvancedPlatformDelivery, not working.
Thanks.
handlers.SendPushToFriend = function (args) { var targetId = args.TargetId; var logArrayObject = []; var functionMessage = args.FunctionMessage; var splittedMessage = functionMessage.split("/"); var obj = { playerID: currentPlayerId, fMessage : functionMessage }; var myJSON = JSON.stringify(obj); // try to send push notification try { server.SendPushNotification({ Recipient : targetId, Package : { Message : splittedMessage[4] + " / " + splittedMessage[5] + " / " + splittedMessage[6] ,//currentPlayerId + "/" + functionMessage, Title: splittedMessage[2] + " " + splittedMessage[7], CustomData: myJSON, } }); } catch (ex) { logArrayObject.push("error->" + ex.Message + " ID-->" + args.TargetId); // Target player has not registered for Push Notifications } return { returnLogValue: logArrayObject }; }; // FIREBASE C# CODE private void OnMessageReceived(object sender, Firebase.Messaging.MessageReceivedEventArgs e) { lastMsg = ""; messageData = ""; if (e.Message.Data != null) { lastMsg += "DATA: " + PlayFabSimpleJson.SerializeObject(e.Message.Data) + "\n"; Debug.Log("PlayFab: Received a message with data:"); foreach (var pair in e.Message.Data) { Debug.Log("PlayFab data element: " + pair.Key + "," + pair.Value); if (pair.Value.Contains("GameInvitation")) { messageData = pair.Value; } if (pair.Key.Equals("playerID")) { senderPlayfabID = pair.Value; } } } }