Hi Brian
When are you sending the PushRegistrationRequest?
The push id only needs to be sent to gamesparks once, sending it multiply times can effect the push messages and cause them not to work.
Does player 2 have the app open or is it in the background?
Regards
Katie
Hi Brian
I would recommend not sharing push ids(devices) along test players as this can complicate testing.
Have you been able to see if the SocialRankChangeMessage is being called via Analytics->APIStream Type->equal-> SocialRankChangeMessage ?
Regards
Katie
{ "@class":".SocialRankChangedMessage", "gameId":303237, "leaderboardName":"High scores leaderboards", "leaderboardShortCode":"SCOREBOARD", "messageId":"5921860c86972904dfbbc77f", "notification":true, "playerId":"592179cd900bea04f562d4c8", "subTitle":"SUBTITLE", "summary":"Your social rank has changed on the High scores leaderboards leaderboard", "them":{ "LEVEL":0, "SCORE":50004, "_id":"580541f2b5973404cf31b7d4", "city":"Longford", "country":"IE", "dataComplete":true, "externalIds":{ "FB":"120466395089815" }, "loc":[53.733306884765625,-7.8000030517578125], "ts":1495369228564, "userId":"580541f2b5973404cf31b7d4", "userName":"Helen Alacgicfedchj Occhinowitz", "v":4, "when":"2017-05-21T12:20Z" }, "title":"TITLE", "you":{ "LEVEL":0, "SCORE":50003, "city":"Longford", "country":"IE", "externalIds":{ "FB":"163811674153970" }, "userId":"592179cd900bea04f562d4c8", "userName":"James Floop", "when":"2017-05-21T12:19Z" } }
I did try to do a better test this morning, with a different device and two new users. Just call push registration once for one user and then try it.. But the firebase SDK is not working on my other phone >:( (an old S2)
Next thing I will try is to unregister all the users from my device and try the above test on that.
btw How do I unregister a device for push notifications?
Thanks a lot!!
Hi Brian
It's isn't possible to unregister a device that is connected to a player.
Push notifications will only work when the app is not open.
Can you try sending a push using a custom event and message?
Regards
Katie
var msg = Spark.message(null); msg.setPlayerIds([Spark.getPlayer().getPlayerId()]); msg.setMessageData({"title":"test title","body":"test body"}); msg.send();I did also make a custom message called TESTPUSHMESSAGE
var msg = Spark.message("TESTPUSHMESSAGE") msg.setPlayerIds([Spark.getPlayer().getPlayerId()]); msg.send();
This did not work, though I'm only starting with gamesparks and dont know what I'm doing, so I dont even know if that should have worked
Hi Brian
The custom message is not being sent because the Device Types is set to "ANDROID"
Can you leave this blank or set it to "FCM"
Regards
Katie
But hopefullt I should be able to figure out how to customize it.
Just fyi here is what my SocialRankChangedMessage looks like now
Thanks a lot for your help!
Hey I'm totally fine on this matter now btw. Cheers
Also just fyi this reply / comment feature does not work on firefox
Brian McElroy
I followed this tutorial and was successfully able to send a push notification to my phone using the test described in the tutorial.
I am trying to implement a push notification being sent when someones friend beats their score.
In my leaderboard, social notifications are on.
For SocialRankChangedMessage.
send via socket, is off
send as push, is on
Suppress Push On Socket Send, is off
Android is included in device types
I log in on my phone (and also successfully call PushRegistrationRequest) as user1, who has a higher score than user 2
Then log in as user 2 on the test harness, and submit a score higher than user 1's highest
Everything seems to work and I can see the social scoreboard on my phone with the new score,
but I never get any push notification. What am I missing? thanks!1 person has this question