Uber deeplink and universal url crashes android ap

2019-01-15 22:41发布

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

标签: uber-api
0条回答
登录 后发表回答