MOBILE-3507 notifications: Support open appurl in browser/iab

main
Dani Palou 2020-09-16 11:34:23 +02:00
parent 06ce5e765c
commit 4c32239b54
1 changed files with 15 additions and 4 deletions

View File

@ -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;
}
}
}