[iOS] open booking.com for non-booking.com hotels

This commit is contained in:
Aleksey Belousov 2020-04-17 18:09:21 +03:00 committed by Aleksey Belousov
parent 3141f335c9
commit c5b9e51a79
4 changed files with 14 additions and 1 deletions

View file

@ -195,7 +195,7 @@ extension PlacePageInteractor: ActionBarViewControllerDelegate {
case .booking:
MWMPlacePageManagerHelper.book(placePageData)
case .bookingSearch:
MWMPlacePageManagerHelper.searchSimilar(placePageData)
MWMPlacePageManagerHelper.searchBookingHotels(placePageData)
case .bookmark:
if placePageData.bookmarkData != nil {
MWMPlacePageManagerHelper.removeBookmark(placePageData)

View file

@ -302,6 +302,13 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type)
[self.ownerViewController openFullPlaceDescriptionWithHtml:htmlString];
}
- (void)searchBookingHotels:(PlacePageData *)data {
logSponsoredEvent(data, kStatPlacePageHotelBook);
NSURL *url = [NSURL URLWithString:data.bookingSearchUrl];
NSAssert(url, @"Search url can't be nil!");
[UIApplication.sharedApplication openURL:url options:@{} completionHandler:nil];
}
- (void)openPartner:(PlacePageData *)data withStatisticLog:(NSString *)eventName proposedUrl:(NSURL *)proposedUrl
{
logSponsoredEvent(data, eventName);

View file

@ -28,6 +28,7 @@
+ (void)addBookmark:(PlacePageData *)data;
+ (void)removeBookmark:(PlacePageData *)data;
+ (void)editBookmark:(PlacePageData *)data;
+ (void)searchBookingHotels:(PlacePageData *)data;
+ (void)openPartner:(PlacePageData *)data;
+ (void)book:(PlacePageData *)data;
+ (void)share:(PlacePageData *)data;

View file

@ -30,6 +30,7 @@
- (void)addBookmark:(PlacePageData *)data;
- (void)removeBookmark:(PlacePageData *)data;
- (void)editBookmark:(PlacePageData *)data;
- (void)searchBookingHotels:(PlacePageData *)data;
- (void)openPartner:(PlacePageData *)data;
- (void)book:(PlacePageData *)data;
- (void)share:(PlacePageData *)data;
@ -129,6 +130,10 @@
[[MWMMapViewControlsManager manager].placePageManager editBookmark:data];
}
+ (void)searchBookingHotels:(PlacePageData *)data {
[[MWMMapViewControlsManager manager].placePageManager searchBookingHotels:data];
}
+ (void)openPartner:(PlacePageData *)data {
[[MWMMapViewControlsManager manager].placePageManager openPartner:data];
}