How do you send a notification?

User A comments on user B's post. User B recieves a notification stating that user A has commented on their post. I want to do something similar to that in which user B recieves a notification.

A server must be involved. What type of server and notification depends on the back end infrastructure you're using. Roll your own or third party APNS, CloudKit, or whatever.

I have enabled the push notification service in my app, is there any code to write to send a push notification when an action is performed by a user?

is there any code to write to send a push notification when an action is performed by a user?

junkpile has effectively answered this already: the code you write depends on the back-end system that you choose to use.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi,

Like you said I managed to get the push notifications on my server. So all notifcations go straight to the server. Now I dont know hot to push it from the server to another device.

Now I dont know hot to push it from the server to another device.

Alas, there’s not enough information here to give a meaningful response. I recommend that you read Local and Remote Notification Programming Guide. Once you have a feeling for how push notifications flow through the various systems, you’ll be able to ask a more specific question.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
How do you send a notification?
 
 
Q