title: Deep linking from Chrome to native app
body: <p>I am working with the Uber API which uses <code>uber://?...</code> URLs to deep link into the Uber native app.  I am building a mobile website and I'm building one of these URLs <a href="https://developer.uber.com/v1/deep-linking/" rel="nofollow">as described here</a>;</p>
  
  <p>On iOS everything works fine but on Android the Uber app opens and only gets one of the parameters <code>product_id</code>.  So I think there is some issue with how I am encoding the URL and how the Android system is opening it.  Here is my JS to build the URL:</p>
  
  <pre><code>uber.createURL = function() {
  
      var params = {
          "client_id": uber.CLIENT_ID,
          "product_id": maps.product_id,
          "pickup[latitude]": maps.noSurgeMarker.getPosition().lat(),
          "pickup[longitude]": maps.noSurgeMarker.getPosition().lng(),
          "dropoff[latitude]": maps.destMarker.getPosition().lat(),
          "dropoff[longitude]": maps.destMarker.getPosition().lng(),
          "pickup[formatted_address]": $('#pickup').val(),
          "dropoff[formatted_address]": $('#destination').val()
      };
  
      var url = 'uber://?action=setPickup';
  
      for (var key in params) {
          if (params.hasOwnProperty(key)) {
              url += ('&amp;' + key + '=' + encodeURIComponent(params[key]));
          }
      }
  
      return url;
  };
  </code></pre>
  
  <p>I am then calling the following code to open the link:</p>
  
  <pre><code>var url = uber.createURL();
  window.location.href = url;
  </code></pre>
  
  <p>Am I missing something obvious?  Again, this works on iOS but not on Android.  Also the strange thing is if I generate the URL using <code>createURL</code> on a computer, send it over to my Android device using PushBullet, opening it works perfectly.  But if I get the URL through Chrome for Android the Uber app opens and only has <code>product_id</code> correct, not any of the pickup or dropoff parts.</p>
  
  <p>Note: I already trued using jQuery's <code>params</code> function but that didn't work any better, which is why I went to the manual <code>for (var key in params) {...}</code> loop.</p>