Skip to content

HEL-5183 new example app#72

Merged
salami merged 3 commits into
mainfrom
5183-new-example
Apr 18, 2026
Merged

HEL-5183 new example app#72
salami merged 3 commits into
mainfrom
5183-new-example

Conversation

@salami

@salami salami commented Apr 18, 2026

Copy link
Copy Markdown
Collaborator

Note

Low Risk
Changes are confined to documentation and the example/ app’s Expo/native build configuration; they should not affect the shipped SDK runtime, but may impact local example build tooling across RN/Expo versions.

Overview
Adds a new standalone Expo 51 example/ app that consumes the SDK via file:.. and demonstrates initialize, presentUpsell, entitlement checks, setCustomUserId, and resetHelium, with a new .env-driven configuration template.

Reworks the example’s native scaffolding to match Expo prebuild expectations: updates Android Gradle/manifest/settings for Expo autolinking and version-conditional RN behavior, updates iOS Podfile/Podfile.lock for Expo modules, and stops committing generated native folders (with docs on regenerating via expo prebuild --clean).

Simplifies example tooling by switching Babel/Metro config to Expo defaults and removing the prior RN CLI example artifacts (Ruby bundler files, Jest config, old entrypoints, and committed iOS project/workspace).

Reviewed by Cursor Bugbot for commit de1e823. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features

    • Added a fully functional example app demonstrating SDK initialization with API key, paywall presentation, entitlement checking, custom user ID management, and SDK reset functionality.
  • Documentation

    • Updated setup documentation to clarify build process and example app structure as a standalone Expo project with proper dependency configuration.
  • Bug Fixes

    • Improved thread-safety for internal continuation handling on iOS and Android to prevent race conditions during purchase and restore operations.

@coderabbitai

coderabbitai Bot commented Apr 18, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@salami has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 46 minutes and 1 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 46 minutes and 1 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 113660fc-2941-46b8-9cd9-e71cefdb7887

📥 Commits

Reviewing files that changed from the base of the PR and between 851e845 and de1e823.

⛔ Files ignored due to path filters (19)
  • example/Gemfile.lock is excluded by !**/*.lock
  • example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png is excluded by !**/*.png
  • example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png is excluded by !**/*.png
  • example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png is excluded by !**/*.png
  • example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png is excluded by !**/*.png
  • example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png is excluded by !**/*.png
  • example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png is excluded by !**/*.png
  • example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png is excluded by !**/*.png
  • example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png is excluded by !**/*.png
  • example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png is excluded by !**/*.png
  • example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png is excluded by !**/*.png
  • example/android/gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar
  • example/assets/adaptive-icon.png is excluded by !**/*.png
  • example/assets/favicon.png is excluded by !**/*.png
  • example/assets/icon.png is excluded by !**/*.png
  • example/assets/splash-icon.png is excluded by !**/*.png
  • example/ios/Podfile.lock is excluded by !**/*.lock
  • example/package-lock.json is excluded by !**/package-lock.json
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (47)
  • CLAUDE.md
  • example/.bundle/config
  • example/.env.example
  • example/.gitignore
  • example/.watchmanconfig
  • example/App.tsx
  • example/Gemfile
  • example/README.md
  • example/android/app/build.gradle
  • example/android/app/proguard-rules.pro
  • example/android/app/src/debug/AndroidManifest.xml
  • example/android/app/src/main/AndroidManifest.xml
  • example/android/app/src/main/java/paywallsdkreactnative/example/MainActivity.kt
  • example/android/app/src/main/java/paywallsdkreactnative/example/MainApplication.kt
  • example/android/app/src/main/res/values/strings.xml
  • example/android/app/src/main/res/values/styles.xml
  • example/android/build.gradle
  • example/android/gradle.properties
  • example/android/gradle/wrapper/gradle-wrapper.properties
  • example/android/gradlew
  • example/android/gradlew.bat
  • example/android/settings.gradle
  • example/app.config.js
  • example/app.json
  • example/babel.config.js
  • example/index.js
  • example/index.ts
  • example/ios/PaywallSdkReactNativeExample.xcodeproj/project.pbxproj
  • example/ios/PaywallSdkReactNativeExample.xcodeproj/xcshareddata/xcschemes/PaywallSdkReactNativeExample.xcscheme
  • example/ios/PaywallSdkReactNativeExample.xcworkspace/contents.xcworkspacedata
  • example/ios/PaywallSdkReactNativeExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  • example/ios/PaywallSdkReactNativeExample/AppDelegate.swift
  • example/ios/PaywallSdkReactNativeExample/Images.xcassets/AppIcon.appiconset/Contents.json
  • example/ios/PaywallSdkReactNativeExample/Images.xcassets/Contents.json
  • example/ios/PaywallSdkReactNativeExample/Info.plist
  • example/ios/PaywallSdkReactNativeExample/LaunchScreen.storyboard
  • example/ios/PaywallSdkReactNativeExample/PrivacyInfo.xcprivacy
  • example/ios/Podfile
  • example/jest.config.js
  • example/metro.config.js
  • example/package.json
  • example/react-native.config.js
  • example/src/App.tsx
  • example/src/demo-handlers.ts
  • example/src/rc-handlers.ts
  • example/tsconfig.json
  • package.json
📝 Walkthrough

Walkthrough

This pull request restructures the example app from a React Native CLI project to an Expo 51 standalone application and implements thread-safe continuation management in both Android and iOS SDKs. The example now consumes the SDK via a file:.. dependency and uses Expo's build system, while the SDK's purchase/restore continuation handling is refactored to use locks for atomic access instead of unsynchronized shared variables.

Changes

