Skip to content

Commit

Permalink
Release 22.0.0 (#629)
Browse files Browse the repository at this point in the history
* 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 <jdavidcrow@gmail.com>
  • Loading branch information
rlepinski and crow authored Mar 11, 2025
1 parent 53101b9 commit 7974d2e
Show file tree
Hide file tree
Showing 149 changed files with 15,369 additions and 19,881 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]

indent_style = space
indent_size = 2

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on: [pull_request]

jobs:
test:
test-new-arch:
runs-on: macos-15-xlarge
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
- run: bash ./scripts/run_ci_tasks.sh -i
- run: bash ./scripts/run_ci_tasks.sh -a

test-android-old-arch:
test-old-arch:
runs-on: macos-15-xlarge
steps:
- uses: actions/checkout@v4
Expand All @@ -60,7 +60,8 @@ jobs:
with:
node-version-file: .nvmrc
cache: 'npm'


- run: sed -i '' "s/ENV\['RCT_NEW_ARCH_ENABLED'\] = '1'/ENV\['RCT_NEW_ARCH_ENABLED'\] = '0'/g" example/ios/Podfile
- run: sed -i '' 's/newArchEnabled=true/newArchEnabled=false/' example/android/gradle.properties
- run: npm run bootstrap
- run: bash ./scripts/run_ci_tasks.sh -a
Expand Down
73 changes: 48 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
#
.DS_Store

.cxx/*
# XDE
.expo/

# VSCode
.vscode/
jsconfig.json

# Xcode
#
build/
Expand All @@ -22,42 +28,59 @@ DerivedData
*.ipa
*.xcuserstate
project.xcworkspace
**/.xcode.env.local

# Android/IJ
#
.classpath
.cxx
.gradle
.idea
.project
.settings
local.properties
android.iml

# Cocoapods
Pods/
#
example/ios/Pods

# Carthage
Carthage/
# Ruby
example/vendor/

# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log

# Android
local.properties
build.properties
airshipconfig.properties
.gradle
.idea
google-services.json
# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# iOS
AirshipConfig.plist
# Expo
.expo/

# Docs
docs/
# Turborepo
.turbo/

# Typescript
# generated by bob
lib/

# Yarn
yarn-error.log

# Etc
*.orig
*.swo
*.swp
*.iml
# React Native Codegen
ios/generated
android/generated

