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

Commit fa471a2

Browse files
cleanup
1 parent 40da077 commit fa471a2

4 files changed

Lines changed: 15 additions & 63 deletions

File tree

demo/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
"nativescript": {
33
"id": "org.nativescript.firebasedemo",
44
"tns-ios": {
5-
"version": "5.0.0"
5+
"version": "5.2.0"
66
},
77
"tns-android": {
8-
"version": "5.0.0"
8+
"version": "5.2.0"
99
}
1010
},
1111
"dependencies": {
1212
"firebase-functions": "^2.0.5",
1313
"nativescript-plugin-firebase": "file:../publish/package/nativescript-plugin-firebase-8.0.0.tgz",
1414
"nativescript-theme-core": "^1.0.4",
1515
"nativescript-unit-test-runner": "^0.3.4",
16-
"tns-core-modules": "~5.0.5"
16+
"tns-core-modules": "~5.2.0"
1717
},
1818
"devDependencies": {
1919
"@types/jasmine": "~2.8.0",
@@ -29,7 +29,7 @@
2929
"nativescript-css-loader": "~0.26.0",
3030
"nativescript-dev-typescript": "~0.7.1",
3131
"nativescript-dev-webpack": "^0.16.2",
32-
"tns-platform-declarations": "~5.0.5",
32+
"tns-platform-declarations": "~5.2.0",
3333
"tslint": "~5.4.3",
3434
"typescript": "~2.8.0"
3535
},

publish/scripts/installer.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ var prompt = require('prompt-lite');
44

55
const { execSync } = require('child_process');
66
const semver = require('semver');
7-
8-
// iOS modern build system is supported from version NativeScript (CLI) version 5.2.0
97
const tnsVersionFull = execSync('tns --version', { encoding: 'ascii'});
8+
9+
// iOS modern build system is supported from version NativeScript-CLI version 5.2.0
1010
const supportsIOSModernBuildSystem = tnsVersionFull.indexOf("5.2.0-") > -1 || semver.gte(tnsVersionFull, "5.2.0");
11-
console.log({supportsIOSModernBuildSystem});
11+
12+
// Custom gradle buildscripts are supported from NativeScript-Android version 5.3.0 (TODO this actually checks the CLI version)
13+
const supportsGradleBuildscripts = tnsVersionFull.indexOf("5.3.0-") > -1 || semver.gte(tnsVersionFull, "5.3.0");
1214

