MOBILE-3039 push: Fix crash when push received in foreground in iOS
parent
f4cd6f37b0
commit
8d450d324f
|
@ -419,6 +419,7 @@ export class CorePushNotificationsProvider {
|
||||||
channel: 'PushPluginChannel'
|
channel: 'PushPluginChannel'
|
||||||
},
|
},
|
||||||
promises = [],
|
promises = [],
|
||||||
|
isAndroid = this.platform.is('android'),
|
||||||
extraFeatures = this.utils.isTrueOrOne(data.extrafeatures);
|
extraFeatures = this.utils.isTrueOrOne(data.extrafeatures);
|
||||||
|
|
||||||
// Apply formatText to title and message.
|
// Apply formatText to title and message.
|
||||||
|
@ -432,7 +433,7 @@ export class CorePushNotificationsProvider {
|
||||||
// Error formatting, use the original message.
|
// Error formatting, use the original message.
|
||||||
return notification.message;
|
return notification.message;
|
||||||
}).then((formattedMessage) => {
|
}).then((formattedMessage) => {
|
||||||
if (extraFeatures && this.utils.isFalseOrZero(data.notif)) {
|
if (extraFeatures && isAndroid && this.utils.isFalseOrZero(data.notif)) {
|
||||||
// It's a message, use messaging style. Ionic Native doesn't specify this option.
|
// It's a message, use messaging style. Ionic Native doesn't specify this option.
|
||||||
(<any> localNotif).text = [
|
(<any> localNotif).text = [
|
||||||
{
|
{
|
||||||
|
@ -445,7 +446,7 @@ export class CorePushNotificationsProvider {
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (extraFeatures) {
|
if (extraFeatures && isAndroid) {
|
||||||
// Use a different icon if needed.
|
// Use a different icon if needed.
|
||||||
localNotif.icon = notification.image;
|
localNotif.icon = notification.image;
|
||||||
// This feature isn't supported by the official plugin, we use a fork.
|
// This feature isn't supported by the official plugin, we use a fork.
|
||||||
|
|
Loading…
Reference in New Issue