Sign In Register

How can we help you today?

Start a new topic
Answered

[Android] Push notification with custom json

Hi, i have some problems with push notifications on android. I am using Ultimate Mobile and when i test push notifications via "Test Push Notification Google" popup (Configurator>Integrations>Google>Test) with following json:

{"title":"Push title", "alert":"Push message", "json":""}



then everything is working. But i cant reproduce this in cloud code (my plugin requires title, alert and json). I tried following code:

 

Spark.message("dbg_msg")
.setPlayerIds([Spark.getPlayer().getPlayerId()])
.setMessageData({"title":"title", "alert":"alert", "json":""})
.send();

 

 

but its not working ("json" field is not found). How can i send push from cloud code  same as i send via "Test Push Notification Google" popup?

 

Regards,

Rafał


Best Answer

Ok, I found answer - custom json for push notification can be set in Configurator>Integrations>Google>Edit>Custom JSON.

There us correct json for my plugin (ultimate mobile plugin):

 

{ "alert":"${summary}", "json":"", "title":"${title}"}

 


I can not edit previous post: I am using Ultimate Mobile Plugin: https://www.assetstore.unity3d.com/en/#!/content/20152

Answer

Ok, I found answer - custom json for push notification can be set in Configurator>Integrations>Google>Edit>Custom JSON.

There us correct json for my plugin (ultimate mobile plugin):

 

{ "alert":"${summary}", "json":"", "title":"${title}"}

 

Login to post a comment