@expo/config-plugins 4.0.2 → 4.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/build/Plugin.types.d.ts +4 -0
- package/build/Plugin.types.js.map +1 -1
- package/build/android/Updates.d.ts +10 -10
- package/build/android/Updates.js.map +1 -1
- package/build/android/codeMod.d.ts +20 -0
- package/build/android/codeMod.js +109 -0
- package/build/android/codeMod.js.map +1 -0
- package/build/android/index.d.ts +2 -6
- package/build/android/index.js +1 -86
- package/build/android/index.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +8 -0
- package/build/index.js.map +1 -1
- package/build/ios/Bitcode.d.ts +33 -0
- package/build/ios/Bitcode.js +131 -0
- package/build/ios/Bitcode.js.map +1 -0
- package/build/ios/Maps.js +1 -0
- package/build/ios/Maps.js.map +1 -1
- package/build/ios/Paths.d.ts +1 -0
- package/build/ios/Paths.js +25 -0
- package/build/ios/Paths.js.map +1 -1
- package/build/ios/Updates.d.ts +10 -10
- package/build/ios/Updates.js.map +1 -1
- package/build/ios/codeMod.d.ts +81 -0
- package/build/ios/codeMod.js +306 -0
- package/build/ios/codeMod.js.map +1 -0
- package/build/ios/index.d.ts +3 -5
- package/build/ios/index.js +6 -57
- package/build/ios/index.js.map +1 -1
- package/build/plugins/android-plugins.d.ts +7 -0
- package/build/plugins/android-plugins.js +19 -2
- package/build/plugins/android-plugins.js.map +1 -1
- package/build/plugins/ios-plugins.d.ts +6 -6
- package/build/plugins/ios-plugins.js.map +1 -1
- package/build/plugins/withAndroidBaseMods.d.ts +2 -0
- package/build/plugins/withAndroidBaseMods.js +32 -0
- package/build/plugins/withAndroidBaseMods.js.map +1 -1
- package/build/plugins/withStaticPlugin.js +16 -5
- package/build/plugins/withStaticPlugin.js.map +1 -1
- package/build/utils/Updates.d.ts +5 -4
- package/build/utils/Updates.js +1 -1
- package/build/utils/Updates.js.map +1 -1
- package/build/utils/commonCodeMod.d.ts +32 -0
- package/build/utils/commonCodeMod.js +71 -0
- package/build/utils/commonCodeMod.js.map +1 -0
- package/build/utils/matchBrackets.d.ts +7 -0
- package/build/utils/matchBrackets.js +80 -0
- package/build/utils/matchBrackets.js.map +1 -0
- package/package.json +3 -3
- package/build/android/Branch.d.ts +0 -5
- package/build/android/Branch.js +0 -54
- package/build/android/Branch.js.map +0 -1
- package/build/android/Facebook.d.ts +0 -13
- package/build/android/Facebook.js +0 -236
- package/build/android/Facebook.js.map +0 -1
- package/build/android/NavigationBar.d.ts +0 -9
- package/build/android/NavigationBar.js +0 -141
- package/build/android/NavigationBar.js.map +0 -1
- package/build/android/RootViewBackgroundColor.d.ts +0 -6
- package/build/android/RootViewBackgroundColor.js +0 -81
- package/build/android/RootViewBackgroundColor.js.map +0 -1
- package/build/android/UserInterfaceStyle.d.ts +0 -11
- package/build/android/UserInterfaceStyle.js +0 -125
- package/build/android/UserInterfaceStyle.js.map +0 -1
- package/build/ios/Branch.d.ts +0 -5
- package/build/ios/Branch.js +0 -42
- package/build/ios/Branch.js.map +0 -1
- package/build/ios/Facebook.d.ts +0 -176
- package/build/ios/Facebook.js +0 -232
- package/build/ios/Facebook.js.map +0 -1
- package/build/ios/RootViewBackgroundColor.d.ts +0 -6
- package/build/ios/RootViewBackgroundColor.js +0 -70
- package/build/ios/RootViewBackgroundColor.js.map +0 -1
- package/build/ios/UserInterfaceStyle.d.ts +0 -5
- package/build/ios/UserInterfaceStyle.js +0 -59
- package/build/ios/UserInterfaceStyle.js.map +0 -1
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getUserInterfaceStyle = getUserInterfaceStyle;
|
|
7
|
-
exports.setUiModeAndroidManifest = setUiModeAndroidManifest;
|
|
8
|
-
exports.addOnConfigurationChangedMainActivity = addOnConfigurationChangedMainActivity;
|
|
9
|
-
exports.addJavaImports = addJavaImports;
|
|
10
|
-
exports.withUiModeMainActivity = exports.withUiModeManifest = exports.ON_CONFIGURATION_CHANGED = exports.CONFIG_CHANGES_ATTRIBUTE = void 0;
|
|
11
|
-
|
|
12
|
-
function _androidPlugins() {
|
|
13
|
-
const data = require("../plugins/android-plugins");
|
|
14
|
-
|
|
15
|
-
_androidPlugins = function () {
|
|
16
|
-
return data;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function _warnings() {
|
|
23
|
-
const data = require("../utils/warnings");
|
|
24
|
-
|
|
25
|
-
_warnings = function () {
|
|
26
|
-
return data;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
return data;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function _Manifest() {
|
|
33
|
-
const data = require("./Manifest");
|
|
34
|
-
|
|
35
|
-
_Manifest = function () {
|
|
36
|
-
return data;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return data;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const CONFIG_CHANGES_ATTRIBUTE = 'android:configChanges';
|
|
43
|
-
exports.CONFIG_CHANGES_ATTRIBUTE = CONFIG_CHANGES_ATTRIBUTE;
|
|
44
|
-
const ON_CONFIGURATION_CHANGED = `
|
|
45
|
-
public class MainActivity extends ReactActivity {
|
|
46
|
-
|
|
47
|
-
// Added automatically by Expo Config
|
|
48
|
-
@Override
|
|
49
|
-
public void onConfigurationChanged(Configuration newConfig) {
|
|
50
|
-
super.onConfigurationChanged(newConfig);
|
|
51
|
-
Intent intent = new Intent("onConfigurationChanged");
|
|
52
|
-
intent.putExtra("newConfig", newConfig);
|
|
53
|
-
sendBroadcast(intent);
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
exports.ON_CONFIGURATION_CHANGED = ON_CONFIGURATION_CHANGED;
|
|
57
|
-
const withUiModeManifest = (0, _androidPlugins().createAndroidManifestPlugin)(setUiModeAndroidManifest, 'withUiModeManifest');
|
|
58
|
-
exports.withUiModeManifest = withUiModeManifest;
|
|
59
|
-
|
|
60
|
-
const withUiModeMainActivity = config => {
|
|
61
|
-
return (0, _androidPlugins().withMainActivity)(config, config => {
|
|
62
|
-
if (config.modResults.language === 'java') {
|
|
63
|
-
config.modResults.contents = addOnConfigurationChangedMainActivity(config, config.modResults.contents);
|
|
64
|
-
} else {
|
|
65
|
-
(0, _warnings().addWarningAndroid)('android.userInterfaceStyle', `Cannot automatically configure MainActivity if it's not java`);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return config;
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
exports.withUiModeMainActivity = withUiModeMainActivity;
|
|
73
|
-
|
|
74
|
-
function getUserInterfaceStyle(config) {
|
|
75
|
-
var _ref, _config$android$userI, _config$android;
|
|
76
|
-
|
|
77
|
-
return (_ref = (_config$android$userI = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.userInterfaceStyle) !== null && _config$android$userI !== void 0 ? _config$android$userI : config.userInterfaceStyle) !== null && _ref !== void 0 ? _ref : 'light';
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function setUiModeAndroidManifest(config, androidManifest) {
|
|
81
|
-
const userInterfaceStyle = getUserInterfaceStyle(config); // TODO: Remove this if we decide to remove any uiMode configuration when not specified
|
|
82
|
-
|
|
83
|
-
if (!userInterfaceStyle) {
|
|
84
|
-
return androidManifest;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const mainActivity = (0, _Manifest().getMainActivityOrThrow)(androidManifest);
|
|
88
|
-
mainActivity.$[CONFIG_CHANGES_ATTRIBUTE] = 'keyboard|keyboardHidden|orientation|screenSize|uiMode';
|
|
89
|
-
return androidManifest;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function addOnConfigurationChangedMainActivity(config, mainActivity) {
|
|
93
|
-
var _mainActivity$match;
|
|
94
|
-
|
|
95
|
-
const userInterfaceStyle = getUserInterfaceStyle(config);
|
|
96
|
-
|
|
97
|
-
if (!userInterfaceStyle) {
|
|
98
|
-
return mainActivity;
|
|
99
|
-
} // Cruzan: this is not ideal, but I'm not sure of a better way to handle writing to MainActivity.java
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if ((_mainActivity$match = mainActivity.match(`onConfigurationChanged`)) !== null && _mainActivity$match !== void 0 && _mainActivity$match.length) {
|
|
103
|
-
return mainActivity;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const MainActivityWithImports = addJavaImports(mainActivity, ['android.content.Intent', 'android.content.res.Configuration'], true);
|
|
107
|
-
const pattern = new RegExp(`public class MainActivity extends ReactActivity {`);
|
|
108
|
-
return MainActivityWithImports.replace(pattern, ON_CONFIGURATION_CHANGED);
|
|
109
|
-
} // TODO: we should have a generic utility for doing this
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
function addJavaImports(javaSource, javaImports, isJava) {
|
|
113
|
-
const lines = javaSource.split('\n');
|
|
114
|
-
const lineIndexWithPackageDeclaration = lines.findIndex(line => line.match(/^package .*;?$/));
|
|
115
|
-
|
|
116
|
-
for (const javaImport of javaImports) {
|
|
117
|
-
if (!javaSource.includes(javaImport)) {
|
|
118
|
-
const importStatement = `import ${javaImport}${isJava ? ';' : ''}`;
|
|
119
|
-
lines.splice(lineIndexWithPackageDeclaration + 1, 0, importStatement);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return lines.join('\n');
|
|
124
|
-
}
|
|
125
|
-
//# sourceMappingURL=UserInterfaceStyle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/android/UserInterfaceStyle.ts"],"names":["CONFIG_CHANGES_ATTRIBUTE","ON_CONFIGURATION_CHANGED","withUiModeManifest","setUiModeAndroidManifest","withUiModeMainActivity","config","modResults","language","contents","addOnConfigurationChangedMainActivity","getUserInterfaceStyle","android","userInterfaceStyle","androidManifest","mainActivity","$","match","length","MainActivityWithImports","addJavaImports","pattern","RegExp","replace","javaSource","javaImports","isJava","lines","split","lineIndexWithPackageDeclaration","findIndex","line","javaImport","includes","importStatement","splice","join"],"mappings":";;;;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,wBAAwB,GAAG,uBAAjC;;AAEA,MAAMC,wBAAwB,GAAI;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAXO;;AAaA,MAAMC,kBAAkB,GAAG,mDAChCC,wBADgC,EAEhC,oBAFgC,CAA3B;;;AAKA,MAAMC,sBAAoC,GAAGC,MAAM,IAAI;AAC5D,SAAO,wCAAiBA,MAAjB,EAAyBA,MAAM,IAAI;AACxC,QAAIA,MAAM,CAACC,UAAP,CAAkBC,QAAlB,KAA+B,MAAnC,EAA2C;AACzCF,MAAAA,MAAM,CAACC,UAAP,CAAkBE,QAAlB,GAA6BC,qCAAqC,CAChEJ,MADgE,EAEhEA,MAAM,CAACC,UAAP,CAAkBE,QAF8C,CAAlE;AAID,KALD,MAKO;AACL,yCACE,4BADF,EAEG,8DAFH;AAID;;AACD,WAAOH,MAAP;AACD,GAbM,CAAP;AAcD,CAfM;;;;AAiBA,SAASK,qBAAT,CACLL,MADK,EAEG;AAAA;;AACR,6DAAOA,MAAM,CAACM,OAAd,oDAAO,gBAAgBC,kBAAvB,yEAA6CP,MAAM,CAACO,kBAApD,uCAA0E,OAA1E;AACD;;AAEM,SAAST,wBAAT,CACLE,MADK,EAELQ,eAFK,EAGL;AACA,QAAMD,kBAAkB,GAAGF,qBAAqB,CAACL,MAAD,CAAhD,CADA,CAEA;;AACA,MAAI,CAACO,kBAAL,EAAyB;AACvB,WAAOC,eAAP;AACD;;AAED,QAAMC,YAAY,GAAG,wCAAuBD,eAAvB,CAArB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ACD","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { createAndroidManifestPlugin, withMainActivity } from '../plugins/android-plugins';\nimport { addWarningAndroid } from '../utils/warnings';\nimport { AndroidManifest, getMainActivityOrThrow } from './Manifest';\n\nexport const CONFIG_CHANGES_ATTRIBUTE = 'android:configChanges';\n\nexport const ON_CONFIGURATION_CHANGED = `\npublic class MainActivity extends ReactActivity {\n\n // Added automatically by Expo Config\n @Override\n public void onConfigurationChanged(Configuration newConfig) {\n super.onConfigurationChanged(newConfig);\n Intent intent = new Intent(\"onConfigurationChanged\");\n intent.putExtra(\"newConfig\", newConfig);\n sendBroadcast(intent);\n }\n`;\n\nexport const withUiModeManifest = createAndroidManifestPlugin(\n setUiModeAndroidManifest,\n 'withUiModeManifest'\n);\n\nexport const withUiModeMainActivity: ConfigPlugin = config => {\n return withMainActivity(config, config => {\n if (config.modResults.language === 'java') {\n config.modResults.contents = addOnConfigurationChangedMainActivity(\n config,\n config.modResults.contents\n );\n } else {\n addWarningAndroid(\n 'android.userInterfaceStyle',\n `Cannot automatically configure MainActivity if it's not java`\n );\n }\n return config;\n });\n};\n\nexport function getUserInterfaceStyle(\n config: Pick<ExpoConfig, 'android' | 'userInterfaceStyle'>\n): string {\n return config.android?.userInterfaceStyle ?? config.userInterfaceStyle ?? 'light';\n}\n\nexport function setUiModeAndroidManifest(\n config: Pick<ExpoConfig, 'android' | 'userInterfaceStyle'>,\n androidManifest: AndroidManifest\n) {\n const userInterfaceStyle = getUserInterfaceStyle(config);\n // TODO: Remove this if we decide to remove any uiMode configuration when not specified\n if (!userInterfaceStyle) {\n return androidManifest;\n }\n\n const mainActivity = getMainActivityOrThrow(androidManifest);\n mainActivity.$[CONFIG_CHANGES_ATTRIBUTE] =\n 'keyboard|keyboardHidden|orientation|screenSize|uiMode';\n\n return androidManifest;\n}\n\nexport function addOnConfigurationChangedMainActivity(\n config: Pick<ExpoConfig, 'android' | 'userInterfaceStyle'>,\n mainActivity: string\n): string {\n const userInterfaceStyle = getUserInterfaceStyle(config);\n if (!userInterfaceStyle) {\n return mainActivity;\n }\n\n // Cruzan: this is not ideal, but I'm not sure of a better way to handle writing to MainActivity.java\n if (mainActivity.match(`onConfigurationChanged`)?.length) {\n return mainActivity;\n }\n\n const MainActivityWithImports = addJavaImports(\n mainActivity,\n ['android.content.Intent', 'android.content.res.Configuration'],\n true\n );\n\n const pattern = new RegExp(`public class MainActivity extends ReactActivity {`);\n return MainActivityWithImports.replace(pattern, ON_CONFIGURATION_CHANGED);\n}\n\n// TODO: we should have a generic utility for doing this\nexport function addJavaImports(javaSource: string, javaImports: string[], isJava: boolean): string {\n const lines = javaSource.split('\\n');\n const lineIndexWithPackageDeclaration = lines.findIndex(line => line.match(/^package .*;?$/));\n for (const javaImport of javaImports) {\n if (!javaSource.includes(javaImport)) {\n const importStatement = `import ${javaImport}${isJava ? ';' : ''}`;\n lines.splice(lineIndexWithPackageDeclaration + 1, 0, importStatement);\n }\n }\n return lines.join('\\n');\n}\n"],"file":"UserInterfaceStyle.js"}
|
package/build/ios/Branch.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ExpoConfig } from '@expo/config-types';
|
|
2
|
-
import { InfoPlist } from './IosConfig.types';
|
|
3
|
-
export declare const withBranch: import("..").ConfigPlugin<void>;
|
|
4
|
-
export declare function getBranchApiKey(config: Pick<ExpoConfig, 'ios'>): string | null;
|
|
5
|
-
export declare function setBranchApiKey(config: Pick<ExpoConfig, 'ios'>, infoPlist: InfoPlist): InfoPlist;
|
package/build/ios/Branch.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getBranchApiKey = getBranchApiKey;
|
|
7
|
-
exports.setBranchApiKey = setBranchApiKey;
|
|
8
|
-
exports.withBranch = void 0;
|
|
9
|
-
|
|
10
|
-
function _iosPlugins() {
|
|
11
|
-
const data = require("../plugins/ios-plugins");
|
|
12
|
-
|
|
13
|
-
_iosPlugins = function () {
|
|
14
|
-
return data;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
return data;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const withBranch = (0, _iosPlugins().createInfoPlistPlugin)(setBranchApiKey, 'withBranch');
|
|
21
|
-
exports.withBranch = withBranch;
|
|
22
|
-
|
|
23
|
-
function getBranchApiKey(config) {
|
|
24
|
-
var _config$ios$config$br, _config$ios, _config$ios$config, _config$ios$config$br2;
|
|
25
|
-
|
|
26
|
-
return (_config$ios$config$br = (_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : (_config$ios$config = _config$ios.config) === null || _config$ios$config === void 0 ? void 0 : (_config$ios$config$br2 = _config$ios$config.branch) === null || _config$ios$config$br2 === void 0 ? void 0 : _config$ios$config$br2.apiKey) !== null && _config$ios$config$br !== void 0 ? _config$ios$config$br : null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function setBranchApiKey(config, infoPlist) {
|
|
30
|
-
const apiKey = getBranchApiKey(config);
|
|
31
|
-
|
|
32
|
-
if (apiKey === null) {
|
|
33
|
-
return infoPlist;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return { ...infoPlist,
|
|
37
|
-
branch_key: {
|
|
38
|
-
live: apiKey
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=Branch.js.map
|
package/build/ios/Branch.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ios/Branch.ts"],"names":["withBranch","setBranchApiKey","getBranchApiKey","config","ios","branch","apiKey","infoPlist","branch_key","live"],"mappings":";;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,UAAU,GAAG,yCAAsBC,eAAtB,EAAuC,YAAvC,CAAnB;;;AAEA,SAASC,eAAT,CAAyBC,MAAzB,EAA0D;AAAA;;AAC/D,iDAAOA,MAAM,CAACC,GAAd,sEAAO,YAAYD,MAAnB,iFAAO,mBAAoBE,MAA3B,2DAAO,uBAA4BC,MAAnC,yEAA6C,IAA7C;AACD;;AAEM,SAASL,eAAT,CAAyBE,MAAzB,EAA0DI,SAA1D,EAA2F;AAChG,QAAMD,MAAM,GAAGJ,eAAe,CAACC,MAAD,CAA9B;;AAEA,MAAIG,MAAM,KAAK,IAAf,EAAqB;AACnB,WAAOC,SAAP;AACD;;AAED,SAAO,EACL,GAAGA,SADE;AAELC,IAAAA,UAAU,EAAE;AACVC,MAAAA,IAAI,EAAEH;AADI;AAFP,GAAP;AAMD","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPlugin } from '../plugins/ios-plugins';\nimport { InfoPlist } from './IosConfig.types';\n\nexport const withBranch = createInfoPlistPlugin(setBranchApiKey, 'withBranch');\n\nexport function getBranchApiKey(config: Pick<ExpoConfig, 'ios'>) {\n return config.ios?.config?.branch?.apiKey ?? null;\n}\n\nexport function setBranchApiKey(config: Pick<ExpoConfig, 'ios'>, infoPlist: InfoPlist): InfoPlist {\n const apiKey = getBranchApiKey(config);\n\n if (apiKey === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n branch_key: {\n live: apiKey,\n },\n };\n}\n"],"file":"Branch.js"}
|
package/build/ios/Facebook.d.ts
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { ExpoConfig } from '@expo/config-types';
|
|
2
|
-
import { InfoPlist } from './IosConfig.types';
|
|
3
|
-
declare type ExpoConfigFacebook = Pick<ExpoConfig, 'facebookScheme' | 'facebookAdvertiserIDCollectionEnabled' | 'facebookAppId' | 'facebookAutoInitEnabled' | 'facebookAutoLogAppEventsEnabled' | 'facebookDisplayName'>;
|
|
4
|
-
export declare const withFacebook: import("..").ConfigPlugin<void>;
|
|
5
|
-
/**
|
|
6
|
-
* Getters
|
|
7
|
-
* TODO: these getters are the same between ios/android, we could reuse them
|
|
8
|
-
*/
|
|
9
|
-
export declare function getFacebookScheme(config: ExpoConfigFacebook): string | null;
|
|
10
|
-
export declare function getFacebookAppId(config: Pick<ExpoConfigFacebook, 'facebookAppId'>): string | null;
|
|
11
|
-
export declare function getFacebookDisplayName(config: ExpoConfigFacebook): string | null;
|
|
12
|
-
export declare function getFacebookAutoInitEnabled(config: ExpoConfigFacebook): boolean | null;
|
|
13
|
-
export declare function getFacebookAutoLogAppEvents(config: ExpoConfigFacebook): boolean | null;
|
|
14
|
-
export declare function getFacebookAdvertiserIDCollection(config: ExpoConfigFacebook): boolean | null;
|
|
15
|
-
/**
|
|
16
|
-
* Setters
|
|
17
|
-
*/
|
|
18
|
-
export declare function setFacebookConfig(config: ExpoConfigFacebook, infoPlist: InfoPlist): InfoPlist;
|
|
19
|
-
export declare function setFacebookScheme(config: ExpoConfigFacebook, infoPlist: InfoPlist): InfoPlist;
|
|
20
|
-
export declare function setFacebookAutoInitEnabled(config: ExpoConfigFacebook, { FacebookAutoInitEnabled, ...infoPlist }: InfoPlist): {
|
|
21
|
-
[x: string]: import("@expo/json-file").JSONValue | undefined;
|
|
22
|
-
UIStatusBarHidden?: boolean | undefined;
|
|
23
|
-
UIStatusBarStyle?: string | undefined;
|
|
24
|
-
UILaunchStoryboardName?: string | undefined;
|
|
25
|
-
CFBundleShortVersionString?: string | undefined;
|
|
26
|
-
CFBundleVersion?: string | undefined;
|
|
27
|
-
CFBundleDisplayName?: string | undefined;
|
|
28
|
-
CFBundleIdentifier?: string | undefined;
|
|
29
|
-
CFBundleName?: string | undefined;
|
|
30
|
-
CFBundleURLTypes?: import("./IosConfig.types").URLScheme[] | undefined;
|
|
31
|
-
CFBundleDevelopmentRegion?: string | undefined;
|
|
32
|
-
ITSAppUsesNonExemptEncryption?: boolean | undefined;
|
|
33
|
-
LSApplicationQueriesSchemes?: string[] | undefined;
|
|
34
|
-
FacebookAppID?: string | undefined;
|
|
35
|
-
FacebookDisplayName?: string | undefined;
|
|
36
|
-
FacebookAutoLogAppEventsEnabled?: boolean | undefined;
|
|
37
|
-
FacebookAdvertiserIDCollectionEnabled?: boolean | undefined;
|
|
38
|
-
UIBackgroundModes?: string[] | undefined;
|
|
39
|
-
UISupportedInterfaceOrientations?: import("./IosConfig.types").InterfaceOrientation[] | undefined;
|
|
40
|
-
GMSApiKey?: string | undefined;
|
|
41
|
-
GADApplicationIdentifier?: string | undefined;
|
|
42
|
-
UIUserInterfaceStyle?: import("./IosConfig.types").InterfaceStyle | undefined;
|
|
43
|
-
UIRequiresFullScreen?: boolean | undefined;
|
|
44
|
-
SKAdNetworkItems?: {
|
|
45
|
-
SKAdNetworkIdentifier: string;
|
|
46
|
-
}[] | undefined;
|
|
47
|
-
branch_key?: {
|
|
48
|
-
live?: string | undefined;
|
|
49
|
-
} | undefined;
|
|
50
|
-
};
|
|
51
|
-
export declare function setFacebookAutoLogAppEventsEnabled(config: ExpoConfigFacebook, { FacebookAutoLogAppEventsEnabled, ...infoPlist }: InfoPlist): {
|
|
52
|
-
[x: string]: import("@expo/json-file").JSONValue | undefined;
|
|
53
|
-
UIStatusBarHidden?: boolean | undefined;
|
|
54
|
-
UIStatusBarStyle?: string | undefined;
|
|
55
|
-
UILaunchStoryboardName?: string | undefined;
|
|
56
|
-
CFBundleShortVersionString?: string | undefined;
|
|
57
|
-
CFBundleVersion?: string | undefined;
|
|
58
|
-
CFBundleDisplayName?: string | undefined;
|
|
59
|
-
CFBundleIdentifier?: string | undefined;
|
|
60
|
-
CFBundleName?: string | undefined;
|
|
61
|
-
CFBundleURLTypes?: import("./IosConfig.types").URLScheme[] | undefined;
|
|
62
|
-
CFBundleDevelopmentRegion?: string | undefined;
|
|
63
|
-
ITSAppUsesNonExemptEncryption?: boolean | undefined;
|
|
64
|
-
LSApplicationQueriesSchemes?: string[] | undefined;
|
|
65
|
-
FacebookAppID?: string | undefined;
|
|
66
|
-
FacebookDisplayName?: string | undefined;
|
|
67
|
-
FacebookAutoInitEnabled?: boolean | undefined;
|
|
68
|
-
FacebookAdvertiserIDCollectionEnabled?: boolean | undefined;
|
|
69
|
-
UIBackgroundModes?: string[] | undefined;
|
|
70
|
-
UISupportedInterfaceOrientations?: import("./IosConfig.types").InterfaceOrientation[] | undefined;
|
|
71
|
-
GMSApiKey?: string | undefined;
|
|
72
|
-
GADApplicationIdentifier?: string | undefined;
|
|
73
|
-
UIUserInterfaceStyle?: import("./IosConfig.types").InterfaceStyle | undefined;
|
|
74
|
-
UIRequiresFullScreen?: boolean | undefined;
|
|
75
|
-
SKAdNetworkItems?: {
|
|
76
|
-
SKAdNetworkIdentifier: string;
|
|
77
|
-
}[] | undefined;
|
|
78
|
-
branch_key?: {
|
|
79
|
-
live?: string | undefined;
|
|
80
|
-
} | undefined;
|
|
81
|
-
};
|
|
82
|
-
export declare function setFacebookAdvertiserIDCollectionEnabled(config: ExpoConfigFacebook, { FacebookAdvertiserIDCollectionEnabled, ...infoPlist }: InfoPlist): {
|
|
83
|
-
[x: string]: import("@expo/json-file").JSONValue | undefined;
|
|
84
|
-
UIStatusBarHidden?: boolean | undefined;
|
|
85
|
-
UIStatusBarStyle?: string | undefined;
|
|
86
|
-
UILaunchStoryboardName?: string | undefined;
|
|
87
|
-
CFBundleShortVersionString?: string | undefined;
|
|
88
|
-
CFBundleVersion?: string | undefined;
|
|
89
|
-
CFBundleDisplayName?: string | undefined;
|
|
90
|
-
CFBundleIdentifier?: string | undefined;
|
|
91
|
-
CFBundleName?: string | undefined;
|
|
92
|
-
CFBundleURLTypes?: import("./IosConfig.types").URLScheme[] | undefined;
|
|
93
|
-
CFBundleDevelopmentRegion?: string | undefined;
|
|
94
|
-
ITSAppUsesNonExemptEncryption?: boolean | undefined;
|
|
95
|
-
LSApplicationQueriesSchemes?: string[] | undefined;
|
|
96
|
-
FacebookAppID?: string | undefined;
|
|
97
|
-
FacebookDisplayName?: string | undefined;
|
|
98
|
-
FacebookAutoInitEnabled?: boolean | undefined;
|
|
99
|
-
FacebookAutoLogAppEventsEnabled?: boolean | undefined;
|
|
100
|
-
UIBackgroundModes?: string[] | undefined;
|
|
101
|
-
UISupportedInterfaceOrientations?: import("./IosConfig.types").InterfaceOrientation[] | undefined;
|
|
102
|
-
GMSApiKey?: string | undefined;
|
|
103
|
-
GADApplicationIdentifier?: string | undefined;
|
|
104
|
-
UIUserInterfaceStyle?: import("./IosConfig.types").InterfaceStyle | undefined;
|
|
105
|
-
UIRequiresFullScreen?: boolean | undefined;
|
|
106
|
-
SKAdNetworkItems?: {
|
|
107
|
-
SKAdNetworkIdentifier: string;
|
|
108
|
-
}[] | undefined;
|
|
109
|
-
branch_key?: {
|
|
110
|
-
live?: string | undefined;
|
|
111
|
-
} | undefined;
|
|
112
|
-
};
|
|
113
|
-
export declare function setFacebookAppId(config: Pick<ExpoConfigFacebook, 'facebookAppId'>, { FacebookAppID, ...infoPlist }: InfoPlist): {
|
|
114
|
-
[x: string]: import("@expo/json-file").JSONValue | undefined;
|
|
115
|
-
UIStatusBarHidden?: boolean | undefined;
|
|
116
|
-
UIStatusBarStyle?: string | undefined;
|
|
117
|
-
UILaunchStoryboardName?: string | undefined;
|
|
118
|
-
CFBundleShortVersionString?: string | undefined;
|
|
119
|
-
CFBundleVersion?: string | undefined;
|
|
120
|
-
CFBundleDisplayName?: string | undefined;
|
|
121
|
-
CFBundleIdentifier?: string | undefined;
|
|
122
|
-
CFBundleName?: string | undefined;
|
|
123
|
-
CFBundleURLTypes?: import("./IosConfig.types").URLScheme[] | undefined;
|
|
124
|
-
CFBundleDevelopmentRegion?: string | undefined;
|
|
125
|
-
ITSAppUsesNonExemptEncryption?: boolean | undefined;
|
|
126
|
-
LSApplicationQueriesSchemes?: string[] | undefined;
|
|
127
|
-
FacebookDisplayName?: string | undefined;
|
|
128
|
-
FacebookAutoInitEnabled?: boolean | undefined;
|
|
129
|
-
FacebookAutoLogAppEventsEnabled?: boolean | undefined;
|
|
130
|
-
FacebookAdvertiserIDCollectionEnabled?: boolean | undefined;
|
|
131
|
-
UIBackgroundModes?: string[] | undefined;
|
|
132
|
-
UISupportedInterfaceOrientations?: import("./IosConfig.types").InterfaceOrientation[] | undefined;
|
|
133
|
-
GMSApiKey?: string | undefined;
|
|
134
|
-
GADApplicationIdentifier?: string | undefined;
|
|
135
|
-
UIUserInterfaceStyle?: import("./IosConfig.types").InterfaceStyle | undefined;
|
|
136
|
-
UIRequiresFullScreen?: boolean | undefined;
|
|
137
|
-
SKAdNetworkItems?: {
|
|
138
|
-
SKAdNetworkIdentifier: string;
|
|
139
|
-
}[] | undefined;
|
|
140
|
-
branch_key?: {
|
|
141
|
-
live?: string | undefined;
|
|
142
|
-
} | undefined;
|
|
143
|
-
};
|
|
144
|
-
export declare function setFacebookDisplayName(config: ExpoConfigFacebook, { FacebookDisplayName, ...infoPlist }: InfoPlist): {
|
|
145
|
-
[x: string]: import("@expo/json-file").JSONValue | undefined;
|
|
146
|
-
UIStatusBarHidden?: boolean | undefined;
|
|
147
|
-
UIStatusBarStyle?: string | undefined;
|
|
148
|
-
UILaunchStoryboardName?: string | undefined;
|
|
149
|
-
CFBundleShortVersionString?: string | undefined;
|
|
150
|
-
CFBundleVersion?: string | undefined;
|
|
151
|
-
CFBundleDisplayName?: string | undefined;
|
|
152
|
-
CFBundleIdentifier?: string | undefined;
|
|
153
|
-
CFBundleName?: string | undefined;
|
|
154
|
-
CFBundleURLTypes?: import("./IosConfig.types").URLScheme[] | undefined;
|
|
155
|
-
CFBundleDevelopmentRegion?: string | undefined;
|
|
156
|
-
ITSAppUsesNonExemptEncryption?: boolean | undefined;
|
|
157
|
-
LSApplicationQueriesSchemes?: string[] | undefined;
|
|
158
|
-
FacebookAppID?: string | undefined;
|
|
159
|
-
FacebookAutoInitEnabled?: boolean | undefined;
|
|
160
|
-
FacebookAutoLogAppEventsEnabled?: boolean | undefined;
|
|
161
|
-
FacebookAdvertiserIDCollectionEnabled?: boolean | undefined;
|
|
162
|
-
UIBackgroundModes?: string[] | undefined;
|
|
163
|
-
UISupportedInterfaceOrientations?: import("./IosConfig.types").InterfaceOrientation[] | undefined;
|
|
164
|
-
GMSApiKey?: string | undefined;
|
|
165
|
-
GADApplicationIdentifier?: string | undefined;
|
|
166
|
-
UIUserInterfaceStyle?: import("./IosConfig.types").InterfaceStyle | undefined;
|
|
167
|
-
UIRequiresFullScreen?: boolean | undefined;
|
|
168
|
-
SKAdNetworkItems?: {
|
|
169
|
-
SKAdNetworkIdentifier: string;
|
|
170
|
-
}[] | undefined;
|
|
171
|
-
branch_key?: {
|
|
172
|
-
live?: string | undefined;
|
|
173
|
-
} | undefined;
|
|
174
|
-
};
|
|
175
|
-
export declare function setFacebookApplicationQuerySchemes(config: Pick<ExpoConfigFacebook, 'facebookAppId'>, infoPlist: InfoPlist): InfoPlist;
|
|
176
|
-
export {};
|
package/build/ios/Facebook.js
DELETED
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getFacebookScheme = getFacebookScheme;
|
|
7
|
-
exports.getFacebookAppId = getFacebookAppId;
|
|
8
|
-
exports.getFacebookDisplayName = getFacebookDisplayName;
|
|
9
|
-
exports.getFacebookAutoInitEnabled = getFacebookAutoInitEnabled;
|
|
10
|
-
exports.getFacebookAutoLogAppEvents = getFacebookAutoLogAppEvents;
|
|
11
|
-
exports.getFacebookAdvertiserIDCollection = getFacebookAdvertiserIDCollection;
|
|
12
|
-
exports.setFacebookConfig = setFacebookConfig;
|
|
13
|
-
exports.setFacebookScheme = setFacebookScheme;
|
|
14
|
-
exports.setFacebookAutoInitEnabled = setFacebookAutoInitEnabled;
|
|
15
|
-
exports.setFacebookAutoLogAppEventsEnabled = setFacebookAutoLogAppEventsEnabled;
|
|
16
|
-
exports.setFacebookAdvertiserIDCollectionEnabled = setFacebookAdvertiserIDCollectionEnabled;
|
|
17
|
-
exports.setFacebookAppId = setFacebookAppId;
|
|
18
|
-
exports.setFacebookDisplayName = setFacebookDisplayName;
|
|
19
|
-
exports.setFacebookApplicationQuerySchemes = setFacebookApplicationQuerySchemes;
|
|
20
|
-
exports.withFacebook = void 0;
|
|
21
|
-
|
|
22
|
-
function _iosPlugins() {
|
|
23
|
-
const data = require("../plugins/ios-plugins");
|
|
24
|
-
|
|
25
|
-
_iosPlugins = function () {
|
|
26
|
-
return data;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
return data;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function _Scheme() {
|
|
33
|
-
const data = require("./Scheme");
|
|
34
|
-
|
|
35
|
-
_Scheme = function () {
|
|
36
|
-
return data;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return data;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const fbSchemes = ['fbapi', 'fb-messenger-api', 'fbauth2', 'fbshareextension'];
|
|
43
|
-
const withFacebook = (0, _iosPlugins().createInfoPlistPlugin)(setFacebookConfig, 'withFacebook');
|
|
44
|
-
/**
|
|
45
|
-
* Getters
|
|
46
|
-
* TODO: these getters are the same between ios/android, we could reuse them
|
|
47
|
-
*/
|
|
48
|
-
|
|
49
|
-
exports.withFacebook = withFacebook;
|
|
50
|
-
|
|
51
|
-
function getFacebookScheme(config) {
|
|
52
|
-
var _config$facebookSchem;
|
|
53
|
-
|
|
54
|
-
return (_config$facebookSchem = config.facebookScheme) !== null && _config$facebookSchem !== void 0 ? _config$facebookSchem : null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function getFacebookAppId(config) {
|
|
58
|
-
var _config$facebookAppId;
|
|
59
|
-
|
|
60
|
-
return (_config$facebookAppId = config.facebookAppId) !== null && _config$facebookAppId !== void 0 ? _config$facebookAppId : null;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function getFacebookDisplayName(config) {
|
|
64
|
-
var _config$facebookDispl;
|
|
65
|
-
|
|
66
|
-
return (_config$facebookDispl = config.facebookDisplayName) !== null && _config$facebookDispl !== void 0 ? _config$facebookDispl : null;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function getFacebookAutoInitEnabled(config) {
|
|
70
|
-
var _config$facebookAutoI;
|
|
71
|
-
|
|
72
|
-
return (_config$facebookAutoI = config.facebookAutoInitEnabled) !== null && _config$facebookAutoI !== void 0 ? _config$facebookAutoI : null;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function getFacebookAutoLogAppEvents(config) {
|
|
76
|
-
var _config$facebookAutoL;
|
|
77
|
-
|
|
78
|
-
return (_config$facebookAutoL = config.facebookAutoLogAppEventsEnabled) !== null && _config$facebookAutoL !== void 0 ? _config$facebookAutoL : null;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function getFacebookAdvertiserIDCollection(config) {
|
|
82
|
-
var _config$facebookAdver;
|
|
83
|
-
|
|
84
|
-
return (_config$facebookAdver = config.facebookAdvertiserIDCollectionEnabled) !== null && _config$facebookAdver !== void 0 ? _config$facebookAdver : null;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Setters
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
function setFacebookConfig(config, infoPlist) {
|
|
92
|
-
infoPlist = setFacebookAppId(config, infoPlist);
|
|
93
|
-
infoPlist = setFacebookApplicationQuerySchemes(config, infoPlist);
|
|
94
|
-
infoPlist = setFacebookDisplayName(config, infoPlist);
|
|
95
|
-
infoPlist = setFacebookAutoInitEnabled(config, infoPlist);
|
|
96
|
-
infoPlist = setFacebookAutoLogAppEventsEnabled(config, infoPlist);
|
|
97
|
-
infoPlist = setFacebookAdvertiserIDCollectionEnabled(config, infoPlist);
|
|
98
|
-
infoPlist = setFacebookScheme(config, infoPlist);
|
|
99
|
-
return infoPlist;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function setFacebookScheme(config, infoPlist) {
|
|
103
|
-
const facebookScheme = getFacebookScheme(config);
|
|
104
|
-
return (0, _Scheme().appendScheme)(facebookScheme, infoPlist);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function setFacebookAutoInitEnabled(config, {
|
|
108
|
-
FacebookAutoInitEnabled,
|
|
109
|
-
...infoPlist
|
|
110
|
-
}) {
|
|
111
|
-
const facebookAutoInitEnabled = getFacebookAutoInitEnabled(config);
|
|
112
|
-
|
|
113
|
-
if (facebookAutoInitEnabled === null) {
|
|
114
|
-
return infoPlist;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return { ...infoPlist,
|
|
118
|
-
FacebookAutoInitEnabled: facebookAutoInitEnabled
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function setFacebookAutoLogAppEventsEnabled(config, {
|
|
123
|
-
FacebookAutoLogAppEventsEnabled,
|
|
124
|
-
...infoPlist
|
|
125
|
-
}) {
|
|
126
|
-
const facebookAutoLogAppEventsEnabled = getFacebookAutoLogAppEvents(config);
|
|
127
|
-
|
|
128
|
-
if (facebookAutoLogAppEventsEnabled === null) {
|
|
129
|
-
return infoPlist;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return { ...infoPlist,
|
|
133
|
-
FacebookAutoLogAppEventsEnabled: facebookAutoLogAppEventsEnabled
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function setFacebookAdvertiserIDCollectionEnabled(config, {
|
|
138
|
-
FacebookAdvertiserIDCollectionEnabled,
|
|
139
|
-
...infoPlist
|
|
140
|
-
}) {
|
|
141
|
-
const facebookAdvertiserIDCollectionEnabled = getFacebookAdvertiserIDCollection(config);
|
|
142
|
-
|
|
143
|
-
if (facebookAdvertiserIDCollectionEnabled === null) {
|
|
144
|
-
return infoPlist;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
return { ...infoPlist,
|
|
148
|
-
FacebookAdvertiserIDCollectionEnabled: facebookAdvertiserIDCollectionEnabled
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function setFacebookAppId(config, {
|
|
153
|
-
FacebookAppID,
|
|
154
|
-
...infoPlist
|
|
155
|
-
}) {
|
|
156
|
-
const facebookAppId = getFacebookAppId(config);
|
|
157
|
-
|
|
158
|
-
if (facebookAppId) {
|
|
159
|
-
return { ...infoPlist,
|
|
160
|
-
FacebookAppID: facebookAppId
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
return infoPlist;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function setFacebookDisplayName(config, {
|
|
168
|
-
FacebookDisplayName,
|
|
169
|
-
...infoPlist
|
|
170
|
-
}) {
|
|
171
|
-
const facebookDisplayName = getFacebookDisplayName(config);
|
|
172
|
-
|
|
173
|
-
if (facebookDisplayName) {
|
|
174
|
-
return { ...infoPlist,
|
|
175
|
-
FacebookDisplayName: facebookDisplayName
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
return infoPlist;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function setFacebookApplicationQuerySchemes(config, infoPlist) {
|
|
183
|
-
const facebookAppId = getFacebookAppId(config);
|
|
184
|
-
const existingSchemes = infoPlist.LSApplicationQueriesSchemes || [];
|
|
185
|
-
|
|
186
|
-
if (facebookAppId && existingSchemes.includes('fbapi')) {
|
|
187
|
-
// already inlcuded, no need to add again
|
|
188
|
-
return infoPlist;
|
|
189
|
-
} else if (!facebookAppId && !existingSchemes.length) {
|
|
190
|
-
// already removed, no need to strip again
|
|
191
|
-
const {
|
|
192
|
-
LSApplicationQueriesSchemes,
|
|
193
|
-
...restInfoPlist
|
|
194
|
-
} = infoPlist;
|
|
195
|
-
|
|
196
|
-
if (LSApplicationQueriesSchemes !== null && LSApplicationQueriesSchemes !== void 0 && LSApplicationQueriesSchemes.length) {
|
|
197
|
-
return infoPlist;
|
|
198
|
-
} else {
|
|
199
|
-
// Return without the empty LSApplicationQueriesSchemes array.
|
|
200
|
-
return restInfoPlist;
|
|
201
|
-
}
|
|
202
|
-
} // Remove all schemes
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
for (const scheme of fbSchemes) {
|
|
206
|
-
const index = existingSchemes.findIndex(s => s === scheme);
|
|
207
|
-
|
|
208
|
-
if (index > -1) {
|
|
209
|
-
existingSchemes.splice(index, 1);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
if (!facebookAppId) {
|
|
214
|
-
// Run again to ensure the LSApplicationQueriesSchemes array is stripped if needed.
|
|
215
|
-
infoPlist.LSApplicationQueriesSchemes = existingSchemes;
|
|
216
|
-
|
|
217
|
-
if (!infoPlist.LSApplicationQueriesSchemes.length) {
|
|
218
|
-
delete infoPlist.LSApplicationQueriesSchemes;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
return infoPlist;
|
|
222
|
-
} // TODO: it's actually necessary to add more query schemes (specific to the
|
|
223
|
-
// app) to support all of the features that the Facebook SDK provides, should
|
|
224
|
-
// we sync those here too?
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
const updatedSchemes = [...existingSchemes, ...fbSchemes];
|
|
228
|
-
return { ...infoPlist,
|
|
229
|
-
LSApplicationQueriesSchemes: updatedSchemes
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
//# sourceMappingURL=Facebook.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ios/Facebook.ts"],"names":["fbSchemes","withFacebook","setFacebookConfig","getFacebookScheme","config","facebookScheme","getFacebookAppId","facebookAppId","getFacebookDisplayName","facebookDisplayName","getFacebookAutoInitEnabled","facebookAutoInitEnabled","getFacebookAutoLogAppEvents","facebookAutoLogAppEventsEnabled","getFacebookAdvertiserIDCollection","facebookAdvertiserIDCollectionEnabled","infoPlist","setFacebookAppId","setFacebookApplicationQuerySchemes","setFacebookDisplayName","setFacebookAutoInitEnabled","setFacebookAutoLogAppEventsEnabled","setFacebookAdvertiserIDCollectionEnabled","setFacebookScheme","FacebookAutoInitEnabled","FacebookAutoLogAppEventsEnabled","FacebookAdvertiserIDCollectionEnabled","FacebookAppID","FacebookDisplayName","existingSchemes","LSApplicationQueriesSchemes","includes","length","restInfoPlist","scheme","index","findIndex","s","splice","updatedSchemes"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAYA,MAAMA,SAAS,GAAG,CAAC,OAAD,EAAU,kBAAV,EAA8B,SAA9B,EAAyC,kBAAzC,CAAlB;AAEO,MAAMC,YAAY,GAAG,yCAAsBC,iBAAtB,EAAyC,cAAzC,CAArB;AAEP;AACA;AACA;AACA;;;;AAEO,SAASC,iBAAT,CAA2BC,MAA3B,EAAuD;AAAA;;AAC5D,kCAAOA,MAAM,CAACC,cAAd,yEAAgC,IAAhC;AACD;;AAEM,SAASC,gBAAT,CAA0BF,MAA1B,EAA6E;AAAA;;AAClF,kCAAOA,MAAM,CAACG,aAAd,yEAA+B,IAA/B;AACD;;AAEM,SAASC,sBAAT,CAAgCJ,MAAhC,EAA4D;AAAA;;AACjE,kCAAOA,MAAM,CAACK,mBAAd,yEAAqC,IAArC;AACD;;AACM,SAASC,0BAAT,CAAoCN,MAApC,EAAgE;AAAA;;AACrE,kCAAOA,MAAM,CAACO,uBAAd,yEAAyC,IAAzC;AACD;;AAEM,SAASC,2BAAT,CAAqCR,MAArC,EAAiE;AAAA;;AACtE,kCAAOA,MAAM,CAACS,+BAAd,yEAAiD,IAAjD;AACD;;AAEM,SAASC,iCAAT,CAA2CV,MAA3C,EAAuE;AAAA;;AAC5E,kCAAOA,MAAM,CAACW,qCAAd,yEAAuD,IAAvD;AACD;AAED;AACA;AACA;;;AAEO,SAASb,iBAAT,CAA2BE,MAA3B,EAAuDY,SAAvD,EAA6E;AAClFA,EAAAA,SAAS,GAAGC,gBAAgB,CAACb,MAAD,E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A,QAAIc,2BAAJ,aAAIA,2BAAJ,eAAIA,2BAA2B,CAAEE,MAAjC,EAAyC;AACvC,aAAOhB,SAAP;AACD,KAFD,MAEO;AACL;AACA,aAAOiB,aAAP;AACD;AACF,GAjBU,CAmBX;;;AACA,OAAK,MAAMC,MAAX,IAAqBlC,SAArB,EAAgC;AAC9B,UAAMmC,KAAK,GAAGN,eAAe,CAACO,SAAhB,CAA0BC,CAAC,IAAIA,CAAC,KAAKH,MAArC,CAAd;;AACA,QAAIC,KAAK,GAAG,CAAC,CAAb,EAAgB;AACdN,MAAAA,eAAe,CAACS,MAAhB,CAAuBH,KAAvB,EAA8B,CAA9B;AACD;AACF;;AAED,MAAI,CAAC5B,aAAL,EAAoB;AAClB;AACAS,IAAAA,SAAS,CAACc,2BAAV,GAAwCD,eAAxC;;AACA,QAAI,CAACb,SAAS,CAACc,2BAAV,CAAsCE,MAA3C,EAAmD;AACjD,aAAOhB,SAAS,CAACc,2BAAjB;AACD;;AACD,WAAOd,SAAP;AACD,GAlCU,CAoCX;AACA;AACA;;;AACA,QAAMuB,cAAc,GAAG,CAAC,GAAGV,eAAJ,EAAqB,GAAG7B,SAAxB,CAAvB;AAEA,SAAO,EACL,GAAGgB,SADE;AAELc,IAAAA,2BAA2B,EAAES;AAFxB,GAAP;AAID","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPlugin } from '../plugins/ios-plugins';\nimport { InfoPlist } from './IosConfig.types';\nimport { appendScheme } from './Scheme';\n\ntype ExpoConfigFacebook = Pick<\n ExpoConfig,\n | 'facebookScheme'\n | 'facebookAdvertiserIDCollectionEnabled'\n | 'facebookAppId'\n | 'facebookAutoInitEnabled'\n | 'facebookAutoLogAppEventsEnabled'\n | 'facebookDisplayName'\n>;\n\nconst fbSchemes = ['fbapi', 'fb-messenger-api', 'fbauth2', 'fbshareextension'];\n\nexport const withFacebook = createInfoPlistPlugin(setFacebookConfig, 'withFacebook');\n\n/**\n * Getters\n * TODO: these getters are the same between ios/android, we could reuse them\n */\n\nexport function getFacebookScheme(config: ExpoConfigFacebook) {\n return config.facebookScheme ?? null;\n}\n\nexport function getFacebookAppId(config: Pick<ExpoConfigFacebook, 'facebookAppId'>) {\n return config.facebookAppId ?? null;\n}\n\nexport function getFacebookDisplayName(config: ExpoConfigFacebook) {\n return config.facebookDisplayName ?? null;\n}\nexport function getFacebookAutoInitEnabled(config: ExpoConfigFacebook) {\n return config.facebookAutoInitEnabled ?? null;\n}\n\nexport function getFacebookAutoLogAppEvents(config: ExpoConfigFacebook) {\n return config.facebookAutoLogAppEventsEnabled ?? null;\n}\n\nexport function getFacebookAdvertiserIDCollection(config: ExpoConfigFacebook) {\n return config.facebookAdvertiserIDCollectionEnabled ?? null;\n}\n\n/**\n * Setters\n */\n\nexport function setFacebookConfig(config: ExpoConfigFacebook, infoPlist: InfoPlist) {\n infoPlist = setFacebookAppId(config, infoPlist);\n infoPlist = setFacebookApplicationQuerySchemes(config, infoPlist);\n infoPlist = setFacebookDisplayName(config, infoPlist);\n infoPlist = setFacebookAutoInitEnabled(config, infoPlist);\n infoPlist = setFacebookAutoLogAppEventsEnabled(config, infoPlist);\n infoPlist = setFacebookAdvertiserIDCollectionEnabled(config, infoPlist);\n infoPlist = setFacebookScheme(config, infoPlist);\n return infoPlist;\n}\n\nexport function setFacebookScheme(config: ExpoConfigFacebook, infoPlist: InfoPlist) {\n const facebookScheme = getFacebookScheme(config);\n return appendScheme(facebookScheme, infoPlist);\n}\n\nexport function setFacebookAutoInitEnabled(\n config: ExpoConfigFacebook,\n { FacebookAutoInitEnabled, ...infoPlist }: InfoPlist\n) {\n const facebookAutoInitEnabled = getFacebookAutoInitEnabled(config);\n\n if (facebookAutoInitEnabled === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n FacebookAutoInitEnabled: facebookAutoInitEnabled,\n };\n}\n\nexport function setFacebookAutoLogAppEventsEnabled(\n config: ExpoConfigFacebook,\n { FacebookAutoLogAppEventsEnabled, ...infoPlist }: InfoPlist\n) {\n const facebookAutoLogAppEventsEnabled = getFacebookAutoLogAppEvents(config);\n\n if (facebookAutoLogAppEventsEnabled === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n FacebookAutoLogAppEventsEnabled: facebookAutoLogAppEventsEnabled,\n };\n}\n\nexport function setFacebookAdvertiserIDCollectionEnabled(\n config: ExpoConfigFacebook,\n { FacebookAdvertiserIDCollectionEnabled, ...infoPlist }: InfoPlist\n) {\n const facebookAdvertiserIDCollectionEnabled = getFacebookAdvertiserIDCollection(config);\n\n if (facebookAdvertiserIDCollectionEnabled === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n FacebookAdvertiserIDCollectionEnabled: facebookAdvertiserIDCollectionEnabled,\n };\n}\n\nexport function setFacebookAppId(\n config: Pick<ExpoConfigFacebook, 'facebookAppId'>,\n { FacebookAppID, ...infoPlist }: InfoPlist\n) {\n const facebookAppId = getFacebookAppId(config);\n if (facebookAppId) {\n return {\n ...infoPlist,\n FacebookAppID: facebookAppId,\n };\n }\n\n return infoPlist;\n}\n\nexport function setFacebookDisplayName(\n config: ExpoConfigFacebook,\n { FacebookDisplayName, ...infoPlist }: InfoPlist\n) {\n const facebookDisplayName = getFacebookDisplayName(config);\n\n if (facebookDisplayName) {\n return {\n ...infoPlist,\n FacebookDisplayName: facebookDisplayName,\n };\n }\n\n return infoPlist;\n}\n\nexport function setFacebookApplicationQuerySchemes(\n config: Pick<ExpoConfigFacebook, 'facebookAppId'>,\n infoPlist: InfoPlist\n): InfoPlist {\n const facebookAppId = getFacebookAppId(config);\n\n const existingSchemes = infoPlist.LSApplicationQueriesSchemes || [];\n\n if (facebookAppId && existingSchemes.includes('fbapi')) {\n // already inlcuded, no need to add again\n return infoPlist;\n } else if (!facebookAppId && !existingSchemes.length) {\n // already removed, no need to strip again\n const { LSApplicationQueriesSchemes, ...restInfoPlist } = infoPlist;\n if (LSApplicationQueriesSchemes?.length) {\n return infoPlist;\n } else {\n // Return without the empty LSApplicationQueriesSchemes array.\n return restInfoPlist;\n }\n }\n\n // Remove all schemes\n for (const scheme of fbSchemes) {\n const index = existingSchemes.findIndex(s => s === scheme);\n if (index > -1) {\n existingSchemes.splice(index, 1);\n }\n }\n\n if (!facebookAppId) {\n // Run again to ensure the LSApplicationQueriesSchemes array is stripped if needed.\n infoPlist.LSApplicationQueriesSchemes = existingSchemes;\n if (!infoPlist.LSApplicationQueriesSchemes.length) {\n delete infoPlist.LSApplicationQueriesSchemes;\n }\n return infoPlist;\n }\n\n // TODO: it's actually necessary to add more query schemes (specific to the\n // app) to support all of the features that the Facebook SDK provides, should\n // we sync those here too?\n const updatedSchemes = [...existingSchemes, ...fbSchemes];\n\n return {\n ...infoPlist,\n LSApplicationQueriesSchemes: updatedSchemes,\n };\n}\n"],"file":"Facebook.js"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ExpoConfig } from '@expo/config-types';
|
|
2
|
-
import { ConfigPlugin } from '../Plugin.types';
|
|
3
|
-
import { InfoPlist } from './IosConfig.types';
|
|
4
|
-
export declare const withRootViewBackgroundColor: ConfigPlugin;
|
|
5
|
-
export declare function setRootViewBackgroundColor(config: Pick<ExpoConfig, 'backgroundColor' | 'ios'>, infoPlist: InfoPlist): InfoPlist;
|
|
6
|
-
export declare function getRootViewBackgroundColor(config: Pick<ExpoConfig, 'ios' | 'backgroundColor'>): string | null;
|