Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Iterable's React Native SDK relies on:
```ruby
use_frameworks! :linkage => :dynamic
```
- **Xcode 27:** `run-ios` needs `@react-native-community/cli` **20.2.0+** so it opens Device Hub (`DeviceHub.app`) instead of `Simulator.app`. `xcode-select` must point at the Xcode you are using when more than one version is installed. Xcode 27 also refuses CocoaPods resource-bundle targets below iOS **15.0** (this SDK's `IterableSDKResources` bundle still inherits **12.0** from Iterable-iOS-SDK 6.6.7). Lift generated Pods targets to **15.1** in the app `Podfile` `post_install` β€” see this repo's `example/ios/Podfile`. That is a **host** workaround until Iterable's iOS SDK publishes a β‰₯ 15.1 minimum and this SDK depends on it. It does not change the published Iterable iOS support range.

- **Android**
- [`minSdkVersion` 21+, `compileSdkVersion` 31+](https://medium.com/androiddevelopers/picking-your-compilesdkversion-minsdkversion-targetsdkversion-a098a0341ebd)
Expand Down
50 changes: 17 additions & 33 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,15 @@ React Native application.
>"Creating a new application" step, before proceeding.

## Step 1: Install dependencies
To install the app dependencies, run the following command from the
_example app directory_ (the directory in which this document resides):

```bash
yarn install
```

Once this is done, you will need to install the pods in the _ios_ folder in the
_example app directory_. To do so, run the following:
From the **SDK repo root** (the parent of this `example/` directory):

```bash
cd ios
bundle install
bundle exec pod install
yarn install
(cd example/ios && bundle install && bundle exec pod install)
```

Once this is done, `cd` back into the _example app directory_:

```bash
cd ..
```
`yarn install` at the root installs the Yarn workspace (SDK + example). The `example/ios` step is **iOS only** β€” skip it if you are only running Android.

## Step 2: Add your environment variables
In the _example app directory_, there is a file called **.env.example**. Make a
Expand Down Expand Up @@ -69,36 +57,26 @@ To add an API key, do the following:
6. Copy the generated API key and JWT secret into your _.env_ file


## Step 3: Start the Metro Server
## Step 3: Start your Application

First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.

To start Metro, run the following command from the _example app directory_:
From the **SDK repo root**, run one of:

```bash
yarn start
yarn example android
```

## Step 4: Start your Application

Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _example app directory_. Run the following command to start your _Android_ or _iOS_ app:

### For Android

```bash
yarn android
yarn example ios
```

### For iOS
`run-android` / `run-ios` start **Metro** in a separate terminal by default. You do not need to run `yarn start` first. Pass `--no-packager` if you already have Metro running and do not want a second window.

```bash
yarn ios
```
On **Xcode 27**, the CLI opens **Device Hub** (`DeviceHub.app`) instead of Simulator. This example pins `@react-native-community/cli` **20.2.0+** for that path. If several Xcode versions are installed, `xcode-select -p` must point at the one you intend to use.

**NOTE**: If you are getting an error when running ios, make sure that *Xcode > Project Navigator > ReactNativeSdkExample > Build Settings > User
Script Sandboxing* is set to **No**

If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or on iOS (Simulator on Xcode 26 and earlier, Device Hub on Xcode 27) shortly provided you have set up your emulator/simulator correctly.

This is one way to run your app β€” you can also run it directly from within Android Studio and Xcode respectively.

Expand Down Expand Up @@ -218,6 +196,12 @@ gem install xcodeproj -v '< 1.26.0'
gem install concurrent-ruby -v '< 1.3.4'
```

## Xcode 27

Xcode 27 replaces `Simulator.app` with Device Hub. `yarn ios` / `yarn example ios` require `@react-native-community/cli` **20.2.0+** (this example already pins it). A `Simulator.app does not exist` error means an older CLI is still on the path, or `xcode-select` points at a different Xcode.

Xcode 27's iOS SDK also rejects any target with `IPHONEOS_DEPLOYMENT_TARGET` below **15.0**, including CocoaPods resource bundles such as `Iterable-iOS-SDK-IterableSDKResources` (12.0 from Iterable-iOS-SDK 6.6.7). This example's `ios/Podfile` `post_install` lifts generated Pods targets to **15.1**. Copy that lift into a host app Podfile if you hit the same `xcodebuild` 65 error. It does not change Iterable-iOS-SDK's published minimum; that wait is a later iOS SDK release and an RN pin off 6.6.7.

## Xcode 16.3 Issue

There is a [known issue](https://github.com/facebook/react-native/issues/50411)
Expand Down
15 changes: 10 additions & 5 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,22 @@ target 'ReactNativeSdkExample' do
)


## Temporary workaround for Xcode 26.4
# Temporary workaround for Xcode 26.x / 27.
# fmt 11.0.2 fails consteval checks under Apple Clang 21; compile fmt as C++17 only.
# All other pods stay in C++20 (React-perflogger needs std::unordered_map::contains).
# Xcode 27 rejects Pods resource-bundle targets below iOS 15.0 (e.g.
# Iterable-iOS-SDK-IterableSDKResources at 12.0). Lift those generated targets
# to RN's min; do not change published podspec support ranges.
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# fmt/base.h unconditionally redefines FMT_USE_CONSTEVAL based on __cplusplus,
# so preprocessor defines are overwritten. The reliable fix is to compile fmt
# in C++17 mode: FMT_CPLUSPLUS (201703L) < 201709L β†’ FMT_USE_CONSTEVAL = 0.
# All other pods stay in C++20 (React-perflogger needs std::unordered_map::contains).
if target.name == 'fmt'
config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17'
end

current = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
if current.nil? || current.to_f < 15.1
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.1'
end
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "20.1.0",
"@react-native-community/cli-platform-android": "20.1.0",
"@react-native-community/cli-platform-ios": "20.1.0",
"@react-native-community/cli": "20.2.0",
"@react-native-community/cli-platform-android": "20.2.0",
"@react-native-community/cli-platform-ios": "20.2.0",
"@react-native/babel-preset": "0.85.3",
"@react-native/eslint-config": "0.85.3",
"@react-native/jest-preset": "0.85.3",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"devDependencies": {
"@commitlint/config-conventional": "^19.6.0",
"@evilmartians/lefthook": "^1.5.0",
"@react-native-community/cli": "20.1.0",
"@react-native-community/cli": "20.2.0",
"@react-native/babel-preset": "0.85.3",
"@react-native/eslint-config": "0.85.3",
"@react-native/jest-preset": "0.85.3",
Expand Down
Loading
Loading