Uber上的移动Web按钮文档

时间:2016-09-15 03:49:14

标签: uber-api

我注意到iOS和Android有关于如何在超级网站上设置骑行参数但不适用于移动网络的文档。在这种情况下如何设置骑行参数?

1 个答案:

答案 0 :(得分:2)

移动网页上的按钮实际上只是一个链接。所以你会做这样的事情:

<a href="uber://?client_id=YOUR_CLIENT_ID&action=setPickup&pickup[latitude]=37.775818&pickup[longitude]=-122.418028&pickup[nickname]=UberHQ&pickup[formatted_address]=1455%20Market%20St%2C%20San%20Francisco%2C%20CA%2094103&dropoff[latitude]=37.802374&dropoff[longitude]=-122.405818&dropoff[nickname]=Coit%20Tower&dropoff[formatted_address]=1%20Telegraph%20Hill%20Blvd%2C%20San%20Francisco%2C%20CA%2094133&product_id=a1111c8c-c720-46c3-8534-2fcdd730040d">
    Get an Uber!
</a>

在该示例中,它使用标准深层链接,因此如果您的用户设备上未安装该应用,则无法使用该链接。如果您对此感到担心,可以使用通用链接:

<a href="https://m.uber.com/ul/?client_id=YOUR_CLIENT_ID&action=setPickup&pickup[latitude]=37.775818&pickup[longitude]=-122.418028&pickup[nickname]=UberHQ&pickup[formatted_address]=1455%20Market%20St%2C%20San%20Francisco%2C%20CA%2094103&dropoff[latitude]=37.802374&dropoff[longitude]=-122.405818&dropoff[nickname]=Coit%20Tower&dropoff[formatted_address]=1%20Telegraph%20Hill%20Blvd%2C%20San%20Francisco%2C%20CA%2094133&product_id=a1111c8c-c720-46c3-8534-2fcdd730040d">
    Get an Uber!
</a>

如果您愿意,也可以使用<button>标记。这是以下文档:https://developer.uber.com/docs/rides/deep-linking-action-setpickup

您可以直接将其粘贴到移动浏览器中以查看其实际效果!

uber://?client_id=YOUR_CLIENT_ID&action=setPickup&pickup[latitude]=37.775818&pickup[longitude]=-122.418028&pickup[nickname]=AwesomePickup&pickup[formatted_address]=1455%20Market%20St%2C%20San%20Francisco%2C%20CA%2094103&dropoff[latitude]=37.802374&dropoff[longitude]=-122.405818&dropoff[nickname]=AwesomeDropoff&dropoff[formatted_address]=1%20Telegraph%20Hill%20Blvd%2C%20San%20Francisco%2C%20CA%2094133&product_id=a1111c8c-c720-46c3-8534-2fcdd730040d