Skip to content

YPE-1168 - Fix react native example app builds#33

Closed
camrun91 wants to merge 5 commits into
mainfrom
YPE-1168-rn-get-example-apps-building
Closed

YPE-1168 - Fix react native example app builds#33
camrun91 wants to merge 5 commits into
mainfrom
YPE-1168-rn-get-example-apps-building

Conversation

@camrun91

@camrun91 camrun91 commented Jan 27, 2026

Copy link
Copy Markdown
Collaborator

Description

Update the example code and needed configs to successfully build and run.

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation update
  • refactor: Code refactoring (no functional changes)
  • perf: Performance improvement
  • test: Test additions or updates
  • build: Build system or dependency changes
  • ci: CI configuration changes
  • chore: Other changes (maintenance, etc.)

Checklist

  • My code follows the project's code style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • All commit messages follow conventional commits format
  • I have updated the appropriate section in documentation (if needed)

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@greptile-apps

greptile-apps Bot commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

Updated React Native SDK to support YouVersion Platform SDK 0.6.0, fixing build issues in the example app.

Key Changes

  • Android SDK upgrade: Platform dependencies upgraded from 0.5.0 to 0.6.0
  • PaginatedResponse workaround: Created reflection-based extension function to extract data from PaginatedResponse since the type cannot be imported directly
  • API fixes: Fixed YouVersionApi.languageYouVersionApi.languages and updated field mappings (copyrightLong/copyrightShortpromotionalContent/copyright, bookUSFM extraction from passageId)
  • Sign-in button updates: Added required permissions parameter and wrapped button in clickable Box
  • iOS userInfo simplification: Removed accessToken parameter, now uses SDK's current user properties
  • Build configuration: Moved Kotlin Compose plugin classpath outside conditional to fix build failures

Issues Found

  • extractPaginatedData() lacks error handling for reflection failures
  • bookUSFM extraction may not handle all passageId formats correctly
  • Sign-in button permissions hardcoded to PROFILE only (not configurable)

Confidence Score: 3/5

  • Safe to merge with minor fixes recommended for error handling
  • The changes successfully address SDK compatibility issues, but the reflection-based workaround lacks proper error handling which could cause runtime failures if the SDK structure changes. The field mapping updates appear correct but need validation for edge cases.
  • Pay close attention to PaginatedResponseExtensions.kt (needs error handling) and YVPRecords.kt (verify passageId parsing handles all formats)

Important Files Changed

Filename Overview
android/src/main/java/com/youversion/reactnativesdk/api/PaginatedResponseExtensions.kt New reflection-based extension to extract data from PaginatedResponse - lacks error handling
android/src/main/java/com/youversion/reactnativesdk/api/YVPBibleApi.kt Updated to use extractPaginatedData() extension instead of direct mapping
android/src/main/java/com/youversion/reactnativesdk/api/YVPLanguagesApi.kt Fixed API path from language to languages and uses extractPaginatedData()
android/src/main/java/com/youversion/reactnativesdk/api/YVPRecords.kt Updated field mappings for BibleVersion and BibleChapter to match SDK 0.6.0 - potential null handling issue
android/src/main/java/com/youversion/reactnativesdk/views/YVPSignInWithYouVersionButton.kt Updated button to require permissions parameter and wrapped in clickable Box

Sequence Diagram

sequenceDiagram
    participant RN as React Native App
    participant Module as RN Platform Module
    participant API as YVP API (Kotlin/Swift)
    participant SDK as YouVersion SDK 0.6.0

    Note over RN,SDK: Bible Versions API Flow (Android)
    RN->>Module: getBibleVersions(languageTag)
    Module->>API: YVPBibleApi.versions(languageTag)
    API->>SDK: YouVersionApi.bible.versions(languageTag)
    SDK-->>API: PaginatedResponse<BibleVersion>
    Note over API: Cannot import PaginatedResponse type
    API->>API: response.extractPaginatedData()
    Note over API: Uses reflection to access 'data' field
    API->>API: dataList.map { BibleVersionRecord(it) }
    API-->>Module: List<BibleVersionRecord>
    Module-->>RN: Bible versions array

    Note over RN,SDK: User Info API Flow (iOS)
    RN->>Module: getUserInfo()
    Note over Module: No accessToken param needed
    Module->>API: YVPAuthAPI.userInfo(promise)
    API->>SDK: YouVersionAPI.Users.currentUser*
    Note over SDK: Uses SDK's stored current user
    SDK-->>API: User properties
    API-->>Module: User info object
    Module-->>RN: User info

    Note over RN,SDK: Sign In Button (Android)
    RN->>Module: Render SignInButton
    Module->>API: YVPSignInWithYouVersionButton.Content()
    Note over API: Wraps button in clickable Box
    API->>SDK: SignInWithYouVersionButton(permissions)
    Note over SDK: Requires permissions parameter in 0.6.0
    SDK-->>API: Rendered button
    API-->>RN: Display button
