Just a coder
Just a coder

Reputation: 16730

How to get estimated time of arrival to multipe destinations on iOS?

I have an App that has the locations of 10 different places.

Given your current location, the app should return the estimated arrival time for those 10 locations.

However, Apple has said that

Note: Directions requests made using the MKDirections API are server-based and require a network connection. There are no request limits per app or developer ID, so well-written apps that operate correctly should experience no problems. However, throttling may occur in a poorly written app that creates an extremely large number of requests.

The problem is that they make no definition on what a well written app is. Is 10 requests bad? Is 20 requests an extremely large number?

Has any one done an app like this before to provide some guidance? If Apple does begin throttling the requests, then people will blame my app and not Apple. Some advice please..

Upvotes: 0

Views: 196

Answers (1)

Oleg Gordiichuk
Oleg Gordiichuk

Reputation: 15512

Hi investigate class MKRoute this class contains all information you need.

This object contains

expectedTravelTime

Also you should consider LoadingThrottled

The data was not loaded because data throttling is in effect. This error can occur if an app makes frequent requests for data over a short period of time.

For prevent your request from bing throttled, reduce number of requests. Try to use Completion Handlers to know if you request is finished and only after send another request or cancel previous. From my experience try to handle this request just as regular network request just be sure you are not spamming unnecessary requested to the Apple API. But this is not 100% guarantee that Apple won't throttle your requests.

Upvotes: 1

Related Questions