我已经从下面的github链接下载了Uberkit。

https://github.com/sachinkesiraju/UberKit

有了这个工具包,我会得到Uber的类型,价格,容量等信息。但是我有一个疑问,例如我们可以通过使用上述Uberkit从我的iOS应用程序预订Uber出租车吗?

最佳答案

参数类型

[latitude floatValue]->您当前的谷歌纵横

[经度floatValue]->您当前的经度

纬度->您的DropPlace纬度

经度->您的DropPlace经度

[self.lblSubTitle.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] --> drop address

//manodary

[[getHuberDetails objectAtIndex:indexPath.row]objectForKey:@"productID"]] --> Uber Type Booking ID


NSString *getUberDetails=[NSString stringWithFormat:@"client_id=PassyourUberID&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],latitud,longitud,[self.lblSubTitle.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],[[getHuberDetails 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]]];
}

09-25 17:32