question

brendan avatar image
brendan asked

IOS push notification

dragongamestudio
started a topic on Fri, 28 August 2015 at 6:00 PM

Hello Brendan, i have some problem with the IOS push notification.

i have setup the IOS push notification like playfab shown in this page https://playfab.com/docs/friend-leaderboards-and-push-notifications/

but i dont know why some of my device didnt receive it, and the other device received it.

and here the one of my device token that didnt receive it

<4951f730 14c82819 876ffb82 616c0ef0 24e5a865 bfecf4d8 a6374abe 7b9d034a>

(4951f73014c82819876ffb82616c0ef024e5a865bfecf4d8a6374abe7b9d034a)

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

11 Comments
dragongamestudio said on Tue, 01 September 2015 at 1:49 AM

here is how i test it

first i registered the push notification to

https://F475.playfabapi.com/client/RegisterForIOSPushNotification 

{
  "DeviceToken": "4951f73014c82819876ffb82616c0ef024e5a865bfecf4d8a6374abe7b9d034a",
  "SendPushNotificationConfirmation": "false",
  "ConfirmationMessage": ""
}

and i got response

{"code":200,"status":"OK","data":{}}

after that i try to send notification with RESTClient(firefox add on) to

https://f475.playfabapi.com/Server/SendPushNotification

X-Secretkey : {
                 {SecretKey}}
Content-type : application/json

{
  "Recipient": "4D66B4AD1284FEC7",
  "Message": "You have been attacked! Go defend your base!"
}

and i got response

    {
        "code": 200,
        "status": "OK",
        "data":
        {
        }
    }

but i didnt get the notification in my device

https://F475.playfabapi.com/client/RegisterForIOSPushNotification   {"body":"{\"DeviceToken\":\"4951f73014c82819876ffb82616c0ef024e5a865bfecf4d8a6374abe7b9d034a\",\"SendPushNotificationConfirmation\":\"false\",\"ConfirmationMessage\":\"\"}","timeout":10,"headers":{"X-Authentication":"4D66B4AD1284FEC7---F475-8D2B2A8B3B9E5A0-CFC60652E65E9D31.3E772F3F6EF0D346","Content-Type":"application/json"}}

Brendan Vanous said on Tue, 08 September 2015 at 11:43 AM

Apologies for the delay in the response - we'll be updating our support site shortly, in order to improve the tracking and overall support experience. If you ever don't hear back on an issue for a couple of days, please be sure to email us at devrel@playfab.com. We make a point of answering all questions within a couple of business days.

Since you're getting good responses to both registering and sending the Push messages, we're getting good responses from SNS concerning sending the message. Are you able to get Push Notifications from other apps on the device? Have you tried this with any other devices? Does this reproduce both when the application is running and when it's not?

Brendan


dragongamestudio said on Tue, 08 September 2015 at 7:05 PM

yes, we have try it, and for those 3 devices, we never get the push notification even we always got good responses from playfab, but in other iphone devices, they got the push notification.

also in all my android devices, the messages still not shown, even we have enabled the push notification permission in each our devices, because if not we will never get the push notification right?


zacb said on Wed, 09 September 2015 at 8:49 AM

Hey Dragongamestudio,

I will take a look and see if I can reproduce these issues. So far I have not seen any issues like this on iOS.

Stay tuned here for updates later in the week.

-z


dragongamestudio said on Wed, 09 September 2015 at 10:50 PM

okay, thank you :)

try to register one device with more than 1 different playfab id

thank you, Chandra


Brendan Vanous said on Thu, 10 September 2015 at 10:09 PM

Hi Chandra,

That, we can specifically say won't work. A Device ID cannot be linked to more than one PlayFab account. If you try to register the ID to a second account, you'll get the "DeviceAlreadyLinked" error. If you're just signing in with it, you're still singing into the first account.

Brendan


dragongamestudio said on Sun, 20 September 2015 at 11:02 PM

okay then, how can i unregister it, since in our design there is logout feauture for player to get loged out and of course after that, player can login with another account right?
and also i just got this error after i succed to register the push notification without error linking the device into playfab

https://F475.playfabapi.com/client/RegisterForIOSPushNotification   {"body":"{\"DeviceToken\":\"b76416b4a4baa7bb85bfc14d098a0323d277cf0528510fcf03b1e8bd73b76ab0\",\"SendPushNotificationConfirmation\":\"false\",\"ConfirmationMessage\":\"\"}","timeout":10,"headers":{"X-Authentication":"979FF4067A413D2A-0-0-F475-8D2C2476B46999B-1A006D68F0C79F68.3DAD374F14E82442","Content-Type":"application/json"}}

 {"code":200,"status":"OK","data":{}}

i alwyas got

"error": "PushNotEnabledForAccount",
even in the dashboard it shown the push notification enabled


Brendan Vanous said on Wed, 23 September 2015 at 1:23 AM

"Logging out" of PlayFab really just amounts to deleting the Session Ticket for the player. Without a Session Ticket, the user would have to sign into the PlayFab service, meaning it could be any account the user desires.

For your Push issue, do you mind if we create a test user in your title, so that we can test it out directly?

Brendan


dragongamestudio said on Wed, 23 September 2015 at 3:59 PM

okay,
i mean what if our player log out from his device and log in again with another id in same device,
is that possible the seccond account to have the push notification because you said that "A Device ID cannot be linked to more than one PlayFab account."

sure, just create it


Brendan Vanous said on Wed, 23 September 2015 at 6:05 PM

That depends upon your login method. If you give them the option to sign in with Facebook, for instance, it's possible for multiple users to share the same device. If your only sign in mechanism is Device ID, then two users cannot share the same device (if it is using the same Device ID for both users, which for phone devices would be the case).

Brendan


zacb said on Thu, 24 September 2015 at 6:28 PM

While not extensively tested on iOS, I just completed a testing app for CloudScript and Push Notifications, as well a sample for how to connect into our latest Android plugin.

Let me know if you have any further questions or issues.

Additional documents and samples are in the works, but until they are complete, contact us and we can set up a walkthrough of the entire back-end configuration for either Android or iOS devices.

Happy developing,

Zac

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jonas Johnsson avatar image
Jonas Johnsson answered

hello Zac,

is there any changes for https://api.playfab.com/Documentation/Client/method/RegisterForIOSPushNotification

because i got this errror when try to register the push notification

http://s20.postimg.org/o4rvaqvql/Screen_Shot_2015_10_19_at_2_19_36_PM.png

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Zac Bragg avatar image
Zac Bragg Deactivated answered

Hey Jonas,
That message would suggest that your PlayFab title is not correctly linked to the Apple push channel.

The command that makes this link is called SetupPushNotification: https://api.playfab.com/Documentation/Admin/method/SetupPushNotification

A crash course and sample Unity project can be found here: https://github.com/PlayFab/UnitySDK/tree/master/ClientExamples

Let me know if you have any questions.

Thanks,
Zac

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.