Loading

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment thread android/src/main/java/com/youversion/reactnativesdk/RNYouVersionPlatformModule.kt Outdated
Comment thread android/build.gradle
@camrun91 camrun91 changed the title fix: builds working YPE-1168 - Fix react native example app builds Jan 27, 2026
@camrun91

Copy link
Copy Markdown
Collaborator Author

@greptileai This code has been updated can you review it again?

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment thread android/src/main/java/com/youversion/reactnativesdk/api/YVPBibleApi.kt Outdated
Comment thread android/src/main/java/com/youversion/reactnativesdk/api/YVPLanguagesApi.kt Outdated
Comment thread android/src/main/java/com/youversion/reactnativesdk/api/YVPRecords.kt Outdated
@camrun91

Copy link
Copy Markdown
Collaborator Author

@greptileai latest Push has some clean up and should be reviewed again.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment thread android/src/main/java/com/youversion/reactnativesdk/api/YVPRecords.kt Outdated
@camrun91

Copy link
Copy Markdown
Collaborator Author

@mic-mart @sidorchukandrew this builds for me and and this PR should be the minimum of what is needed for example apps to build.

@bmanquen bmanquen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious to see what @sidorchukandrew says about all of this as I am trying to learn more about Android and iOS.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something that we want to commit or is this just documented reasoning/information for us to read right now?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was just documentation I am going to work on removing it.

@sidorchukandrew

Copy link
Copy Markdown
Collaborator

This is PaginatedResponse business is certainly a real concern for when the Android devs release the next version of the SDK. I think the current version of the SDK returns plain Lists. Personally, I'd like to punt on handling the PaginatedResponse in our SDK until they release an official version with it. Maybe we can even modify something in their SDK to make it easier for us to work with the response.

Additionally, I've got a PR open to handle upgrading to version 0.6.0. How do you feel about making this PR just include the fix you discovered in the Swift file?

@camrun91

Copy link
Copy Markdown
Collaborator Author

This is PaginatedResponse business is certainly a real concern for when the Android devs release the next version of the SDK. I think the current version of the SDK returns plain Lists. Personally, I'd like to punt on handling the PaginatedResponse in our SDK until they release an official version with it. Maybe we can even modify something in their SDK to make it easier for us to work with the response.

Additionally, I've got a PR open to handle upgrading to version 0.6.0. How do you feel about making this PR just include the fix you discovered in the Swift file?

The reason I included the 6.0 upgrade and the paginated response stuff is so this or could get both iOS and android versions of the example app to build. I am open to other solves but this was the minimum I had to do to get it to build successfully

@sidorchukandrew

Copy link
Copy Markdown
Collaborator

@camrun91 Yes, I definitely hear you. That makes 100% sense. You could drop it from this PR and rebase off my PR/branch?

@camrun91

camrun91 commented Feb 2, 2026

Copy link
Copy Markdown
Collaborator Author

@camrun91 Yes, I definitely hear you. That makes 100% sense. You could drop it from this PR and rebase off my PR/branch?

Yep I will rebase now that your pr is in

Signed-off-by: Cameron Llewellyn <cameron.b.llewellyn@gmail.com>
@camrun91

camrun91 commented Feb 2, 2026

Copy link
Copy Markdown
Collaborator Author

@sidorchukandrew I am going to close this one and do one PR to fix the IOS stuff and then if another is needed for android I will put one up for it.

@camrun91 camrun91 closed this Feb 2, 2026
@camrun91 camrun91 deleted the YPE-1168-rn-get-example-apps-building branch February 2, 2026 20:04
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.

3 participants