-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
app.config.js
134 lines (124 loc) · 4.3 KB
/
app.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
const path = require('path');
const plist = require('./util/plist');
let localConfig = {};
if (process.env.LOCAL_CONFIG_FILE) {
localConfig = require(process.env.LOCAL_CONFIG_FILE);
}
let {
bundleIdentifier,
googleServicesPlist = path.join(__dirname, "GoogleService-Info.plist"),
googleServicesJson = path.join(__dirname, "google-services.json"),
googleReservedClientId,
uriScheme = "plogalong",
amazonAffiliateSourceFile = path.join(__dirname, 'assets/other/amazon.html'),
iosBundleIdentifier = bundleIdentifier,
androidBundleIdentifier = bundleIdentifier,
googleMapsAPIKey,
...extra
} = localConfig;
const { appDomain = "app.plogalong.com" } = extra;
if (!androidBundleIdentifier || !googleMapsAPIKey) {
try {
const googleConfig = require(googleServicesJson);
androidBundleIdentifier = androidBundleIdentifier || googleConfig.client[0].client_info.android_client_info.package_name;
googleMapsAPIKey = googleMapsAPIKey || googleConfig.client[0].api_key[0].current_key;
} catch (_) {
androidBundleIdentifier = "com.plogalong.plogalong";
}
}
const fs = require('fs');
if (!googleReservedClientId || !iosBundleIdentifier) {
try {
const iosConfig = plist(fs.readFileSync(googleServicesPlist));
googleReservedClientId = googleReservedClientId || iosConfig['REVERSED_CLIENT_ID'];
iosBundleIdentifier = iosBundleIdentifier || iosConfig['BUNDLE_ID'];
} catch (_) {
googleReservedClientId = "com.googleusercontent.apps.682793596171-a6od8omgskpmfo7pt4q7es3h8sdtvv3n";
}
}
if (googleServicesPlist && !fs.existsSync(googleServicesPlist))
googleServicesPlist = undefined;
if (googleServicesJson && !fs.existsSync(googleServicesJson))
googleServicesJson = undefined;
if (!extra.amazonAffiliateSource && amazonAffiliateSourceFile)
extra.amazonAffiliateSource = fs.readFileSync(amazonAffiliateSourceFile).toString();
export default ({config}) => {
return {
"expo": {
"name": "Plogalong",
"slug": "plogalong",
"privacy": "public",
"platforms": [
"ios",
"android"
],
"version": "1.0.4",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"buildNumber": "4",
"infoPlist": {
"NSLocationWhenInUseUsageDescription": "We need your location to record where you plog.",
"NSCameraUsageDescription": "Allows you to save photos of things you pick up while plogging. Sharing your plogs makes photos visible to other users.",
"NSPhotoLibraryUsageDescription": "Allows you to save photos of things you pick up while plogging. Sharing your plogs makes photos visible to other users."
},
"associatedDomains": [`applinks:${appDomain}`],
"bundleIdentifier": iosBundleIdentifier,
"supportsTablet": false,
"config": {
"googleSignIn": {
"reservedClientId": googleReservedClientId
}
},
"googleServicesFile": googleServicesPlist,
"usesAppleSignIn": true
},
"android": {
"package": androidBundleIdentifier,
"googleServicesFile": googleServicesJson,
// "softwareKeyboardLayoutMode": "pan",
"permissions": ["CAMERA", "CAMERA_ROLL", "ACCESS_FINE_LOCATION", "READ_EXTERNAL_STORAGE", "READ_INTERNAL_STORAGE", "WRITE_EXTERNAL_STORAGE"],
"versionCode": 11,
"intentFilters": [
{
"action": "VIEW",
"autoVerify": true,
"data": [
{
"scheme": "https",
"host": appDomain,
"pathPrefix": "/"
}
],
"category": [
"BROWSABLE",
"DEFAULT"
]
}
],
"config": {
"googleMaps": {
"apiKey": googleMapsAPIKey
}
}
},
"packagerOpts": {
"config": "metro.config.js",
"sourceExts": ["expo.ts", "expo.tsx", "expo.js", "expo.jsx", "ts", "tsx", "js", "jsx", "json", "wasm", "svg"]
},
"scheme": uriScheme,
"extra": extra
}
};
};