Repository navigation
fix(android): read current activity from ReactApplicationContext - #22
Open
martintreurnicht wants to merge 1 commit into
Open
martintreurnicht wants to merge 1 commit into
martintreurnicht wants to merge 1 commit into
Conversation
ShakeModule.kt read the inherited currentActivity property in four places, which no longer compiles on React Native 0.88. Read it from the module's ReactApplicationContext instead, as RN's deprecation of getCurrentActivity() suggests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Member
|
Thank you, we have applied the fix and will release the patch soon. |
Author
|
Thanks! We'll drop our local patch once that release is out. |
Member
|
@martintreurnicht 18.0.1 version is released and it should fix this issue. Let us know if it works for you now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ShakeModule.ktreads the inheritedcurrentActivityproperty in four places:start,addPrivateView,removePrivateViewandshowNotificationsSettings. With React Native 0.88 (Expo SDK 58, Kotlin 2.2) the module no longer compiles there. OnReactContextBaseJavaModule,getCurrentActivity()is a deprecated Kotlin function, and React Native recommendsreactApplicationContext.currentActivityinstead. 17.2.2 built fine on React Native 0.86.3 (Kotlin 2.1.20). 18.0.0 andmasterstill have the same four reads.This change reads the activity from the module's
ReactApplicationContext, which works on every React Native version the SDK supports. react-native-datetimepicker fixed the same break the same way (react-native-datetimepicker/datetimepicker#1002).To reproduce: add
@shakebugs/react-native-shaketo a React Native 0.88 app and run./gradlew :app:assembleDebug. The build fails inShakeModule.kt.We've been shipping this change as a local patch on React Native 0.88.
🤖 Generated with Claude Code