Cohort / File(s) Summary
SDK Continuation Management (Thread-Safe)
android/src/main/java/com/paywallsdkreactnative/HeliumBridge.kt, ios/HeliumSwiftInterface.swift
Replaced unsynchronized continuation storage with lock-guarded access. Added private backing variables, introduced atomic setter/getter/taker methods (setPurchaseContinuation/takePurchaseContinuation and restore equivalents), and updated result handlers to atomically consume continuations with lock protection.
Example App: Expo Configuration & New Entrypoint
example/app.json, example/babel.config.js, example/metro.config.js, example/package.json, example/index.ts, example/tsconfig.json, example/App.tsx
Converted example from React Native CLI to Expo 51. Replaced build configs to use expo/metro-config and babel-preset-expo. Added new index.ts entrypoint using registerRootComponent from Expo. Created new App.tsx demonstrating SDK initialization, paywall presentation, entitlement checks, and custom user ID management. Added tsconfig.json extending Expo's base config with strict mode.
Example App: Android Build System
example/android/app/build.gradle, example/android/build.gradle, example/android/gradle.properties, example/android/settings.gradle, example/android/gradle/wrapper/gradle-wrapper.properties, example/android/gradlew, example/android/gradlew.bat
Updated Gradle build system to use Expo CLI and conditional autolinking based on React Native version (≥0.75.0). Added Gradle properties for Expo features (GIF/WebP support, network inspector, min SDK 24). Changed Gradle wrapper to version 8.8. Updated shell scripts for build tooling.
Example App: Android Manifest & Resources
example/android/app/src/main/AndroidManifest.xml, example/android/app/src/debug/AndroidManifest.xml, example/android/app/src/main/res/values/strings.xml, example/android/app/src/main/res/values/styles.xml, example/android/app/proguard-rules.pro
Updated manifests to add permissions (SYSTEM_ALERT_WINDOW, READ/WRITE_EXTERNAL_STORAGE), intent-filters for Helium scheme, and portrait orientation. Updated app name to "Helium Paywall SDK Example". Added splash screen theme configuration and ProGuard rules for React Native modules.
Example App: Android Entry Points Removed
example/android/app/src/main/java/paywallsdkreactnative/example/MainActivity.kt, example/android/app/src/main/java/paywallsdkreactnative/example/MainApplication.kt
Deleted Android entry-point activities previously managing React Native bridge, component registration, and app lifecycle. Replaced by Expo's runtime management.
Example App: iOS Project Files Removed
example/ios/PaywallSdkReactNativeExample.xcodeproj/..., example/ios/PaywallSdkReactNativeExample.xcworkspace/..., example/ios/PaywallSdkReactNativeExample/AppDelegate.swift, example/ios/PaywallSdkReactNativeExample/Images.xcassets/..., example/ios/PaywallSdkReactNativeExample/Info.plist, example/ios/PaywallSdkReactNativeExample/LaunchScreen.storyboard, example/ios/PaywallSdkReactNativeExample/PrivacyInfo.xcprivacy
Removed entire Xcode project, workspace, and source files. Will be regenerated via expo prebuild --clean.
Example App: iOS Podfile
example/ios/Podfile
Updated to use Node-based dependency resolution for Expo/React Native pods. Added conditional autolinking based on EXPO_UNSTABLE_CORE_AUTOLINKING. Renamed target to HeliumPaywallSDKExample. Added Expo modules integration and post-install hooks. Enabled deterministic UUIDs and ccache settings.
Example App: Configuration Files Cleanup
example/.bundle/config, example/.watchmanconfig, example/Gemfile, example/jest.config.js, example/react-native.config.js, example/README.md, example/index.js
Removed Ruby/Bundler configuration (no longer needed for Expo), Jest config, React Native config, and old entrypoint. Updated README was deleted (will be regenerated).
Example App: Source Code Cleanup
example/src/App.tsx, example/src/demo-handlers.ts, example/src/rc-handlers.ts
Removed old React Native UI, demo callbacks, and RevenueCat integration handlers. Replaced with simplified Expo-based App.tsx.
Example App: New Configuration
example/.gitignore
Added comprehensive ignore patterns for node_modules, Expo outputs, native build artifacts, and generated iOS/Android folders.
Documentation & Root Config
CLAUDE.md, package.json
Updated CLAUDE.md to document yarn prepare building via react-native-builder-bob and added "Example app" section describing the standalone Expo 51 setup. Removed example workspace reference and example script from root package.json.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • HEL-5180 revamp ios to latest, using 4.3.0 sdk #68: Modifies iOS continuation storage and async handling in ios/HeliumSwiftInterface.swift, directly related to this PR's thread-safe continuation refactoring.
  • Interface updates #67: Updates purchase/restore method signatures and event handling in both Android and iOS bridge files, overlaps with continuation management changes.

Poem

🐰 Hops and builds with Expo's might,
Locks protect continuations tight,
Android, iOS both now safe,
Example app gets fresh new shape—
Prebuild clean, and off we flight!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The PR title "5183 new example app" is partially related to the changeset. It correctly identifies that a new example app was created, which is a significant component of the changes. However, the title is vague and lacks specificity—it uses minimal descriptive phrasing that doesn't clearly convey the main architectural changes (migration from traditional React Native to Expo, removal of legacy app infrastructure, modernization of build tooling) or the purpose of the example. Consider a more descriptive title such as "Migrate example app to Expo with modern build tooling" or "Refactor example app to use Expo SDK and remove legacy React Native setup" to better communicate the scope and intent of the extensive changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 5183-new-example

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d13966a. Configure here.

Comment thread example/app.json Outdated
@salami salami changed the title 5183 new example app HEL-5183 new example app Apr 18, 2026
@salami salami merged commit 00d4501 into main Apr 18, 2026
3 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.

1 participant