深层链接:昵称字段导致 Uber App 崩溃
Deeplinking: nickname field crashing Uber App
我正在尝试将我的应用程序与优步应用程序进行深度链接。这是我用作测试的代码:
String uri = "uber://?action=setPickup&pickup=my_location&dropoff[latitude]=-23.56491&dropoff[longitude]=-46.652005&dropoff[formatted_address]=Av Paulista, 1000 - Bela Vista&dropoff[nickname]=Meeting: Av Paulista, 1000 - Bela Vista";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(uri));
startActivity(intent);
问题是 "dropoff[nickname]=Meeting: Av Paulista, 1000 - Bela Vista" 中的“:”使优步应用程序崩溃(应用程序打开,优步加载屏幕出现一段时间,然后应用程序崩溃)。如果我删除“:”,它会顺利运行。
我能做些什么吗?
谢谢!
:
是 URI 方案中的保留字符,可能需要进行 %
编码(即 %3A
)。
(你的URI中还有其他保留字符,比如[
和]
,但可能是Uber应用对:
敏感,不知何故。我不相信你真的应该对 :
进行编码,因为它不能在它所在的位置充当分隔符,但值得一试。
请参阅 RFC 3986 section on percent encoding 和附近有关保留字符的部分。
我正在尝试将我的应用程序与优步应用程序进行深度链接。这是我用作测试的代码:
String uri = "uber://?action=setPickup&pickup=my_location&dropoff[latitude]=-23.56491&dropoff[longitude]=-46.652005&dropoff[formatted_address]=Av Paulista, 1000 - Bela Vista&dropoff[nickname]=Meeting: Av Paulista, 1000 - Bela Vista";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(uri));
startActivity(intent);
问题是 "dropoff[nickname]=Meeting: Av Paulista, 1000 - Bela Vista" 中的“:”使优步应用程序崩溃(应用程序打开,优步加载屏幕出现一段时间,然后应用程序崩溃)。如果我删除“:”,它会顺利运行。
我能做些什么吗?
谢谢!
:
是 URI 方案中的保留字符,可能需要进行 %
编码(即 %3A
)。
(你的URI中还有其他保留字符,比如[
和]
,但可能是Uber应用对:
敏感,不知何故。我不相信你真的应该对 :
进行编码,因为它不能在它所在的位置充当分隔符,但值得一试。
请参阅 RFC 3986 section on percent encoding 和附近有关保留字符的部分。