1315
if (!supportsIOSModernBuildSystem) {
1416
console.log(`You're using NativeScript ${tnsVersionFull}.. which doesn't support the latest Firestore and in-app-messaging SDKs. Upgrade NativeScript to at least 5.2.0 if you need those!\n\n`);
@@ -699,12 +701,6 @@ function writeGradleFile(result) {
699701
fs.writeFileSync(directories.android + '/include.gradle',
700702
`
701703
android {
702-
productFlavors {
703-
"fireb" {
704-
dimension "fireb"
705-
}
706-
}
707-
708704
// (possibly-temporary) workaround for https://stackoverflow.com/questions/52518378/more-than-one-file-was-found-with-os-independent-path-meta-inf-proguard-android
709705
packagingOptions {
710706
exclude 'META-INF/proguard/androidx-annotations.pro'

src/firebase.ios.ts

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,11 @@ firebase.areNotificationsEnabled = firebaseMessaging.areNotificationsEnabled;
4343
firebase.functions = firebaseFunctions;
4444

4545
firebase.addAppDelegateMethods = appDelegate => {
46-
console.log(">>> addAppDelegateMethods");
4746
// we need the launchOptions for this one so it's a bit hard to use the UIApplicationDidFinishLaunchingNotification pattern we're using for other things
4847
appDelegate.prototype.applicationDidFinishLaunchingWithOptions = (application, launchOptions) => {
49-
console.log(">>> applicationDidFinishLaunchingWithOptions");
5048
if (!firebase._configured) {
5149
firebase._configured = true;
5250
if (typeof (FIRApp) !== "undefined") {
53-
console.log(">>> applicationDidFinishLaunchingWithOptions, configure firebase");
5451
FIRApp.configure();
5552
}
5653
}
@@ -71,7 +68,6 @@ firebase.addAppDelegateMethods = appDelegate => {
7168

7269
// there's no notification event to hook into for this one, so using the appDelegate
7370
if (typeof (FBSDKApplicationDelegate) !== "undefined" || typeof (GIDSignIn) !== "undefined" || typeof (FIRInvites) !== "undefined" || typeof (FIRDynamicLink) !== "undefined") {
74-
console.log(">> wiring applicationOpenURLSourceApplicationAnnotation");
7571
appDelegate.prototype.applicationOpenURLSourceApplicationAnnotation = (application, url, sourceApplication, annotation) => {
7672
let result = false;
7773
if (typeof (FBSDKApplicationDelegate) !== "undefined") {
@@ -96,11 +92,8 @@ firebase.addAppDelegateMethods = appDelegate => {
9692
}
9793

9894
if (typeof (FIRDynamicLink) !== "undefined") {
99-
console.log(">> wiring applicationOpenURLSourceApplicationAnnotation, FIRDynamicLink");
10095
const dynamicLink = FIRDynamicLinks.dynamicLinks().dynamicLinkFromCustomSchemeURL(url);
101-
console.log(">> wiring applicationOpenURLSourceApplicationAnnotation, FIRDynamicLink: " + dynamicLink);
10296
if (dynamicLink) {
103-
console.log(">>> dynamicLink.url.absoluteString: " + dynamicLink.url.absoluteString);
10497
firebase._cachedDynamicLink = {
10598
url: dynamicLink.url.absoluteString,
10699
// matchConfidence: dynamicLink.matchConfidence,
@@ -116,7 +109,6 @@ firebase.addAppDelegateMethods = appDelegate => {
116109

117110
if (typeof (FBSDKApplicationDelegate) !== "undefined" || typeof (GIDSignIn) !== "undefined" || typeof (FIRDynamicLink) !== "undefined") {
118111
appDelegate.prototype.applicationOpenURLOptions = (application, url, options) => {
119-
console.log(">> wiring applicationOpenURLOptions");
120112

121113
let result = false;
122114
if (typeof (FBSDKApplicationDelegate) !== "undefined") {
@@ -135,12 +127,9 @@ firebase.addAppDelegateMethods = appDelegate => {
135127
}
136128

137129
if (typeof (FIRDynamicLink) !== "undefined") {
138-
console.log(">> wiring applicationOpenURLOptions, FIRDynamicLink, url: " + url);
139130
const dynamicLinks: FIRDynamicLinks = FIRDynamicLinks.dynamicLinks();
140131
const dynamicLink: FIRDynamicLink = dynamicLinks.dynamicLinkFromCustomSchemeURL(url);
141-
console.log(">> wiring applicationOpenURLOptions, FIRDynamicLink: " + dynamicLink);
142132
if (dynamicLink && dynamicLink.url !== null) {
143-
console.log(">>> dynamicLink.url.absoluteString: " + dynamicLink.url.absoluteString);
144133
if (firebase._dynamicLinkCallback) {
145134
firebase._dynamicLinkCallback({
146135
url: dynamicLink.url.absoluteString,
@@ -162,9 +151,7 @@ firebase.addAppDelegateMethods = appDelegate => {
162151
}
163152

164153
if (typeof (FIRDynamicLink) !== "undefined") {
165-
console.log(">>> addAppDelegateMethods, FIRDynamicLink");
166154
appDelegate.prototype.applicationContinueUserActivityRestorationHandler = (application, userActivity, restorationHandler) => {
167-
console.log(">>> applicationContinueUserActivityRestorationHandler");
168155
let result = false;
169156

170157
if (userActivity.webpageURL) {
@@ -318,36 +305,13 @@ if (typeof (FIRMessaging) !== "undefined" || useExternalPushProvider) {
318305
// This breaks in-app-messaging :(
319306
function getAppDelegate() {
320307
// Play nice with other plugins by not completely ignoring anything already added to the appdelegate
321-
console.log(">>> getAppDelegate, application.ios.delegate: " + application.ios.delegate);
322308
if (application.ios.delegate === undefined) {
323-
console.log(">>> getAppDelegate, window = " + application.ios.window);
324309

310+
@ObjCClass(UIApplicationDelegate)
325311
class UIApplicationDelegateImpl extends UIResponder implements UIApplicationDelegate {
326-
public static ObjCProtocols = [UIApplicationDelegate];
327-
328-
// get window() {
329-
// console.log(">>> getting window: " + application.ios.window);
330-
// return application.ios.window;
331-
// };
332-
333-
// set window(w) {
334-
// console.log(">>> setting window: " + w);
335-
// application.ios.window = w;
336-
// };
337-
338-
// static new(): UIApplicationDelegateImpl {
339-
// console.log(">> new UIApplicationDelegateImpl");
340-
// return <UIApplicationDelegateImpl>super.new();
341-
// }
342312
}
343313

344314
application.ios.delegate = UIApplicationDelegateImpl;
345-
346-
setTimeout(() => {
347-
if (!application.ios.delegate.window) {
348-
application.ios.delegate.window = application.ios.window;
349-
}
350-
}, 2000);
351315
}
352316
return application.ios.delegate;
353317
}
@@ -386,18 +350,14 @@ firebase.init = arg => {
386350

387351
// if deeplinks are used, then for this scheme to work the use must have added the bundle as a scheme to their plist (this is in our docs)
388352
if (FIROptions.defaultOptions() !== null) {
389-
console.log(">> init, defaultOptions deepLinkURLScheme");
390353
FIROptions.defaultOptions().deepLinkURLScheme = NSBundle.mainBundle.bundleIdentifier;
391-
console.log(">> init, defaultOptions deepLinkURLScheme: " + NSBundle.mainBundle.bundleIdentifier);
392354
}
393355

394356
FIRAnalyticsConfiguration.sharedInstance().setAnalyticsCollectionEnabled(arg.analyticsCollectionEnabled !== false);
395357

396-
console.log(">>> init, configure firebase");
397358
if (!firebase._configured) {
398359
firebase._configured = true;
399360
if (typeof (FIRApp) !== "undefined") {
400-
console.log(">>> init, firebase configured");
401361
FIRApp.configure();
402362
}
403363
}

src/scripts/postinstall.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4176,11 +4176,13 @@ var prompt = __webpack_require__(/*! prompt-lite */ 1);
41764176

41774177
const { execSync } = __webpack_require__(/*! child_process */ 3);
41784178
const semver = __webpack_require__(/*! semver */ 2);
4179-
4180-
// iOS modern build system is supported from version NativeScript (CLI) version 5.2.0
41814179
const tnsVersionFull = execSync('tns --version', { encoding: 'ascii'});
4180+
4181+
// iOS modern build system is supported from version NativeScript-CLI version 5.2.0
41824182
const supportsIOSModernBuildSystem = tnsVersionFull.indexOf("5.2.0-") > -1 || semver.gte(tnsVersionFull, "5.2.0");
4183-
console.log({supportsIOSModernBuildSystem});
4183+
4184+
// Custom gradle buildscripts are supported from NativeScript-Android version 5.3.0 (TODO this actually checks the CLI version)
4185+
const supportsGradleBuildscripts = tnsVersionFull.indexOf("5.3.0-") > -1 || semver.gte(tnsVersionFull, "5.3.0");
41844186

41854187
if (!supportsIOSModernBuildSystem) {
41864188
console.log(`You're using NativeScript ${tnsVersionFull}.. which doesn't support the latest Firestore and in-app-messaging SDKs. Upgrade NativeScript to at least 5.2.0 if you need those!\n\n`);
@@ -4871,12 +4873,6 @@ function writeGradleFile(result) {
48714873
fs.writeFileSync(directories.android + '/include.gradle',
48724874
`
48734875
android {
4874-
productFlavors {
4875-
"fireb" {
4876-
dimension "fireb"
4877-
}
4878-
}
4879-
48804876
// (possibly-temporary) workaround for https://stackoverflow.com/questions/52518378/more-than-one-file-was-found-with-os-independent-path-meta-inf-proguard-android
48814877
packagingOptions {
48824878
exclude 'META-INF/proguard/androidx-annotations.pro'

0 commit comments

Comments
 (0)