@lazidog/expo-notification-extension
Version:
| [with FCM compatibility] The Expo Notification Service Extension plugin allows you to add a Notification Service Extension file while staying in the managed workflow.
23 lines (22 loc) • 962 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var config_plugins_1 = require("@expo/config-plugins");
/**
* Add remote notification permission in Background Modes capability
*/
var withRemoteNotificationsPermissions = function (config) {
var BACKGROUND_MODE_KEYS = ["remote-notification"];
return (0, config_plugins_1.withInfoPlist)(config, function (newConfig) {
if (!Array.isArray(newConfig.modResults.UIBackgroundModes)) {
newConfig.modResults.UIBackgroundModes = [];
}
for (var _i = 0, BACKGROUND_MODE_KEYS_1 = BACKGROUND_MODE_KEYS; _i < BACKGROUND_MODE_KEYS_1.length; _i++) {
var key = BACKGROUND_MODE_KEYS_1[_i];
if (!newConfig.modResults.UIBackgroundModes.includes(key)) {
newConfig.modResults.UIBackgroundModes.push(key);
}
}
return newConfig;
});
};
exports.default = withRemoteNotificationsPermissions;