Uber deeplink and universal url crashes android application

余生长醉 提交于 2019-11-26 22:10:50

问题


I am experiencing problem on Android with opening of Uber deeplink and universal url, uber hangs to a white screen and returns to calling activity on back presses.

I have tried: Method 1:

SessionConfiguration config = new SessionConfiguration.Builder()
                .setClientId(<client-id>)
                .setClientSecret(<client-secret>)
                .setServerToken(<server-token>)
                .build();

        Location location = Singleton.getInstance(context).getOneTimeLocation().getLocation();
        RideParameters rideParams = new RideParameters.Builder()
                .setPickupLocation(location.getLatitude(), location.getLongitude(), "Your", "Your")
                .setDropoffLocation(latitude, longitude, address, "")
                .build();

        RideRequestDeeplink deeplink = new RideRequestDeeplink.Builder(context)
                .setSessionConfiguration(config)
                .setFallback(Deeplink.Fallback.MOBILE_WEB)
                .setRideParameters(rideParams)
                .build();

       // deeplink.execute();

        try {
            Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setData(deeplink.getUri());
            ((BaseActivity) context).startActivity(intent, null, false);
        } catch (Exception e) {

        }

Note: In Method 1, I tried both deeplink.execute() and opening intent with ACTION_VIEW to redirect to browser.

Method 2:

    String baseUrl = "https://m.uber.com/ul/?action=setPickup&";
    StringBuilder stringBuilder = new StringBuilder();
    stringBuilder.append(baseUrl); 
    stringBuilder.append("client_id=").append(<client-id>).append("&");
stringBuilder.append("pickup[latitude]=").append(location.getLatitude()).append("&"); 
    stringBuilder.append("pickup[longitude]=").append(location.getLongitude()).append("&"); 
    stringBuilder.append("dropoff[latitude]=").append(latitude).append("&"); stringBuilder.append("dropoff[longitude]=").append(longitude).append("&"); 
    stringBuilder.append("dropoff[formatted_address]=").append(address); 
    //Opened this url in browser ending in same result

Both the methods had same result, Uber app hangs with white screen.

In Method 2, it provides me with Open link with chrome or uber, if i choose Just Once it opens correctly but if it choose Always option it keeps redirecting me to hang Uber. If i resume this uber in hang state i.e. press home and reselect uber from running application it opens up with supplied data

来源:https://stackoverflow.com/questions/50282763/uber-deeplink-and-universal-url-crashes-android-application

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!