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
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,13 @@ View the [API documentation](https://iterable-react-native-sdk.netlify.app).

## Architecture Support

Iterable's React Native SDK supports [React Native's New
Iterable's React Native SDK requires [React Native's New
Architecture](https://reactnative.dev/architecture/landing-page), including
TurboModules and Fabric.

**IMPORTANT**: Iterable's React Native SDK supports React Native's Legacy Architecture, but it
is no longer actively maintained. Use at your own risk.

Notes:

- Ensure your app is configured for New Architecture per the React Native docs.
- Ensure your app has New Architecture enabled per the React Native docs (`newArchEnabled=true` on Android, `RCT_NEW_ARCH_ENABLED=1` on iOS).
- The example app in this repository is configured with New Architecture enabled.

## Beta Versions
Expand Down
41 changes: 3 additions & 38 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,9 @@ buildscript {
}
}

def isNewArchitectureEnabled() {
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
}

apply plugin: "com.android.library"
apply plugin: "kotlin-android"

if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
apply plugin: "com.facebook.react"

def getExtOrDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["RNIterable_" + name]
Expand All @@ -34,32 +27,15 @@ def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["RNIterable_" + name]).toInteger()
}

def supportsNamespace() {
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
def major = parsed[0].toInteger()
def minor = parsed[1].toInteger()

// Namespace support was added in 7.3.0
return (major == 7 && minor >= 3) || major >= 8
}

android {
if (supportsNamespace()) {
namespace "com.iterable.reactnative"

sourceSets {
main {
manifest.srcFile "src/main/AndroidManifestNew.xml"
}
}
}
namespace "com.iterable.reactnative"

compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")

defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString())
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", "true")
}

buildFeatures {
Expand All @@ -81,16 +57,6 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

sourceSets {
main {
if (isNewArchitectureEnabled()) {
java.srcDirs += ['src/newarch']
} else {
java.srcDirs += ['src/oldarch']
}
}
}

// Add this to match the Iterable SDK group ID
group = "com.iterable"
}
Expand All @@ -108,4 +74,3 @@ dependencies {
api "com.iterable:iterableapi:3.6.2"
// api project(":iterableapi") // links to local android SDK repo rather than by release
}

3 changes: 1 addition & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.iterable.reactnative">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
2 changes: 0 additions & 2 deletions android/src/main/AndroidManifestNew.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ public ReactModuleInfoProvider getReactModuleInfoProvider() {
@Override
public Map<String, ReactModuleInfo> getReactModuleInfos() {
Map<String, ReactModuleInfo> moduleInfos = new HashMap<>();
boolean isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
moduleInfos.put(RNIterableAPIModuleImpl.NAME, new ReactModuleInfo(
RNIterableAPIModuleImpl.NAME,
RNIterableAPIModuleImpl.NAME,
false, // canOverrideExistingModule
false, // needsEagerInit
false, // isCxxModule
isTurboModule // isTurboModule
true // isTurboModule
));
return moduleInfos;
}
Expand Down
273 changes: 0 additions & 273 deletions android/src/oldarch/java/com/RNIterableAPIModule.java

This file was deleted.

1 change: 1 addition & 0 deletions example/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ gem 'bigdecimal'
gem 'logger'
gem 'benchmark'
gem 'mutex_m'
gem 'nkf'
Loading