How to send notification via iOS?

Hello,

I am sending perfectly notifications on Android but I am new on macbook, I am sending a notifications through XCode simulator, and it gives error when I send a notification, what is the http payload for iOS? the error is the following:

message: "Http failure response for https://fcm.googleapis.com/fcm/send: 0 Unknown Error"

Thank you

Regards

so we are talking about push notifications which you try to send from a server to ios simulator?

Yes, I saw the difference, if I run from XCode just pressing on “play” button (run) it doesnt work, but If I run this command works: ionic cordova emulate --livereload ios -- --buildFlag="-UseModernBuildSystem=0" --target="iPhone-8, 12.1"cannot understand such things…

Hello i have same issue, if debug mode ios app notification is sent but debug mode on Xcode show me this error

**Http failure response for https://fcm.googleapis.com/fcm/send: 0 Unknown Error**

you solved it ?

I solved it running the command from above :wink:

I think you will have to use tools such as pusher or firebase.
or if you are already into FCM, you can try the code below… if this is not the solution you’re looking for then kindly ignore my post as i haven’t understood the question well :grin:

await fetch('https://fcm.googleapis.com/fcm/send', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: `key=<FCM-SERVER-KEY>`,
  },
  body: JSON.stringify({
    to: '<NATIVE-DEVICE-PUSH-TOKEN>',
    priority: 'normal',
    data: {
      experienceId: '@yourExpoUsername/yourProjectSlug',
      title: "\uD83D\uDCE7 You've got mail",
      message: 'Hello world! \uD83C\uDF10',
    },
  }),
});
If you are testing the codes then you may use frameworks like [Akka framework](https://thinkpalm.com/blogs/introduction-akka-framework/) or similar frameworks. just putting it out there.