2

I want to develop an app, but before I actually start developing, I've been doing some research so that i can be sure it's going to work in the way I'd like to do this.

You can imagine the app as a kind of news app, where the user can indicate whether he wants to receive push notifications, and may also indicate that he only wants to receive a push notification if it is in X distance from his current location. And this is probally a problem on IOS, On android it would be no problem if a push notification came in to read the current position of the user and settings and then show the push notification or not.

As far as I've read this is a problem on iOS, the system receives the push and the app can not respond to it unless the user clicks on it. Theres also another problem about closing an app on IOS, ideally a app should not be closed (swiped out) by the user because this would be a force close on IOS. From ive seen most users still swipe out apps, and this would mean that my app cannot run background tasks anymore.

This is what i thougt about:

  • Send Silent push, app download data on the background -> Check if this meets the user settings, if so show a local notification. (30 sec time to handle, but do not know if it is possible to throw a local push here too.)

  • The app sends data on the background over the user's current position before sending a push, the server checks for which apps it should be sent (actually no solution, too much data usage as it may be that the user is only one Specific location, need a good server if the app is used on thousands of devices.).

Does anyone have any idea how to handle this problem?

Bolivir
  • 79
  • 3
  • ok, in iOS there is sclient push notification & in current iOS version you can add notification background service in order to run the app in the background. So using above combination you can display a local notification. Read these links https://medium.com/posts-from-emmerge/ios-push-notification-background-fetch-demystified-7090358bb66e http://stackoverflow.com/questions/24474327/push-notifications-and-background-fetch-mode http://stackoverflow.com/questions/19068762/will-ios-launch-my-app-into-the-background-if-it-was-force-quit-by-the-user Hope you get me – Gagan_iOS May 21 '17 at 11:20
  • First of all thanks for youre response. The background service is what i was thinking about, but from what ive seen the background service will be closed if the user swipes out the app, or did i misread something in the apple documentation? If i understand you correctly the method with sending a silent push, then download data and eventually show a local notification should be possible, even when the user has swiped out the app? – Bolivir May 21 '17 at 11:26
  • yeah.. please read this link http://samwize.com/2015/08/07/how-to-handle-remote-notification-with-background-mode-enabled/ If user killed the app then it will be an issue – Gagan_iOS May 21 '17 at 11:40

0 Answers0