Reputation: 1234
Is there anyway to detect if user clicks the uber button ?
// initialize uber request button
if (!_rideRequestButton) {
_rideRequestButton = [[UBSDKRideRequestButton alloc] initWithClient:self.ridesClient];
_rideRequestButton.delegate = self;
}
Upvotes: 0
Views: 149
Reputation: 1234
I found that I can add a target action to the button
[_rideRequestButton addTarget:self
action:@selector(rideRequestButtonIsTapped:)
forControlEvents:UIControlEventTouchUpInside];
- (void)rideRequestButtonIsTapped:(UBSDKRideRequestButton *)button
This approach is also recommend by uber:
https://github.com/uber/rides-ios-sdk/issues/66
Upvotes: 2
Reputation: 1252
You can listen for when the user requests a ride using the button by using callbacks:
https://developer.uber.com/docs/riders/ride-requests/tutorials/button/ios#handle-callbacks-for-rides
Upvotes: 0