Using HERE URL scheme doesn't allow tapping the Start button - ios

We are using the HERE URL Scheme to pass coordinates. E.g. here-place://{lat},{lng}
NSString *mapDirHere = [[NSString stringWithFormat:#"here-route://%1.6f,%1.6f,%#/%1.6f,%1.6f,%#", latitude, longitude, NSLocalizedString(#"Current Location", nil), self.selectedCoordinate.latitude, self.selectedCoordinate.longitude, self.titleName] stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:mapDirHere]];
This does open HERE with the correct route, but the "Start" button is never activated, so our users can't start the route.
Has anyone else seen this?

The HERE iOS SDK comes with an example for starting and stopping navigation as you would like to implement in your use case.
https://github.com/heremaps/here-ios-sdk-examples/tree/master/turn-by-turn-navigation-ios-swift
All examples are updated with every update of the SDK so check them out at:
https://github.com/heremaps/here-ios-sdk-examples

Related

Launch Podcast App With URL scheme

I'm trying to open the podcast app with a url like this
- (void)setupPodcast
{
NSLog(#"setup podcast");
NSString *str = [NSString stringWithFormat:#"pcast://podcasts.sdxme.org/RSS/default.aspx?ID=%ld", (long)[[NSUserDefaults standardUserDefaults] integerForKey:#"CustomerID"]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
2015-10-18 23:45:11.367 [29302:1691034] LaunchServices: ERROR: There is no registered handler for URL scheme pcast
However it looks like the pcast scheme is no longer supported? How can I open my own XML feed in the podcast app?
As per Swift 4,
We should use the below url schemes to open podcasts app from our app.
Podcasts (Add Feed By URL) — podcast:// (you can also add a feed URL after to auto-populate it)
Podcasts (Browse) — pcast:// or itms-pcast:// or itms-pcasts:// or podcasts:// or itms-podcast:// or itms-podcasts:// (displays a "can't connect" error)
MacOS Majave needs pcast://
IOS podcast://
I believe Apple changed their recognized podcast scheme and you should now use 'feed://...'.

Skobbler (GPS Navigation) does not open at specified location

I have the following code for opening Skobbler at specified location:
- (void)openSkobblerWithLatitude:(double)latitude longitude:(double)longitude {
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:
#"hybridnavigation://cmd=mapOverview&latitude=%f&longitude=%f",
latitude,
longitude]];
[[UIApplication sharedApplication] openURL:url];
}
It opens Skobbler, but the location is completely ignored. Is there something wrong with the URL or is this simply a bug in Skobbler?
Link for downloading Skobbler:
https://itunes.apple.com/us/app/gps-navigation-sat-nav/id370144231?mt=8
EDIT: This is what the final URL looks like:
"hybridnavigation://cmd=mapOverview&latitude=49.010066&longitude=8.396355"
I contacted skobbler's support and they confirmed that this is a bug on their side:
The command line integration does not work with the current version of the app. This problem will be fixed with the upcoming update. (At the moment, I cannot tell you an exact release date.)

Open appstore via itms-apps

i'm trying to open an app in appstore from an UIAlertView When the otherButtonTitle. The problem is nothing is happening.
I've checked when the otherButton is pressed if this method is called and it is. The problem lies in the openURL i guess. the appId contain an name of an app without any whiteSpace like "youtube". How come the link is not opening? i've tried looking in other threads and this is the code that should open an app in appstore
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex: (NSInteger)buttonIndex
{
if (buttonIndex == 1)
{
NSString *appId = [[otherArray objectAtIndex:currentRow] objectForKey:#"link"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat: #"itms-apps://itunes.apple.com/app/%#?mt=8", appId]]];
}
}
You need to break it down into smaller steps and debug the steps.
First, is the didDismiss method being called.
Next, is the code inside the if statement being executed.
The easiest way to figure this out is to set a breakpoint on the code that assigns appID and then make sure your code breaks there.
After that line executes, make sure appId contains the string you expect it to.
Net, you should rewrite the last line into steps that first create the URL, THEN call openURL. Step through the code that creates the URL to make sure it is being created correctly.
You might want to copy the URL string and paste it into a browser to see if it works from there.

Opening phone application

This is most likely a very obvious answer, but I am just not seeing it. I want to open the phone application when I click a button.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://???????"]];
That line of code should do it. The problem is, depending on what happens in the app, I want it to dial a different number. I made a string variable, and I want to put it into the space with the ???
Something like:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://(myPhoneNumberString)"]];
Any ideas?
Thanks
Take a look at the NSString documentation.
Something like that will work:
[ NSURL URLWithString: [ NSString stringWithFormat: #"tel://%#", myPhoneNumberStringVar ]
String format is basically the same as in the printf C function, with the additional %# format, used to print object representations.

Add address annotation when finding route via google maps api

I'm using google maps to get directions from one place to another. Here is the code
NSString *mapAPIString = [NSString stringWithFormat:#"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f",
sourceAddress.coordiate.latitude,
sourceAddress.coordiate.longitude,
destAddress.coordiate.latitude,
destAddress.coordiate.longitude,
];
NSURL *url = [[NSURL alloc] initWithString:mapAPIString];
[[UIApplication sharedApplication] openURL:url];
The code works perfect. But both addresses are marked as 'Unknown address' in iOS Map App. Is it possible to add custom title for each address ?
iOS 6 is still under NDA, but if you have access to the docs have a look at them and you will probably find useful information for this problem.

Resources