3

I am implementing the RideRequestButton to open up the UBER activity to request cabs which is provided by the UBER SDK. After selecting the source and destination when I click the "request uberx" button it shows "requesting" but nothing happens after that.

The sample code works fine but the same code is not working in my app. I have set the CLIENT_ID,REDIRECT_URI and SERVER_TOKEN and also given the location permission in Mainfest. I also have the FULL ACCESS permission from UBER.

Here is my code snippet

    configuration = new SessionConfiguration.Builder()
            .setRedirectUri(REDIRECT_URI)
            .setClientId(CLIENT_ID)
            .setServerToken(SERVER_TOKEN)
            .build();
    validateConfiguration(configuration);

    ServerTokenSession session = new ServerTokenSession(configuration);

    RideParameters rideParametersForProduct = new RideParameters.Builder()
            .setProductId(UBERX_PRODUCT_ID)
            .setPickupLocation(PICKUP_LAT, PICKUP_LONG, PICKUP_NICK, PICKUP_ADDR)
            .setDropoffLocation(DROPOFF_LAT, DROPOFF_LONG, DROPOFF_NICK, DROPOFF_ADDR)
            .build();

    RideRequestButton uberButtonWhite = new RideRequestButton(context);
    RideRequestActivityBehavior rideRequestActivityBehavior = new RideRequestActivityBehavior((Activity)context,
            WIDGET_REQUEST_CODE, configuration);
    uberButtonWhite.setRequestBehavior(rideRequestActivityBehavior);
    uberButtonWhite.setRideParameters(rideParametersForProduct);
    uberButtonWhite.setSession(session);
    uberButtonWhite.loadRideInformation();

    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setView(uberButtonWhite);
    builder.show();

Is there something else that I need to do to make it work?

Snapshot

Sourav301
  • 1,259
  • 1
  • 14
  • 24
  • Do you get any error messages? Did you try debugging the code? – Alexander Graebe Aug 02 '16 at 17:50
  • Did this have you sign in prior to taking you to the request screen? – Ty Smith Aug 02 '16 at 18:17
  • @agraebe there is no error message on the log cat. I cant debug it as it is the activity inside the uber SDK which is protected. – Sourav301 Aug 03 '16 at 05:30
  • @tsmith yes there is a sign in the beginning which authorizes the app to uber granting permissions to use uber. All these are handled by the uber SDK. – Sourav301 Aug 03 '16 at 05:32
  • 1
    Can you double check that you are not using the Sandbox environment. This would have that behavior, since no drivers are available to pickup. Try setting the environment of the session explicitly to Production. – Ty Smith Aug 04 '16 at 00:10
  • @tsmith It worked. I explicitly set to Production and it worked.! – Sourav301 Aug 12 '16 at 12:48

1 Answers1

0

I am answering my own question. The hint by @tsmith worked for me. The environment has to be explicitly set to Production. Keeping it sandbox or blank would make the application freeze at "requesting".

Sourav301
  • 1,259
  • 1
  • 14
  • 24
  • Is your app live?. I mean does uber have given you full access? I have tried exactly this way but my app still shows "requesting". I am yet to get approval from Uber for full access – Nidhin Rejoice Aug 26 '16 at 13:59