Upvote:2

you should enable the capability of push notification and enable background mode such as:

!(https://i.stack.imgur.com/DGZ7h.png)

!(https://i.stack.imgur.com/z7ITq.png)

and you should go to your firebase project settings/cloud messaging/ add or insert your APNs Authentication Key from apple developer account


Credit Goes to: stackoverflow.com

Related question with same questions but different answers