Skip to main content

I've had a web based app working reliably against Strava APIs for many years - the app is using the Events API to get notifications about data changes which works really well.

I've been considering doing a mobile app version but am interested to know what model people have used. 

Do you have each instance of the app polling for new data when the user accesses the app? I can imagine hitting rate limits is an issue with a decent number of users.

Is it better to have my own hosted web app dealing with the Strava data sync side of things and my mobile app then just queries my own API to get the user's latest data?

Is there another model I've not considered?

Thanks!

Maybe look into something like Firebase Cloud Messaging or OneSignal so you can send push notifications from your web app to the mobile app? Then you wouldn't need to poll anything. Since you've already got the web app you can keep all of the data/processing there and push a notification to the mobile app when new data is available. Depending how much data you're transferring you could either:

  1. Send it all through the message if it's less than the message payload limit (~4kb for both Firebase and OneSignal)
  2. Have your app query your web server for the data. This would avoid using any more API calls, and if you're doing processing on the data would prevent you from having to do it twice (once on the web, once in the app)
  3. Let your app directly query the Strava API

As an added bonus it's cross-platform so if you expand your app to Android you won't have to change any server code or use any new services.


Thanks for the suggestions - I'll have a go at quick prototype to see if I can get something working with one of those.  I'm only need minimal data once my API has processed it so option 1 sounds like it would be fine.


For iOS app development best practices, it's advisable to minimize polling and instead implement a push notification system. You could consider having your mobile app subscribe to push notifications for data updates from the server. This approach reduces unnecessary requests and improves efficiency. Additionally, maintaining your own hosted web app to handle data synchronization and having your mobile app query your API can help streamline the process and reduce reliance on third-party APIs like Strava's, mitigating potential rate limit issues.

Best regards, 

Devendra Yadav


Reply