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

Commit bd44dc2

Browse files
committed
chore(): use get method instead of getter
1 parent b2e692e commit bd44dc2

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/analytics/analytics.android.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function logEvent(options: LogEventOptions): Promise<void> {
3535
}
3636

3737
com.google.firebase.analytics.FirebaseAnalytics.getInstance(
38-
appModule.android.context || appModule.android.nativeApp
38+
appModule.android.context || appModule.getNativeApplication()
3939
).logEvent(options.key, bundle);
4040

4141
resolve();
@@ -65,7 +65,7 @@ export function logComplexEvent(options: LogComplexEventOptions): Promise<void>
6565
}
6666

6767
com.google.firebase.analytics.FirebaseAnalytics.getInstance(
68-
appModule.android.context || appModule.android.nativeApp
68+
appModule.android.context || appModule.getNativeApplication()
6969
).logEvent(options.key, bundle);
7070

7171
resolve();
@@ -90,7 +90,7 @@ export function setUserId(arg): Promise<void> {
9090
}
9191

9292
com.google.firebase.analytics.FirebaseAnalytics.getInstance(
93-
appModule.android.context || appModule.android.nativeApp).setUserId(arg.userId);
93+
appModule.android.context || appModule.getNativeApplication()).setUserId(arg.userId);
9494

9595
resolve();
9696
} catch (ex) {
@@ -118,7 +118,7 @@ export function setUserProperty(options: SetUserPropertyOptions): Promise<void>
118118
}
119119

120120
com.google.firebase.analytics.FirebaseAnalytics.getInstance(
121-
appModule.android.context || appModule.android.nativeApp
121+
appModule.android.context || appModule.getNativeApplication()
122122
).setUserProperty(options.key, options.value);
123123

124124
resolve();
@@ -143,7 +143,7 @@ export function setScreenName(options: SetScreenNameOptions): Promise<void> {
143143
}
144144

145145
com.google.firebase.analytics.FirebaseAnalytics.getInstance(
146-
appModule.android.context || appModule.android.nativeApp
146+
appModule.android.context || appModule.getNativeApplication()
147147
).setCurrentScreen(appModule.android.foregroundActivity, options.screenName, null);
148148

149149
resolve();
@@ -157,15 +157,15 @@ export function setScreenName(options: SetScreenNameOptions): Promise<void> {
157157
export function setAnalyticsCollectionEnabled(enabled: boolean): void {
158158
if (isAnalyticsAvailable()) {
159159
com.google.firebase.analytics.FirebaseAnalytics.getInstance(
160-
appModule.android.context || appModule.android.nativeApp
160+
appModule.android.context || appModule.getNativeApplication()
161161
).setAnalyticsCollectionEnabled(enabled);
162162
}
163163
}
164164

165165
export function setSessionTimeoutDuration(seconds: number): void {
166166
if (isAnalyticsAvailable()) {
167167
com.google.firebase.analytics.FirebaseAnalytics.getInstance(
168-
appModule.android.context || appModule.android.nativeApp
168+
appModule.android.context || appModule.getNativeApplication()
169169
).setSessionTimeoutDuration(seconds * 1000); // Android expects ms
170170
}
171171
}

src/crashlytics/crashlytics.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function crash(): void {
6464
export function setCrashlyticsCollectionEnabled(enabled: boolean): void {
6565
if (isCrashlyticsAvailable()) {
6666
io.fabric.sdk.android.Fabric.with(
67-
appModule.android.nativeApp,
67+
appModule.getNativeApplication(),
6868
[new com.crashlytics.android.Crashlytics()]);
6969
}
7070
}

src/firebase.android.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,14 @@ firebase.init = arg => {
302302

303303
if (typeof (com.google.firebase.analytics) !== "undefined" && typeof (com.google.firebase.analytics.FirebaseAnalytics) !== "undefined") {
304304
com.google.firebase.analytics.FirebaseAnalytics.getInstance(
305-
appModule.android.context || appModule.android.nativeApp
305+
appModule.android.context || appModule.getNativeApplication()
306306
).setAnalyticsCollectionEnabled(arg.analyticsCollectionEnabled !== false);
307307
}
308308

309309
// note that this only makes sense if crash reporting was disabled in AndroidManifest.xml
310310
if (arg.crashlyticsCollectionEnabled && typeof (com.crashlytics) !== "undefined" && typeof (com.crashlytics.android.Crashlytics) !== "undefined") {
311311
io.fabric.sdk.android.Fabric.with(
312-
appModule.android.context || appModule.android.nativeApp,
312+
appModule.android.context || appModule.getNativeApplication(),
313313
[new com.crashlytics.android.Crashlytics()]);
314314
}
315315

@@ -478,7 +478,7 @@ firebase.getRemoteConfigDefaults = properties => {
478478
};
479479

480480
firebase._isGooglePlayServicesAvailable = () => {
481-
const ctx = appModule.android.foregroundActivity || appModule.android.startActivity || appModule.android.nativeApp;
481+
const ctx = appModule.android.foregroundActivity || appModule.android.startActivity || appModule.getNativeApplication();
482482
const googleApiAvailability = com.google.android.gms.common.GoogleApiAvailability.getInstance();
483483
const playServiceStatusSuccess = 0; // com.google.android.gms.common.ConnectionResult.SUCCESS;
484484
const playServicesStatus = googleApiAvailability.isGooglePlayServicesAvailable(ctx);
@@ -1021,7 +1021,7 @@ firebase.login = arg => {
10211021

10221022
// Lazy loading the Facebook callback manager
10231023
if (!fbCallbackManager) {
1024-
com.facebook.FacebookSdk.sdkInitialize(appModule.android.nativeApp);
1024+
com.facebook.FacebookSdk.sdkInitialize(appModule.getNativeApplication());
10251025
fbCallbackManager = com.facebook.CallbackManager.Factory.create();
10261026
}
10271027

@@ -1143,7 +1143,7 @@ firebase.login = arg => {
11431143
}
11441144
});
11451145

1146-
firebase._mGoogleApiClient = new com.google.android.gms.common.api.GoogleApiClient.Builder(appModule.android.nativeApp)
1146+
firebase._mGoogleApiClient = new com.google.android.gms.common.api.GoogleApiClient.Builder(appModule.getNativeApplication())
11471147
.addOnConnectionFailedListener(onConnectionFailedListener)
11481148
.addApi(com.google.android.gms.auth.api.Auth.GOOGLE_SIGN_IN_API, googleSignInOptions)
11491149
.build();

0 commit comments

Comments
 (0)