MapKit does not give directions. I think this is because of the licence agreement between Google and their map data providers.
The easiest way to show directions is indeed to open the map URL. You understand correctly, this will close your app and open the Maps application. Closing your app to show Maps may be the right thing to do from your users' points of view.
If you must have directions on your map without leaving your application, you'll have to build it yourself. You could render the route as one or more annotations with custom views. Unfortunately, your app will have to find the route information on its own (or use a third party library).
StoreKit API (iOS 10.3 and up)
As of iOS 10.3, the StoreKit API provides a way to request a review on the App Store without leaving your app. When called, the system may present the user with an alert that requests a review. The user may provide a star rating directly inside the alert, continue on to write a review, or dismiss the alert. StoreKit handles just about everything for you. To present the review request, make the following call where it is appropriate in your app:
// Objective-C
[SKStoreReviewController requestReview]
// Swift
SKStoreReviewController.requestReview()
As per Apple's instructions, you should not call these in response to a direct user-interaction (i.e. tapping a button that says "Write a Review") because it may not always display the alert. Indeed, the alert may only be displayed three times every 365 days.
Important Note: Although this seems fairly simple, you'll still need to write some kind of logic in order to space out your prompts. For example, to present the prompt only after X number of launches, days, or significant events.
If you fail to do this and just stick the review prompt anywhere (a viewDidAppear
call, for example), your users will be rather annoyed because they'll see it pretty quickly and repeatedly. Then, either they leave a bad review (because they're annoyed) or aren't asked to review again for a whole year.
Below is an example of what the alert looks like. For more information, see Apple's documentation.

iRate (iOS 7.0 and up)
If your app runs on versions of iOS earlier than 10.3 or you need more robust control over requesting ratings from users, iRate is a good solution.
For devices with iOS 10.3 or greater, iRate uses the aforementioned StoreKit API. For devices running iOS 7.0 to 10.2, iRate uses a uialertview and storekit to ask the user for a rating (or to remind them later). Everything is customizable, from the title of the Cancel button to the interval at which it reminds the user.
By default, iRate automatically opens when certain requirements are met (e.g. app launched X number of times, user passed X number of levels), but you can also use a variety of methods and your own logic (with the help of iRate methods) to manually display an iRate popup.
Setup
To install, just drag the header file, the implementation file, and the .bundle
(for localization) into your project.
- Import the header in your AppDelegate:
#import "iRate.h"
- Add the StoreKit Framework to your project - More on StoreKit from Apple Documentation
In your application: didFinishLaunchingWithOptions:
method, set the following:
// Configure iRate
[iRate sharedInstance].daysUntilPrompt = 5;
[iRate sharedInstance].usesUntilPrompt = 15;
Properties
The property below is useful for testing purposes. Set it to YES
during testing to make sure the dialog appears properly. When set to YES
it will appear immediately on startup, disregarding other display settings. Set this to NO
for release versions of your app.
[iRate sharedInstance].previewMode = NO;
The appStoreID
property allows you to set the ID of your app. This is only required if you have both Mac and iOS apps with the same Bundle Identifier. The App ID set here must also match the Bundle ID set in Xcode and iTunes Connect:
[iRate sharedInstance].appStoreID = 555555555;
More Details are available on the iRate GitHub page.
Best Solution
For Google Map You would need to do something like this:-
Use this scheme to request and display directions between two locations. You can also specify the transportation mode.
Parameters saddr: Sets the starting point for directions searches. This can be a latitude,longitude or a query formatted address. If it is a query string that returns more than one result, the first result will be selected. If the value is left blank, then the user’s current location will be used. daddr: Sets the end point for directions searches. Has the same format and behavior as saddr. directionsmode: Method of transportation. Can be set to: driving, transit, bicycling or walking.
An example URL is below to display transit directions between Google NYC and JFK Airport:
comgooglemaps://?saddr=Google+Inc,+8th+Avenue,+New+York,+NY&daddr=John+F.+Kennedy+International+Airport,+Van+Wyck+Expressway,+Jamaica,+New+York&directionsmode=transit
Some additional example are below:
"comgooglemaps://?saddr=Google,+1600+Amphitheatre+Parkway,+Mountain+View,+CA+94043&daddr=Google+Inc,+345+Spear+Street,+San+Francisco,+CA¢er=37.422185,-122.083898&zoom=10"
"comgooglemaps://?saddr=2025+Garcia+Ave,+Mountain+View,+CA,+USA&daddr=Google,+1600+Amphitheatre+Parkway,+Mountain+View,+CA,+United+States¢er=37.423725,-122.0877&directionsmode=walking&zoom=17"
Refer to:
https://developers.google.com/maps/documentation/ios/urlscheme
For Apple Map do like this:- The following examples show the strings you would use to provide driving directions between San Francisco and Cupertino:
"http://maps.apple.com/?daddr=San+Francisco,+CA&saddr=cupertino”
Refer:-
"https://developer.apple.com/library/iad/featuredarticles/iPhoneURLScheme_Reference/iPhoneURLScheme_Reference.pdf"
This works for me, only issue i can see with your query is accurate lat long values(Those looks to be a degree latitude longitude value but passed as a decimal latitude longitude value.
Example Route from Downey to Los Angles NSString *string = [NSString stringWithFormat:@"http://maps.apple.com/? daddr=%1.6f,%1.6f&saddr=%1.6f,%1.6f",34.0522300,-118.2436800,33.9400100,-118.1325700];
But for some of the directions it does not work and shows Directions not available