expo-linkrunner
Version:
Expo config plugin for rn-linkrunner SDK
40 lines • 2.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.withConfiguration_iOS = void 0;
const config_plugins_1 = require("@expo/config-plugins");
const withConfiguration_iOS = (expoConfig, configuration) => {
if (configuration === null || configuration === void 0 ? void 0 : configuration.debug) {
console.log('ExpoLinkrunner: Applying iOS configuration');
}
const userTrackingMessage = (configuration === null || configuration === void 0 ? void 0 : configuration.userTrackingPermission) ||
"This identifier will be used to deliver personalized ads to you.";
expoConfig = (0, config_plugins_1.withInfoPlist)(expoConfig, expoConfig => {
// Add tracking description from configuration or default only when disable idfa is false
if (!expoConfig.modResults.NSUserTrackingUsageDescription && !(configuration === null || configuration === void 0 ? void 0 : configuration.disableIdfa)) {
expoConfig.modResults.NSUserTrackingUsageDescription = userTrackingMessage;
}
// Add SKAN configuration
if (!expoConfig.modResults.NSAdvertisingAttributionReportEndpoint) {
expoConfig.modResults.NSAdvertisingAttributionReportEndpoint = 'https://linkrunner-skan.com';
}
if (!expoConfig.modResults.AttributionCopyEndpoint) {
expoConfig.modResults.AttributionCopyEndpoint = 'https://linkrunner-skan.com';
}
return expoConfig;
});
// // add the plugin only if disableIdfa is false
// if(!configuration?.disableIdfa){
// // Automatically apply expo-tracking-transparency plugin
// expoConfig = withPlugins(expoConfig, [
// [
// 'expo-tracking-transparency',
// {
// userTrackingPermission: userTrackingMessage,
// }
// ]
// ])
// }
return expoConfig;
};
exports.withConfiguration_iOS = withConfiguration_iOS;
//# sourceMappingURL=with_configuration_ios.js.map