@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.
24 lines (23 loc) • 1.4 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FIREBASE_MESSAGING_POD = void 0;
var config_plugins_1 = require("@expo/config-plugins");
var constants_1 = require("../constants");
exports.FIREBASE_MESSAGING_POD = "\n\ntarget '".concat(constants_1.EXTENSION_NAME, "' do\n pod 'Firebase/Messaging'\n use_frameworks! :linkage => :static\nend\n\n");
/**
* 1. Add Firebase/Messaging pod to target extension because it process push notifications independently of the main app
* 2. Add GoogleUtilities pod to all targets in the Podfile, ensuring compatibility with Firebase iOS SDKs.
* To fix build error [Multiple commands produce GoogleUtilities]
* ref: https://github.com/invertase/firestore-ios-sdk-frameworks/issues/72#issuecomment-1721456885
*/
var withFirebaseMessagingPod = function (config) {
return (0, config_plugins_1.withPodfile)(config, function (podConfig) {
var contents = podConfig.modResults.contents + exports.FIREBASE_MESSAGING_POD;
// finds every 'target ${targetName} do' line in the Podfile, and add pod 'GoogleUtilities' right after it.
var targetRegex = /(target\s+'[^']+'\s+do\s*?\n)/g;
contents = contents.replace(targetRegex, "$1 pod 'GoogleUtilities'\n");
podConfig.modResults.contents = contents;
return podConfig;
});
};
exports.default = withFirebaseMessagingPod;