Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Transcend Consent UI React Native architecture examples

This repository contains two native Expo development-build apps for testing @transcend-io/cm-mobile-ui-react-native from the local package.tgz against both React Native architectures.

App Expo React Native Architecture
apps/legacy SDK 51 0.75 Legacy (Paper/Bridge)
apps/new-architecture SDK 55 0.83 New Architecture (Fabric/TurboModules)

Shared demo UI lives in src/:

  • src/TranscendDemoApp.tsx — consent provider shell
  • src/components/FloatingButton.tsx
  • src/components/ArchitectureBadge.tsx
  • src/screens/Demostore.tsx — full demo store UI

Each app’s App.tsx imports that shared source directly. The in-app badge auto-detects and displays either Legacy Architecture or New Architecture.

React Native 0.82 removed the option to disable the New Architecture. The legacy app uses RN 0.75 (the SDK's minimum, via Expo SDK 51's opt-in RN 0.75 support) with newArchEnabled: false. The RN 0.83 app is always on the New Architecture.

Prerequisites

  • Node.js 20.19 or newer
  • Yarn 4.11 through Corepack
  • iOS: Xcode 16.1 or newer and CocoaPods
  • Android: Android Studio/SDK and JDK 17

Install both dependency sets from the repository root:

corepack enable
yarn install

Yarn is configured with nmHoistingLimits: workspaces so Expo 51 and Expo 55 do not share one metro install. The SDK 51 CLI still requires metro/src/lib/TerminalReporter, which Metro 0.83 no longer exports.

The apps have different native bundle/application IDs, so they can be installed on the same simulator or device without sharing app storage.

Legacy Architecture: Expo 51 / RN 0.75

SDK 51 defaults to RN 0.74. This app opts into RN 0.75.5, which is the oldest version the Consent SDK supports (spm_dependency / Swift Package Manager).

Generate a clean native project and run it:

yarn prebuild:legacy
yarn ios:legacy
# or
yarn android:legacy

The Expo config explicitly sets newArchEnabled to false. After prebuild, confirm that Expo propagated the setting:

rg '^newArchEnabled=false$' apps/legacy/android/gradle.properties
rg "ENV\\['RCT_NEW_ARCH_ENABLED'\\]" apps/legacy/ios/Podfile

The in-app badge must report Legacy Architecture.

New Architecture: Expo 55 / RN 0.83

Generate a clean native project and run it:

yarn prebuild:new
yarn ios:new
# or
yarn android:new

RN 0.83 only supports the New Architecture; there is no opt-out setting in this app. The in-app badge must report New Architecture.

Validation

Run static checks for both apps:

yarn check:deps
yarn typecheck

Build all native variants without launching Metro:

yarn build:ios:legacy
yarn build:ios:new
yarn build:android:legacy
yarn build:android:new

Exercise this checklist on both iOS and Android for each app:

  1. Confirm the architecture badge reports the expected architecture for that app.
  2. On a clean install, confirm the consent manager opens automatically.
  3. Save a consent choice and confirm the manager closes without an SDK error.
  4. Confirm the tracker status text updates when io.transcend.test.tracker is allowed.
  5. Reopen the manager with the floating lock button and change the choice.
  6. Restart the app and confirm the saved choice persists.
  7. Check native and Metro logs for [ConsentSDK] errors.

A build or runtime failure in only one app is a compatibility finding. Do not change that app's architecture setting to make the test pass.

iOS workarounds

scripts/ios/prevent_spm_uuid_collision.rb is loaded only by the new-architecture Podfile. It is not required for the legacy RN 0.75 app:

  • The SPM UUID collision (facebook/react-native#57576) overwrote Pods.xcodeproj on RN 0.81 + Expo 54. On Expo 51 / RN 0.75, repeated pod install keeps a distinct Swift-package UUID (46EB2E000253F0) and an intact PBXProject.
  • The Xcode 26 fmt consteval failure is specific to fmt 11.0.2 (RN 0.81 / 0.83). RN 0.75 vendors fmt 9.1.0, which compiles as C++20.

The new-architecture app still applies both workarounds because it uses RN 0.83 on Xcode 26.

Expo 51 / RN 0.75 on Xcode 26 also needs two legacy-app-specific fixes that are not the RN 0.81 UUID/fmt patches:

  • expo-dev-menu@5.0.23 still references TARGET_IPHONE_SIMULATOR, which Xcode 26 no longer exposes. apps/legacy/scripts/patch-expo-dev-menu.js runs on postinstall and replaces that check with targetEnvironment(simulator).
  • The Transcend Headless Android AAR requires minSdk 24. Expo 51 defaults to 23, so expo-build-properties raises it.
  • RN 0.75's ReactModuleInfo still requires the hasConstants argument. The SDK package uses the newer 6-parameter constructor, so the same postinstall script rewrites that call for the legacy app only.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages