简体   繁体   中英

Swift remote push notifications, how do I actually trigger them to be sent?

I am currently working on developing an app in swift 5, Xcode 11, and I am getting towards the end of the initial development. Right now, I am attempting to integrate Remote Push Notifications into the app. I have followed a lot of tutorials online and it works in the sense that I can send the remote notifications through the "Pusher" app, but this is only for testing purposes. I can't seem to find anything about how to actually trigger the notifications through the code, so that, for example, if a user were to receive a message in the app, they would get a push notification. I am not sure if I am just completely missing something, but if anyone can explain to me what exactly I am skimming over in simple terms, I would greatly appreciate it. Thank you.

When we talk about "remote notifications", it means that we have a server that sends us these notifications. As I understand, you want to just show in-app banner that looks like notification. You have 2 options:

  1. Follow these instructions and schedule notifications locally
  2. Use some sort of third party library (eg SwiftEntryKit ) to create customized in-app notifications.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM