3

What would be the best approach to resetting a mobile app's content/settings?

Let's say the app is cross platform: iOS/android using javascript/phonegap. The current way this is designed is to have an admin area that can see mobile devices (users which have logged in). The admin has the ability to flag a device for reset.

The app regularly polls the server to see if it should be reset. Resetting will be rare, but the polling is not. The polling doesn't cause any performance issues but it seems off to constantly be asking the server whether or not to blow up the app.

A push rather than a pull method would be nice but I'm not sure what this would look like.

Does anyone have any alternative design suggestions? Are there any drawbacks to the current design?

auspicious99
  • 107
  • 1
  • 8
coder
  • 2,029
  • 2
  • 15
  • 15
  • 1
    Is this a design pattern question? – JeffO Apr 10 '13 at 15:35
  • 3
    Why do you think that a design pattern (Factory, Flyweight, Iterator, Facade, etc...) would help solve this problem? Not everything is a design pattern. –  Apr 10 '13 at 15:41
  • Thanks for the correction. I meant best practice as was fixed by Caleb. – coder Apr 10 '13 at 16:37

2 Answers2

5

Both Android and iOS support some form of push notifications. You should absolutely take advantage of those to deliver your reset messages rather than polling. Running radios unnecessarily can be a huge battery drain, and shifting the responsibility for delivering the reset message to the operating system will be a significant improvement.

If you aren't able or don't want to set up the necessary server side of the push notification equation, there are third parties like Urban Airship and OpenMarket that will be happy to do it for you (for a fee, naturally).

Caleb
  • 38,959
  • 8
  • 94
  • 152
0

The other answer is right about using push notifications rather than continual polling for this purpose.

Now in 2020, Google Cloud Messaging for Android is beyond deprecated, and no longer available. APNS is still around, for iOS, but you can use Firebase Cloud Messaging as a common solution for both platforms.

auspicious99
  • 107
  • 1
  • 8