Skip to content

feat: Simplify android age mocking#10

Merged
Gautham495 merged 2 commits intoGautham495:mainfrom
fredrifoUni:expose-android-age-signal-mock
Feb 6, 2026
Merged

feat: Simplify android age mocking#10
Gautham495 merged 2 commits intoGautham495:mainfrom
fredrifoUni:expose-android-age-signal-mock

Conversation

@fredrifoUni
Copy link

This PR simplifies the Android age mocking and makes it configurable from anywhere in the native code

Example:

// MainActivity.kt
import com.margelo.nitro.playagerangedeclaration.PlayAgeRangeDeclaration
import com.margelo.nitro.playagerangedeclaration.PlayAgeRangeMockConfig

override fun onCreate() {
      ....
      PlayAgeRangeDeclaration.setMockUser(
        PlayAgeRangeMockConfig(
          userStatus = 1,
          ageLower = 13,
          ageUpper = 16,
        )
      )
}

Notes to keep in mind before merging:

  • I have only tested the code by modifying it directly in my node_modules folder
  • I haven't ran the nitro build script and I don't know if my changes will cause any issues with it.
  • I have not bridged any of this code. Hopefully someone experienced with nitro can pick that up at some point.

Fredrik Forsell added 2 commits February 4, 2026 13:00
feat: transition to using companion object for age signal mocking

feat: fix unsafe non-null assertion

refactor: update comments and naming
@Gautham495 Gautham495 merged commit bf35f8a into Gautham495:main Feb 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants