UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Push notification application. Server side.

Forums > Server-side Swift

Hi,

I'd like to build an application which sends notifications with the content derived at the specific time. The content of the message is stored in the MariaDB.

I do understand the logic between APNs and the iPhone, I'm also familiar with the configuration side.

But, how I can code (what technology? php? js? other?) my server to send the notifications to APNs? My server is linux based. I'm guessing I have to use linux scheduling service to contact APNs at the time I want.

Could someone put me in the right direction?

Thx

5      

Hi,

so this post is already pretty old, but thought I might answer it for other folks..

To send push notifications from your server, you need to communicate with the Apple APNs servers. In practice this means that your server will send JSON data to the APNs and that will in turn send out the push notifications.

You can basically use any language that will let you do POST request. As for the scheduling, it could be a simpler script that reads something from the DB, is scheduled via CRON and does the request to APNs. Alternatively you could use something more sophisticated like a task queue - for example Celery.

5      

BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.

Get it on Hacking with Swift+

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.