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

Commit 83e239b

Browse files
Merge pull request #1223 from 000panther/000panther-fix-deprecated-currentContext
This would fix the issue #1222 with deprecated currentContext
2 parents 5faed73 + 4a059ad commit 83e239b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/analytics/analytics.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function logEvent(options: LogEventOptions): Promise<void> {
2828
}
2929

3030
com.google.firebase.analytics.FirebaseAnalytics.getInstance(
31-
appModule.android.currentContext || com.tns.NativeScriptApplication.getInstance()
31+
appModule.android.context || com.tns.NativeScriptApplication.getInstance()
3232
).logEvent(options.key, bundle);
3333

3434
resolve();

src/firebase.android.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ firebase.init = arg => {
314314
initializeArguments = arg;
315315

316316
com.google.firebase.analytics.FirebaseAnalytics.getInstance(
317-
appModule.android.currentContext || com.tns.NativeScriptApplication.getInstance()
317+
appModule.android.context || com.tns.NativeScriptApplication.getInstance()
318318
).setAnalyticsCollectionEnabled(arg.analyticsCollectionEnabled !== false);
319319

320320
if (typeof (com.google.firebase.database) !== "undefined" && typeof (com.google.firebase.database.ServerValue) !== "undefined") {
@@ -1114,7 +1114,7 @@ firebase.login = arg => {
11141114

11151115
const signInIntent = com.google.android.gms.auth.api.Auth.GoogleSignInApi.getSignInIntent(firebase._mGoogleApiClient);
11161116

1117-
appModule.android.currentContext.startActivityForResult(signInIntent, GOOGLE_SIGNIN_INTENT_ID);
1117+
appModule.android.context.startActivityForResult(signInIntent, GOOGLE_SIGNIN_INTENT_ID);
11181118

11191119
const callback = (eventData: AndroidActivityResultEventData) => {
11201120
if (eventData.requestCode === GOOGLE_SIGNIN_INTENT_ID) {

0 commit comments

Comments
 (0)