Skip to content

Conversation

@camrun91
Copy link
Collaborator

@camrun91 camrun91 commented Jan 27, 2026

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

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
Copy link

greptile-apps bot commented Jan 27, 2026

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

Copy link

@greptile-apps greptile-apps bot left a comment

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

@camrun91 camrun91 changed the title fix: builds working YPE-1168 - Fix react native example app builds Jan 27, 2026
@camrun91
Copy link
Collaborator Author

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

Copy link

@greptile-apps greptile-apps bot left a comment

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

@camrun91
Copy link
Collaborator Author

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

Copy link

@greptile-apps greptile-apps bot left a comment

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

@camrun91
Copy link
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.

Copy link
Collaborator

@bmanquen bmanquen left a comment

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
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?

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