question

yoshino shinya avatar image
yoshino shinya asked

Error in SendPushNotification in cloudScript

Hi, I want to use push notifications. iOS certificate has been uploaded. Then I wrote and executed the code in cloudScript.

handlers.sendPush = function (args, context) {
      var request = {
        "Recipient": currentPlayerId,
        "Package": {
    "Message":"hi",
    "Title":"title",
        }
    };
    server.SendPushNotification(request);
}
When executed, I get an error. Are there missing parameters?
{
    "FunctionResult": null,
    "Logs": [
        {
            "Level": "Error",
            "Message": "PlayFab API request error",
            "Data": [
                [
                    []
                ],
                [
                    [
                        [
                            []
                        ],
                        [
                            [
                                [
                                    []
                                ],
                                [
                                    []
                                ],
                                [
                                    []
                                ]
                            ]
                        ]
                    ]
                ],
                [
                    []
                ],
                [
                    [
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ]
                    ]
                ]
            ]
        }
    ],
    "ExecutionTimeSeconds": 0.0413044,
    "MemoryConsumedBytes": 40656,
    "APIRequestsIssued": 1,
    "HttpRequestsIssued": 0,
    "Error": {
        "Error": "CloudScriptAPIRequestError",
        "Message": "The script called a PlayFab API, which returned an error. See the Error logs for details.",
        "StackTrace": "Error\n    at Object.server_request (Script:180:24)\n    at Object.server.SendPushNotification (Script:595:77)\n    at handlers.sendPush (9BAFE-main.js:76:12)\n    at Object.invokeFunction (Script:116:33)"
    }
}
1 comment
10 |1200

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

yoshino shinya avatar image yoshino shinya commented ·
I'm sorry, my title ID has come out, but is it possible to hide or delete once if security is bad?
0 Likes 0 ·
Sarah Zhang avatar image
Sarah Zhang answered

TitleID is not private information, it will be contained in the PlayFab API request URL. Exposing TitleID does not cause security issues. Customers should notice not exposing the Developer Securite Keys. We are unable to help you modify the question content. If you mind TitleID exposure, you can delete this question and create a new one.

3 comments
10 |1200

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

yoshino shinya avatar image yoshino shinya commented ·

わかった、ありがとう

0 Likes 0 ·
yoshino shinya avatar image yoshino shinya commented ·

ok thank you

0 Likes 0 ·
yoshino shinya avatar image yoshino shinya commented ·

ok thank you

0 Likes 0 ·
yoshino shinya avatar image
yoshino shinya answered

The error disappeared when I performed this process for the first time in unity.

https://docs.microsoft.com/ja-jp/gaming/playfab/features/engagement/push-notifications/push-notifications-for-ios
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.