Skip to content

Commit 7aca8c0

Browse files
Merge pull request #75 from frontegg/use-reactApplicationContext.currentActivity
added uses of reactApplicationContext for activities
2 parents 851a9ee + f069b2b commit 7aca8c0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

android/src/main/java/com/frontegg/reactnative/FronteggRNModule.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class FronteggRNModule(val reactContext: ReactApplicationContext) :
120120

121121
@ReactMethod
122122
fun login(loginHint: String?, promise: Promise) {
123-
val activity = currentActivity
123+
val activity = reactApplicationContext.currentActivity
124124
auth.login(activity!!, loginHint) {
125125
promise.resolve("")
126126
}
@@ -135,7 +135,7 @@ class FronteggRNModule(val reactContext: ReactApplicationContext) :
135135

136136
@ReactMethod
137137
fun directLoginAction(type: String, data: String, ephemeralSession: Boolean, promise: Promise) {
138-
val activity = currentActivity
138+
val activity = reactApplicationContext.currentActivity
139139
auth.directLoginAction(activity!!, type, data)
140140
promise.resolve(true)
141141
}
@@ -148,7 +148,7 @@ class FronteggRNModule(val reactContext: ReactApplicationContext) :
148148

149149
@ReactMethod
150150
fun loginWithPasskeys(promise: Promise) {
151-
val activity = currentActivity
151+
val activity = reactApplicationContext.currentActivity
152152
auth.loginWithPasskeys(activity!!) { error ->
153153
if (error != null) {
154154
promise.reject(error)
@@ -180,7 +180,7 @@ class FronteggRNModule(val reactContext: ReactApplicationContext) :
180180

181181
@ReactMethod
182182
fun registerPasskeys(promise: Promise) {
183-
val activity = currentActivity
183+
val activity = reactApplicationContext.currentActivity
184184
auth.registerPasskeys(activity!!) { error ->
185185
if (error != null) {
186186
promise.reject(error)

0 commit comments

Comments
 (0)