Skip to content

Commit e5bbfb1

Browse files
authored
fix(android): use reactApplicationContext.currentActivity (#69)
`ReactContextBaseJavaModule.getCurrentActivity()` was made `protected` and `@Deprecated` in React Native 0.80+ (the recommendation in the deprecation message is to use `reactApplicationContext.currentActivity` directly). In RN 0.80 with Kotlin compiling against the updated Java stub, the Kotlin-inherited property syntax `currentActivity` no longer resolves at the subclass level — the compiler emits `Cannot access 'getCurrentActivity': it is protected/protected and package/package in 'ReactContextBaseJavaModule'` or, depending on the toolchain version, a runtime crash on the `auth.login(activity!!, ...)` call site. Switching to `reactApplicationContext.currentActivity` (the property the deprecation message recommends) restores the behaviour on RN 0.80+ and leaves older RN versions functionally identical, since `reactApplicationContext` was already used elsewhere in the file (see `getName()` / `auth` getter). Affected entry points: `login`, `directLoginAction`, `loginWithPasskeys`, `registerPasskeys` (4 sites).
1 parent a1e8eb9 commit e5bbfb1

0 file changed

File tree

    0 commit comments

    Comments
     (0)