From 4c32239b54cc08eb2fe100c282fde0a6d25bf715 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 16 Sep 2020 11:34:23 +0200 Subject: [PATCH] MOBILE-3507 notifications: Support open appurl in browser/iab --- .../providers/push-click-handler.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/addon/notifications/providers/push-click-handler.ts b/src/addon/notifications/providers/push-click-handler.ts index 4797819ae..b6504debd 100644 --- a/src/addon/notifications/providers/push-click-handler.ts +++ b/src/addon/notifications/providers/push-click-handler.ts @@ -71,11 +71,22 @@ export class AddonNotificationsPushClickHandler implements CorePushNotifications }); } - // Try to handle the appurl first. + // Try to handle the appurl. if (notification.customdata && notification.customdata.appurl) { - if (this.linkHelper.handleLink(notification.customdata.appurl, undefined, undefined, true)) { - // Link treated, stop. - return; + switch (notification.customdata.appurlopenin) { + case 'inappbrowser': + this.utils.openInApp(notification.customdata.appurl); + + return; + + case 'browser': + return this.utils.openInBrowser(notification.customdata.appurl); + + default: + if (this.linkHelper.handleLink(notification.customdata.appurl, undefined, undefined, true)) { + // Link treated, stop. + return; + } } }