Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when send notification using FCM Http v1 #788

Closed
dongphh opened this issue Jun 21, 2024 · 6 comments
Closed

error when send notification using FCM Http v1 #788

dongphh opened this issue Jun 21, 2024 · 6 comments

Comments

@dongphh
Copy link

dongphh commented Jun 21, 2024

Hi @appleboy

I had test send to Android and IOS notification using gorush setup on docker.

I check log and see some message send error for IOS

{"level":"error","msg":"{\"type\":\"failed-push\",\"platform\":\"android\",\"token\":\"....-PPv2HlZKzSx7ZFSG\",\"message\":\"(message redacted)\",\"error\":\"Requested entity was not found.\"}","time":"2024-06-21T02:19:16Z"}
{"level":"error","msg":"{\"type\":\"failed-push\",\"platform\":\"android\",\"token\":\"......gEENv5z2WoSp4ROean6kahLVISC2rIbgyR4VIMl9GsEF9fGSwiwMt0UK94\",\"message\":\"(message redacted)\",\"error\":\"Internal error encountered.\"}","time":"2024-06-21T02:20:05Z"}

Request like this

{
  "notifications": [
    {
      "tokens": [
        "TOKEN"
      ],
      "platform": 2,
      "title": "Title",
      "message": "notice",
      "data": {
        "id": "40007399",
        "isLogin": "Y",
        "messagetype": "HTML",
        "data_extend": ""
      },
      "sound": {
        "name": "default",
        "critical": 1,
        "volume": 10
      }
    }
  ]
}

What is the cause of this error? and how to fix it?

And IOS not play sound when received message
Thanks

@obuzyig
Copy link

obuzyig commented Jun 21, 2024

@dongphh you might be getting "Requested entity was not found." since the client token is not an existing / registered token at the FCM. Platform seems to be set FCM in your request example, however, there may be some IOS specified fields as well.

@appleboy
Copy link
Owner

I will take it and test your input.

@appleboy
Copy link
Owner

Can you get the notification data with title, message, and custom data payload but miss the sound with iOS? Right?

@appleboy
Copy link
Owner

@obuzyig Please update the request body as below: volume must be in the interval [0, 1]

{
  "notifications": [
    {
      "tokens": [
        "ftc3Q_b9ny_zfRyEIvs6gC:APA91bELvcQlOGnErWfZY5GWgVTi2SMZ41rGs5mIa_BhUFxcpaumYaTpXX-6eQ5EIxIg0t4-ws35eVOcVz08rcnGp9hH-_JJACd8T5W47P4vAH0AZYnCOlQ-3Hqq3ygnTWeSKZX9WZip"
      ],
      "platform": 2,
      "title": "Title",
      "message": "notice",
      "data": {
        "id": "40007399",
        "isLogin": "Y",
        "messagetype": "HTML",
        "data_extend": ""
      },
      "apns": {
        "payload": {
          "aps": {
            "sound": {
              "name": "default",
              "critical": 1,
              "volume": 0.1
            }
          }
        }
      }
    }
  ]
}

@obuzyig
Copy link

obuzyig commented Jun 22, 2024

@appleboy I tagged @dongphh to avoid any misdirection. It was their question. Thank you.

@obuzyig Please update the request body as below: volume must be in the interval [0, 1]

@dongphh
Copy link
Author

dongphh commented Jun 23, 2024

Can you get the notification data with title, message, and custom data payload but miss the sound with iOS? Right?

Thanks for your help.
It work ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants