I follow the tutorial step by step and got the log "Push Registration Successful", as this doc says:
But in the Title Player Account, it said: "Push notifications are not set up."
When I use a Cloud Script to test the Push Notification: (my test user Playfab ID is A84D37DA116A478)
server.SendPushNotification({"Recipient" : "A84D37DA116A478", "Message" : "This is a test messeage. Please ignore it!", "Subject" : "A test message"});
The test failed, my device did not get any notification. Here is the response log:
{"Data":{"api":"/Server/SendPushNotification","request":{"Recipient":"A84D37DA116A478","Message":"This is a test messeage. Please ignore it!","Subject":"A test message"},"result":null,"apiError":{"code":400,"status":"BadRequest","retryAfterSeconds":null,"error":"PushNotEnabledForAccount","errorCode":1094,"errorMessage":"PushNotEnabledForAccount","errorHash":null,"errorDetails":null}},"Level":"Error","Message":"PlayFab API request error"}
Does anyone know how to solve this? This is the response I got after called PlayFabClientAPI.RegisterForIOSPushNotification. Hope this can provide more details about the bug.
{"Request":{"ConfirmationMessage":null,"DeviceToken":"d1e3ec554b4211b2ce2adf2c0d47c8d7201318762712a12d6b96c76abb5e23f4","SendPushNotificationConfirmation":null,"AuthenticationContext":null},"CustomData":null}
P/s: I have completed the Push Notifications settings of the Title, and it is currently Active.
The XCode project also have capability for Remote Push Notification.
Answer by Trung Dong · Aug 03, 2021 at 04:35 PM
I have found the cause!
It seems you can not register to Push Notification if logged in as a guest. You need to log in by Facebook or Playfab account etc.
This note should be in the tutorial. It cost me a whole day to find out :(
Tournaments question 1 Answer
no way to opt out of notifications?,No way to opt out of the emails? 2 Answers
Can send the push notification only while the game is open 1 Answer
New Apple root certificate for push notifications 1 Answer
Recieving push notifications when game is force closed 3 Answers