D dieterp Active Member Licensed User Longtime User Feb 8, 2016 #1 Is it possible to change the 'body' message that arrives in a push notification in the Application_RemoteNotification (Message as Map) sub? The string that arrives in the body message is bunch of messy values that I strip out using Regex.Split. I would like the notification message to be something cleaner though that the user can make sense of. I am referring to the message that appears in the Notifications pane of the device when the app is in the background. Last edited: Feb 9, 2016
Is it possible to change the 'body' message that arrives in a push notification in the Application_RemoteNotification (Message as Map) sub? The string that arrives in the body message is bunch of messy values that I strip out using Regex.Split. I would like the notification message to be something cleaner though that the user can make sense of. I am referring to the message that appears in the Notifications pane of the device when the app is in the background.
Erel B4X founder Staff member Licensed User Longtime User Feb 9, 2016 #2 You cannot change the automatic notification text. However you can use silent notifications and then show a local notification from your app. This will allow you to change the message. Upvote 0
You cannot change the automatic notification text. However you can use silent notifications and then show a local notification from your app. This will allow you to change the message.
tufanv Expert Licensed User Longtime User Feb 9, 2016 #3 Erel said: You cannot change the automatic notification text. However you can use silent notifications and then show a local notification from your app. This will allow you to change the message. Click to expand... I have the same issue. Isn't it something intereseting that the shown message contains absurd symbols ? Upvote 0
Erel said: You cannot change the automatic notification text. However you can use silent notifications and then show a local notification from your app. This will allow you to change the message. Click to expand... I have the same issue. Isn't it something intereseting that the shown message contains absurd symbols ?
D dieterp Active Member Licensed User Longtime User Feb 9, 2016 #4 My message is purposely sent with all the ";" characters in them so that I can break the different values up that I require to populate the database. It's just not very user-friendly text. I know in Android you can change the body message when it arrives. Thanks for the suggestion Erel. Will try it out. Upvote 0
My message is purposely sent with all the ";" characters in them so that I can break the different values up that I require to populate the database. It's just not very user-friendly text. I know in Android you can change the body message when it arrives. Thanks for the suggestion Erel. Will try it out.
D dieterp Active Member Licensed User Longtime User Feb 10, 2016 #5 Erel, I have gotten the Silent Notification to work to change the body message of the notification. I see however that the actual message that gets sent in the Notification does not get sent through with these changes. What do I need to do after setting the Silent notification to be able to receive/pull down the actual message? Upvote 0
Erel, I have gotten the Silent Notification to work to change the body message of the notification. I see however that the actual message that gets sent in the Notification does not get sent through with these changes. What do I need to do after setting the Silent notification to be able to receive/pull down the actual message?
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2016 #6 Not sure that I understand. Are you showing a regular local notification? Upvote 0
D dieterp Active Member Licensed User Longtime User Feb 10, 2016 #7 I'm also not entirely sure I'm doing the right thing but let me try explain. I add this line to the PushServer as per the Silent Push notification tutorial: Code: Copy jg.Initialize(CreateMap("aps":CreateMap("content-available": 1))) When I send through the notification with my body message the following is what I receive on the client side. Using normal push notifications that map would normally contain my message: Code: Copy Remote notification: (read only map) { aps = "(read only map) {\n \"content-available\" = 1;\n}"; } (read only map) { "content-available" = 1; } Am I still able to retrieve the body message I sent in the notification and if so, how do I go about it? Upvote 0
I'm also not entirely sure I'm doing the right thing but let me try explain. I add this line to the PushServer as per the Silent Push notification tutorial: Code: Copy jg.Initialize(CreateMap("aps":CreateMap("content-available": 1))) When I send through the notification with my body message the following is what I receive on the client side. Using normal push notifications that map would normally contain my message: Code: Copy Remote notification: (read only map) { aps = "(read only map) {\n \"content-available\" = 1;\n}"; } (read only map) { "content-available" = 1; } Am I still able to retrieve the body message I sent in the notification and if so, how do I go about it?
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2016 #8 You can add more key/value pairs: Code: Copy jg.Initialize(CreateMap("aps":CreateMap("content-available": 1), "Key1": "Value1", "Key2": Value2)) Upvote 0
You can add more key/value pairs: Code: Copy jg.Initialize(CreateMap("aps":CreateMap("content-available": 1), "Key1": "Value1", "Key2": Value2))