Skip to content

Commit 7974d2e

Browse files
rlepinskicrow
andauthored
Release 22.0.0 (#629)
* Patch * WIP * WIP * WIP * Fix * Fix new module * Fix gradle file * Fix * Fix * Bump version * Add pods * Try to fix Android old arch * Update ci to test both old arch for both * Update Android * Update to latest proxy * Update * Fix pods script * WIP * Fix old arch on iOS * Live activities, widget and service extension wip * Link plugin extender and clean up pbxproj * Add and pod install service extension * Uncomment the notification service extension * Add push capability to example * Remove added listAll methods * Add supports LA * Fix target version * Update CHANGELOG * Update CHANGELOG --------- Co-authored-by: David <[email protected]>
1 parent 53101b9 commit 7974d2e

File tree

149 files changed

+15369
-19881
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+15369
-19881
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
indent_style = space
10+
indent_size = 2
11+
12+
end_of_line = lf
13+
charset = utf-8
14+
trim_trailing_whitespace = true
15+
insert_final_newline = true

.github/workflows/ci.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on: [pull_request]
44

55
jobs:
6-
test:
6+
test-new-arch:
77
runs-on: macos-15-xlarge
88
steps:
99
- uses: actions/checkout@v4
@@ -34,7 +34,7 @@ jobs:
3434
- run: bash ./scripts/run_ci_tasks.sh -i
3535
- run: bash ./scripts/run_ci_tasks.sh -a
3636

37-
test-android-old-arch:
37+
test-old-arch:
3838
runs-on: macos-15-xlarge
3939
steps:
4040
- uses: actions/checkout@v4
@@ -60,7 +60,8 @@ jobs:
6060
with:
6161
node-version-file: .nvmrc
6262
cache: 'npm'
63-
63+
64+
- run: sed -i '' "s/ENV\['RCT_NEW_ARCH_ENABLED'\] = '1'/ENV\['RCT_NEW_ARCH_ENABLED'\] = '0'/g" example/ios/Podfile
6465
- run: sed -i '' 's/newArchEnabled=true/newArchEnabled=false/' example/android/gradle.properties
6566
- run: npm run bootstrap
6667
- run: bash ./scripts/run_ci_tasks.sh -a

.gitignore

+48-25
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
#
33
.DS_Store
44

5-
.cxx/*
5+
# XDE
6+
.expo/
7+
8+
# VSCode
9+
.vscode/
10+
jsconfig.json
11+
612
# Xcode
713
#
814
build/
@@ -22,42 +28,59 @@ DerivedData
2228
*.ipa
2329
*.xcuserstate
2430
project.xcworkspace
31+
**/.xcode.env.local
32+
33+
# Android/IJ
34+
#
35+
.classpath
36+
.cxx
37+
.gradle
38+
.idea
39+
.project
40+
.settings
41+
local.properties
42+
android.iml
2543

2644
# Cocoapods
27-
Pods/
45+
#
46+
example/ios/Pods
2847

29-
# Carthage
30-
Carthage/
48+
# Ruby
49+
example/vendor/
3150

3251
# node.js
3352
#
3453
node_modules/
3554
npm-debug.log
55+
yarn-debug.log
56+
yarn-error.log
3657

37-
# Android
38-
local.properties
39-
build.properties
40-
airshipconfig.properties
41-
.gradle
42-
.idea
43-
google-services.json
58+
# BUCK
59+
buck-out/
60+
\.buckd/
61+
android/app/libs
62+
android/keystores/debug.keystore
63+
64+
# Yarn
65+
.yarn/*
66+
!.yarn/patches
67+
!.yarn/plugins
68+
!.yarn/releases
69+
!.yarn/sdks
70+
!.yarn/versions
4471

45-
# iOS
46-
AirshipConfig.plist
72+
# Expo
73+
.expo/
4774

48-
# Docs
49-
docs/
75+
# Turborepo
76+
.turbo/
5077

51-
# Typescript
78+
# generated by bob
5279
lib/
5380

54-
# Yarn
55-
yarn-error.log
56-
57-
# Etc
58-
*.orig
59-
*.swo
60-
*.swp
61-
*.iml
81+
# React Native Codegen
82+
ios/generated
83+
android/generated
6284

63-
.jest/*
85+
# React Native Nitro Modules
86+
nitrogen/

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# React Native Module Changelog
22

3+
## Version 22.0.0 - March 11, 2025
4+
5+
Major release that regenerates the plugin for React Native 0.78 and updates Android SDK.
6+
7+
### Changes
8+
- Update plugin to be compatible with React Native 0.78
9+
- Updated Android SDK to [19.3.0](https://github.com/urbanairship/android-library/releases/tag/19.3.0)
10+
311
## Version 21.2.0 - February 24, 2025
412
Patch release that updates the Android SDK to 19.2.0 and the iOS SDK to 19.1.0.
513

android/build.gradle

+22-28
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,44 @@
11
import groovy.json.JsonSlurper
22

33
buildscript {
4-
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
5-
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["Airship_kotlinVersion"]
4+
ext.getExtOrDefault = {name ->
5+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['Airship_' + name]
6+
}
67

78
repositories {
89
google()
910
mavenCentral()
1011
}
1112

1213
dependencies {
13-
classpath "com.android.tools.build:gradle:7.2.1"
14+
classpath "com.android.tools.build:gradle:8.7.2"
1415
// noinspection DifferentKotlinGradleVersion
15-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
16+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
1617
}
1718
}
1819

20+
1921
def isNewArchitectureEnabled() {
2022
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
2123
}
2224

23-
def isHmsEnabled() {
24-
return (rootProject.hasProperty("airshipHmsEnabled") && rootProject.getProperty("airshipHmsEnabled") == "true") || (rootProject.ext.has("airshipHmsEnabled") && rootProject.ext.get("airshipHmsEnabled") == "true")
25-
}
26-
27-
2825
apply plugin: "com.android.library"
2926
apply plugin: "kotlin-android"
3027

3128
if (isNewArchitectureEnabled()) {
3229
apply plugin: "com.facebook.react"
3330
}
3431

35-
def getExtOrDefault(name) {
36-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["Airship_" + name]
37-
}
38-
3932
def getExtOrIntegerDefault(name) {
4033
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Airship_" + name]).toInteger()
4134
}
4235

36+
def isHmsEnabled() {
37+
return (rootProject.hasProperty("airshipHmsEnabled") && rootProject.getProperty("airshipHmsEnabled") == "true") || (rootProject.ext.has("airshipHmsEnabled") && rootProject.ext.get("airshipHmsEnabled") == "true")
38+
}
4339

4440
android {
41+
namespace "com.urbanairship.reactnative"
4542
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
4643

4744
defaultConfig {
@@ -52,6 +49,10 @@ android {
5249
consumerProguardFiles 'proguard-rules.pro'
5350
}
5451

52+
buildFeatures {
53+
buildConfig true
54+
}
55+
5556
buildTypes {
5657
release {
5758
minifyEnabled false
@@ -70,26 +71,23 @@ android {
7071
sourceSets {
7172
main {
7273
if (isNewArchitectureEnabled()) {
73-
java.srcDirs += [
74-
"src/newarch/java",
75-
// This is needed to build Kotlin project with NewArch enabled
76-
"${project.buildDir}/generated/source/codegen/java"
77-
]
74+
java.srcDirs += [
75+
"src/newarch/java",
76+
"generated/java",
77+
"generated/jni"
78+
]
7879
} else {
79-
java.srcDirs += ["src/oldarch/java"]
80+
java.srcDirs += ["src/oldarch/java"]
8081
}
8182
}
8283
}
83-
84-
namespace 'com.urbanairship.reactnative'
8584
}
8685

8786
repositories {
8887
mavenCentral()
8988
google()
9089
}
9190

92-
9391
def getModuleVersion() {
9492
def jsonFile = file('../package.json')
9593
def parsedJson = new JsonSlurper().parseText(jsonFile.text)
@@ -99,17 +97,13 @@ def getModuleVersion() {
9997

10098
def kotlin_version = getExtOrDefault("kotlinVersion")
10199
def proxy_version = getExtOrDefault("airshipProxyVersion")
102-
def airship_version = getExtOrDefault("airshipVersion")
103100

104101
dependencies {
105-
// For < 0.71, this will be from the local maven repo
106-
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
107-
//noinspection GradleDynamicVersion
108-
implementation "com.facebook.react:react-native:+"
102+
implementation "com.facebook.react:react-android"
109103
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
110104

111105
api "com.urbanairship.android:airship-framework-proxy:$proxy_version"
112-
106+
113107
if (isHmsEnabled()) {
114108
implementation "com.urbanairship.android:airship-framework-proxy-hms:$proxy_version"
115109
}

android/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ Airship_minSdkVersion=23
33
Airship_targetSdkVersion=35
44
Airship_compileSdkVersion=35
55
Airship_ndkversion=26.1.10909125
6-
Airship_airshipProxyVersion=13.1.0
6+
Airship_airshipProxyVersion=13.2.0

android/src/main/java/com/urbanairship/reactnative/AirshipModule.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ class AirshipModule internal constructor(val context: ReactApplicationContext) :
825825
}
826826

827827
companion object {
828-
const val NAME = "RTNAirship"
828+
const val NAME = "RNAirship"
829829
}
830830

831831
}

android/src/main/java/com/urbanairship/reactnative/ReactEmbeddedViewManager.kt

+19-10
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,31 @@ import com.facebook.react.uimanager.SimpleViewManager
66
import com.facebook.react.uimanager.ThemedReactContext
77
import com.facebook.react.uimanager.ViewManagerDelegate
88
import com.facebook.react.uimanager.annotations.ReactProp
9-
import com.facebook.react.viewmanagers.RTNAirshipEmbeddedViewManagerDelegate
10-
import com.facebook.react.viewmanagers.RTNAirshipEmbeddedViewManagerInterface
11-
9+
import com.facebook.react.viewmanagers.RNAirshipEmbeddedViewManagerInterface
1210

1311
class ReactEmbeddedViewManager : SimpleViewManager<ReactEmbeddedView>(),
14-
RTNAirshipEmbeddedViewManagerInterface<ReactEmbeddedView> {
12+
RNAirshipEmbeddedViewManagerInterface<ReactEmbeddedView> {
13+
14+
private val manualDelegate = object : ViewManagerDelegate<ReactEmbeddedView> {
1515

16-
private val delegate = RTNAirshipEmbeddedViewManagerDelegate(this)
16+
override fun setProperty(view: ReactEmbeddedView, propName: String?, value: Any?) {
17+
when (propName) {
18+
"embeddedId" -> setEmbeddedId(view, value as? String)
19+
else -> {}
20+
}
21+
}
22+
23+
override fun receiveCommand(view: ReactEmbeddedView, commandName: String?, args: com.facebook.react.bridge.ReadableArray?) {
24+
// No commands supported — add if you need any
25+
}
26+
}
1727

1828
override fun getName(): String {
1929
return REACT_CLASS
2030
}
2131

22-
override fun getDelegate(): ViewManagerDelegate<ReactEmbeddedView?> {
23-
return delegate
32+
override fun getDelegate(): ViewManagerDelegate<ReactEmbeddedView> {
33+
return manualDelegate
2434
}
2535

2636
override fun createViewInstance(reactContext: ThemedReactContext): ReactEmbeddedView {
@@ -34,8 +44,7 @@ class ReactEmbeddedViewManager : SimpleViewManager<ReactEmbeddedView>(),
3444
}
3545
}
3646

37-
3847
companion object {
39-
const val REACT_CLASS = "RTNAirshipEmbeddedView"
48+
const val REACT_CLASS = "RNAirshipEmbeddedView"
4049
}
41-
}
50+
}

android/src/main/java/com/urbanairship/reactnative/ReactMessageViewManager.kt

+19-7
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,31 @@ import com.facebook.react.uimanager.SimpleViewManager
77
import com.facebook.react.uimanager.ThemedReactContext
88
import com.facebook.react.uimanager.ViewManagerDelegate
99
import com.facebook.react.uimanager.annotations.ReactProp
10+
import com.facebook.react.viewmanagers.RNAirshipMessageViewManagerInterface
11+
import com.facebook.react.bridge.ReadableArray
1012

11-
import com.facebook.react.viewmanagers.RTNAirshipMessageViewManagerDelegate
12-
import com.facebook.react.viewmanagers.RTNAirshipMessageViewManagerInterface
13+
class ReactMessageViewManager : SimpleViewManager<ReactMessageView>(),
14+
RNAirshipMessageViewManagerInterface<ReactMessageView> {
1315

14-
class ReactMessageViewManager : SimpleViewManager<ReactMessageView>(), RTNAirshipMessageViewManagerInterface<ReactMessageView> {
16+
private val delegate = object : ViewManagerDelegate<ReactMessageView> {
1517

16-
private val delegate = RTNAirshipMessageViewManagerDelegate(this)
18+
override fun setProperty(view: ReactMessageView, propName: String?, value: Any?) {
19+
when (propName) {
20+
"messageId" -> setMessageId(view, value as? String)
21+
else -> {}
22+
}
23+
}
24+
25+
override fun receiveCommand(view: ReactMessageView, commandName: String?, args: ReadableArray?) {
26+
// No commands implemented, add if Airship adds some in future
27+
}
28+
}
1729

1830
override fun getName(): String {
1931
return REACT_CLASS
2032
}
2133

22-
override fun getDelegate(): ViewManagerDelegate<ReactMessageView?> {
34+
override fun getDelegate(): ViewManagerDelegate<ReactMessageView> {
2335
return delegate
2436
}
2537

@@ -75,6 +87,6 @@ class ReactMessageViewManager : SimpleViewManager<ReactMessageView>(), RTNAirshi
7587
}
7688

7789
companion object {
78-
const val REACT_CLASS = "RTNAirshipMessageView"
90+
const val REACT_CLASS = "RNAirshipMessageView"
7991
}
80-
}
92+
}

0 commit comments

Comments
 (0)