здесь добавить некоторые образцы для Uber
настроить себя, причина, мы не знаем, что ваш urlScheme
содержит
, например
Swift
func share(urlScheme: String)
{
if (UIApplication.sharedApplication().canOpenURL(NSURL(string:"uber://")!))
{
// if your app is available it open the app
UIApplication.sharedApplication().openURL(NSURL(string: string:"uber://?openapp")!)
}
else
{
open web version somehow
// it redirect to safari, safari directly open the web page on uber application, it does not redirect to app store
UIApplication.sharedApplication().openURL(NSURL(string: string:"http://m.uber.com/?opneapp")!)
}
}
Objective-C
NSString *getUberDetails=[NSString stringWithFormat:@"client_id=vbtCwkGyqvDupQhpCcgCMo4VE-gIRw42&action=setPickup&pickup[latitude]=%f&pickup[longitude]=%f&pickup[nickname]=OuttAPP&dropoff[latitude]=%f&dropoff[longitude]=%f&dropoff[nickname]=%@&product_id=%@",[latitude floatValue],[longitude floatValue],[droplatitude floatValue],[dropLongtitude floatValue],[dropAddress stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],[[huberTableArr objectAtIndex:indexPath.row]objectForKey:@"productID"]];
if ([[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"uber://"]])
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"uber://?%@",getUberDetails]]];
}
else
{
[[UIApplication sharedApplication] openURL: [NSURL URLWithString:[NSString stringWithFormat:@"http://m.uber.com/?%@",getUberDetails]]];
}
}
Вы имеете в виду пользователь направит на страницу установки приложения в ITunes от того, где они могут загрузить это приложение? –
Нет, к веб-приложению в Safari – Luda