Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trigger an app to fetch data via a REST-Service?

Tags:

rest

ios

mobile

I am looking for a way to trigger an app to fetch data from a remote REST-Service. The approach shouldn't require polling.

iOS push notifications doesn't seem to be an option due to the fact that it can be deactivated by the user. However, I may be wrong.

Is there a best practice to get this done?

like image 332
Scholle Avatar asked Feb 07 '23 12:02

Scholle


1 Answers

Actually Push Notification is the way to go.

On ios8 and later, push notifications are enabled by default for exactly this reason you want. You cannot show something to the user (meaning pushes containing a json with an alert will not be shown), but your app is getting the payload and can initiate an action once the push is received.

From the documentation:

A user’s notification settings control only whether the system displays local or remote notifications onscreen. Regardless of the notification settings, local and remote notifications are delivered to your app at the appropriate times.

like image 174
Lefteris Avatar answered Feb 13 '23 06:02

Lefteris