Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 92957a1

Browse files
EddyVerbruggeneddyverbruggen
authored andcommitted
Don't load AdMob symbols if AdMob was not enabled in the config #290
1 parent 53a1812 commit 92957a1

File tree

5 files changed

+43
-5
lines changed

5 files changed

+43
-5
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
<img src="docs/images/firebase-logo.png" width="116px" height="32px" alt="Firebase"/>
22

3+
4+
## 3.10.1 (2017, February 19)
5+
6+
[Full changelog](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/compare/3.10.0...3.10.1)
7+
8+
### SDK versions
9+
10+
If version numbers __changed__, clean your platform folders to avoid build errors.
11+
Also, for Android update your Google Repository in the Android SDK manager (type `android` on the command prompt),
12+
and for iOS do a `pod repo update` to fetch the latest versions from Cocoapods.
13+
14+
- iOS: 3.13.x
15+
- Android: 10.2.x
16+
17+
### Fixes
18+
- [#290](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/290) Don't load AdMob symbols if AdMob was not enabled in the config
19+
20+
21+
22+
323
## 3.10.0 (2017, February 17)
424

525
[Full changelog](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/compare/3.9.3...3.10.0)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-plugin-firebase",
3-
"version": "3.10.0",
3+
"version": "3.10.1",
44
"description": "Fire. Base. Firebase!",
55
"main": "firebase",
66
"typings": "index.d.ts",
File renamed without changes.

scripts/installer.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,26 @@ function promptQuestions() {
153153
});
154154
}
155155
function promptQuestionsResult(result) {
156-
if(usingiOS) {
156+
if (usingiOS) {
157157
writePodFile(result);
158+
exposeAdMobSymbols(isSelected(result.admob));
158159
}
159-
if(usingAndroid) {
160+
if (usingAndroid) {
160161
writeGradleFile(result);
161162
writeGoogleServiceCopyHook();
162163
writeGoogleServiceGradleHook();
163164
}
164165
console.log('Firebase post install completed. To re-run this script, navigate to the root directory of `nativescript-plugin-firebase` in your `node_modules` folder and run: `npm run config`.');
165166
}
166167

168+
function exposeAdMobSymbols(enable) {
169+
if (enable && fs.existsSync(directories.ios + '/build.xcconfig.admob')) {
170+
fs.renameSync(directories.ios + '/build.xcconfig.admob', directories.ios + '/build.xcconfig');
171+
} else if (!enable && fs.existsSync(directories.ios + '/build.xcconfig')) {
172+
fs.renameSync(directories.ios + '/build.xcconfig', directories.ios + '/build.xcconfig.admob');
173+
}
174+
}
175+
167176
function askSaveConfigPrompt() {
168177
prompt.get({
169178
name: 'save_config',

scripts/postinstall.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2962,17 +2962,26 @@ function promptQuestions() {
29622962
});
29632963
}
29642964
function promptQuestionsResult(result) {
2965-
if(usingiOS) {
2965+
if (usingiOS) {
29662966
writePodFile(result);
2967+
exposeAdMobSymbols(isSelected(result.admob));
29672968
}
2968-
if(usingAndroid) {
2969+
if (usingAndroid) {
29692970
writeGradleFile(result);
29702971
writeGoogleServiceCopyHook();
29712972
writeGoogleServiceGradleHook();
29722973
}
29732974
console.log('Firebase post install completed. To re-run this script, navigate to the root directory of `nativescript-plugin-firebase` in your `node_modules` folder and run: `npm run config`.');
29742975
}
29752976

2977+
function exposeAdMobSymbols(enable) {
2978+
if (enable && fs.existsSync(directories.ios + '/build.xcconfig.admob')) {
2979+
fs.renameSync(directories.ios + '/build.xcconfig.admob', directories.ios + '/build.xcconfig');
2980+
} else if (!enable && fs.existsSync(directories.ios + '/build.xcconfig')) {
2981+
fs.renameSync(directories.ios + '/build.xcconfig', directories.ios + '/build.xcconfig.admob');
2982+
}
2983+
}
2984+
29762985
function askSaveConfigPrompt() {
29772986
prompt.get({
29782987
name: 'save_config',

0 commit comments

Comments
 (0)