Sign In Register

How can we help you today?

Start a new topic

need help in integrating firebase with Gamesparks

I was trying to follow this tutorial and had some questions:


-In Integration/Google:: FCM Message Template: How does a message template get populated and used/sent ?

From the tutorial:

 

{
  "notification": {
  "title": "${title}",
  "body": "${summary}"
  }
}

 

 

Where does summary and title get populated from ?


- How can I include game icon in this message that gets sent out ?

 

- How can I send out a push notification from gamesparks ? For example: Coming soon - bla bla feature! Where do I go in GS to send that to all the users ?


- Firebase enables to send users to subscribed topics ? How do I implement that with GS ?


- To use Push notifications, do I need to have the user/device authenticated ?


Can someone help me out with this please?

 Hi,


An example of message population can be found towards the end of the tutorial:


 

var msg = Spark.message(null);
msg.setPlayerIds([Spark.getPlayer().getPlayerId()]);
msg.setMessageData({"title":"test title","body":"test body"});
msg.send();

 

That's one example of using a scriptMessage and populating it with data, then later down we change the template to accommodate that.


Summary and Title are populated in the message configuration settings under Configurator->Messages->Click on a message type.


I'm not sure on how you'd include an Icon, it depends on what you're developing on. Here's a forum post where one of our staff, Katie, explains how to do it https://support.gamesparks.net/discussions/topics/1000085325 I'm not sure on the details however.


You can use a bulk job to send a notification to all your players by sending them a script message via Cloud Code. Check https://docs.gamesparks.com/tutorials/analytics--segmentation-and-game-management/using-bulk-jobs.html


If I understand what that means then we already cover it in the tutorial using PushRegistrationRequest.


I am assuming the player does not have to be authenticated, since the device is getting registered in the Push Registration Request.


I hope this helps,

Omar





Login to post a comment