.jest/*
# React Native Nitro Modules
nitrogen/
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# React Native Module Changelog

## Version 22.0.0 - March 11, 2025

Major release that regenerates the plugin for React Native 0.78 and updates Android SDK.

### Changes
- Update plugin to be compatible with React Native 0.78
- Updated Android SDK to [19.3.0](https://github.com/urbanairship/android-library/releases/tag/19.3.0)

## Version 21.2.0 - February 24, 2025
Patch release that updates the Android SDK to 19.2.0 and the iOS SDK to 19.1.0.

Expand Down
50 changes: 22 additions & 28 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,47 +1,44 @@
import groovy.json.JsonSlurper

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

repositories {
google()
mavenCentral()
}

dependencies {
classpath "com.android.tools.build:gradle:7.2.1"
classpath "com.android.tools.build:gradle:8.7.2"
// noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
}
}


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

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


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

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

def getExtOrDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["Airship_" + name]
}

def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Airship_" + name]).toInteger()
}

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

android {
namespace "com.urbanairship.reactnative"
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")

defaultConfig {
Expand All @@ -52,6 +49,10 @@ android {
consumerProguardFiles 'proguard-rules.pro'
}

buildFeatures {
buildConfig true
}

buildTypes {
release {
minifyEnabled false
Expand All @@ -70,26 +71,23 @@ android {
sourceSets {
main {
if (isNewArchitectureEnabled()) {
java.srcDirs += [
"src/newarch/java",
// This is needed to build Kotlin project with NewArch enabled
"${project.buildDir}/generated/source/codegen/java"
]
java.srcDirs += [
"src/newarch/java",
"generated/java",
"generated/jni"
]
} else {
java.srcDirs += ["src/oldarch/java"]
java.srcDirs += ["src/oldarch/java"]
}
}
}

namespace 'com.urbanairship.reactnative'
}

repositories {
mavenCentral()
google()
}


def getModuleVersion() {
def jsonFile = file('../package.json')
def parsedJson = new JsonSlurper().parseText(jsonFile.text)
Expand All @@ -99,17 +97,13 @@ def getModuleVersion() {

def kotlin_version = getExtOrDefault("kotlinVersion")
def proxy_version = getExtOrDefault("airshipProxyVersion")
def airship_version = getExtOrDefault("airshipVersion")

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

api "com.urbanairship.android:airship-framework-proxy:$proxy_version"

if (isHmsEnabled()) {
implementation "com.urbanairship.android:airship-framework-proxy-hms:$proxy_version"
}
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Airship_minSdkVersion=23
Airship_targetSdkVersion=35
Airship_compileSdkVersion=35
Airship_ndkversion=26.1.10909125
Airship_airshipProxyVersion=13.1.0
Airship_airshipProxyVersion=13.2.0
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ class AirshipModule internal constructor(val context: ReactApplicationContext) :
}

companion object {
const val NAME = "RTNAirship"
const val NAME = "RNAirship"
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,31 @@ import com.facebook.react.uimanager.SimpleViewManager
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.ViewManagerDelegate
import com.facebook.react.uimanager.annotations.ReactProp
import com.facebook.react.viewmanagers.RTNAirshipEmbeddedViewManagerDelegate
import com.facebook.react.viewmanagers.RTNAirshipEmbeddedViewManagerInterface

import com.facebook.react.viewmanagers.RNAirshipEmbeddedViewManagerInterface

class ReactEmbeddedViewManager : SimpleViewManager<ReactEmbeddedView>(),
RTNAirshipEmbeddedViewManagerInterface<ReactEmbeddedView> {
RNAirshipEmbeddedViewManagerInterface<ReactEmbeddedView> {

private val manualDelegate = object : ViewManagerDelegate<ReactEmbeddedView> {

private val delegate = RTNAirshipEmbeddedViewManagerDelegate(this)
override fun setProperty(view: ReactEmbeddedView, propName: String?, value: Any?) {
when (propName) {
"embeddedId" -> setEmbeddedId(view, value as? String)
else -> {}
}
}

override fun receiveCommand(view: ReactEmbeddedView, commandName: String?, args: com.facebook.react.bridge.ReadableArray?) {
// No commands supported — add if you need any
}
}

override fun getName(): String {
return REACT_CLASS
}

override fun getDelegate(): ViewManagerDelegate<ReactEmbeddedView?> {
return delegate
override fun getDelegate(): ViewManagerDelegate<ReactEmbeddedView> {
return manualDelegate
}

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


companion object {
const val REACT_CLASS = "RTNAirshipEmbeddedView"
const val REACT_CLASS = "RNAirshipEmbeddedView"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,31 @@ import com.facebook.react.uimanager.SimpleViewManager
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.ViewManagerDelegate
import com.facebook.react.uimanager.annotations.ReactProp
import com.facebook.react.viewmanagers.RNAirshipMessageViewManagerInterface
import com.facebook.react.bridge.ReadableArray

import com.facebook.react.viewmanagers.RTNAirshipMessageViewManagerDelegate
import com.facebook.react.viewmanagers.RTNAirshipMessageViewManagerInterface
class ReactMessageViewManager : SimpleViewManager<ReactMessageView>(),
RNAirshipMessageViewManagerInterface<ReactMessageView> {

class ReactMessageViewManager : SimpleViewManager<ReactMessageView>(), RTNAirshipMessageViewManagerInterface<ReactMessageView> {
private val delegate = object : ViewManagerDelegate<ReactMessageView> {

private val delegate = RTNAirshipMessageViewManagerDelegate(this)
override fun setProperty(view: ReactMessageView, propName: String?, value: Any?) {
when (propName) {
"messageId" -> setMessageId(view, value as? String)
else -> {}
}
}

override fun receiveCommand(view: ReactMessageView, commandName: String?, args: ReadableArray?) {
// No commands implemented, add if Airship adds some in future
}
}

override fun getName(): String {
return REACT_CLASS
}

override fun getDelegate(): ViewManagerDelegate<ReactMessageView?> {
override fun getDelegate(): ViewManagerDelegate<ReactMessageView> {
return delegate
}

Expand Down Expand Up @@ -75,6 +87,6 @@ class ReactMessageViewManager : SimpleViewManager<ReactMessageView>(), RTNAirshi
}

companion object {
const val REACT_CLASS = "RTNAirshipMessageView"
const val REACT_CLASS = "RNAirshipMessageView"
}
}
}
Loading

0 comments on commit 7974d2e

Please sign in to comment.