我们可以使用iOS优步套件预订优步驾驶室吗?

时间:2015-11-19 13:47:12

标签: ios objective-c uber-api

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

https://github.com/sachinkesiraju/UberKit

使用这个套件,我得到优步类型,价格,容量等。但我有疑问,我们可以通过使用上面的Uberkit从我的iOS应用程序预订优步出租车吗?

1 个答案:

答案 0 :(得分:2)

参数类型

[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]]];
}