NEW: Learn to build the incredible iOS 15 Weather app today! >>

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

   

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.

   

Hacking with Swift is sponsored by Essential Developer

SPONSORED Only until this Sunday, December 12th, you can join a free crash course to learn advanced techniques for testing new and legacy Swift code — it's the fast track to becoming a complete Senior iOS Developer!

Click to learn more

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

Reply to this topic…

You need to create an account or log in to reply.

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.