Reputation: 1218
What I mean is that I have well received the Uber 409 conflict surge error JSON response:
{
"meta": {
"surge_confirmation": {
"href": "https:\/\/api.uber.com\/v1\/surge-confirmations\/e100a670",
"surge_confirmation_id": "e100a670"
}
},
"errors":[
{
"status": 409,
"code": "surge",
"title": "Surge pricing is currently in effect for this product."
}
]
}
So what I should do is that present the HTML5 page with the following url, right?
"href": "https:\/\/api.uber.com\/v1\/surge-confirmations\/e100a670"
And here comes my two questions:
I would like to present the page in my iOS UIWebView, but I don't know what to do to close the webview if user clicked I ACCEPT HIGHER FEE
button of the HTML5 page since I don't know how to leverage the surge confirmation redirect url;
When loading the url in my OSX chrome, clicked the button and it redirected to next page; when loading the url in an UIWebView, clicking the button didn't trigger anything.
Many thanks.
Upvotes: 2
Views: 468
Reputation: 1218
So basically, I figured that the surge confirmation id is added as a query param in the redirect url. So what you need to do is capture the redirect url (if you didn't register any, then you cannot capture the confirmation id string) and resolve it out.
Also I think if you don't register any redirect url, Uber would consider user has denied the surge price either the button was clicked or not. So if you wanna enable the surge confirmation you have to register one redirect url.
And the reason nothing happened after I clicked the button is that I didn't register a redirect url for the surge confirmation so it didn't jump anywhere else.
Upvotes: 2