[notifications] temp fix for #1393, #1445 & #1481 - cc @ryanggrey for later review in follow up PR

This commit is contained in:
Salakar
2018-09-18 14:20:52 +01:00
parent 84c860dd7d
commit 7ef3f951f1

View File

@@ -56,18 +56,20 @@ export default class IOSNotification {
this._threadIdentifier = data.threadIdentifier;
}
const complete = (fetchResult: BackgroundFetchResultValue) => {
const { notificationId } = notification;
getLogger(notifications).debug(
`Completion handler called for notificationId=${notificationId}`
);
getNativeModule(notifications).complete(notificationId, fetchResult);
};
if (notifications && notifications.ios) {
const complete = (fetchResult: BackgroundFetchResultValue) => {
const { notificationId } = notification;
getLogger(notifications).debug(
`Completion handler called for notificationId=${notificationId}`
);
getNativeModule(notifications).complete(notificationId, fetchResult);
};
if (notifications.ios.shouldAutoComplete) {
complete(notifications.ios.backgroundFetchResult.noData);
} else {
this._complete = complete;
if (notifications.ios.shouldAutoComplete) {
complete(notifications.ios.backgroundFetchResult.noData);
} else {
this._complete = complete;
}
}
// Defaults