Skip to content

Commit 50dfc79

Browse files
authored
Release 17.0.0 (urbanairship#534)
1 parent a8dcfdf commit 50dfc79

23 files changed

+32131
-11766
lines changed

.github/workflows/ci.yml

+12-51
Original file line numberDiff line numberDiff line change
@@ -3,65 +3,26 @@ name: CI
33
on: [pull_request]
44

55
jobs:
6-
android:
7-
runs-on: ubuntu-latest
6+
test:
7+
runs-on: macos-13-xlarge
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v4
1010
- name: Set up JDK 11
11-
uses: actions/setup-java@v2
11+
uses: actions/setup-java@v3
1212
with:
1313
distribution: 'temurin'
1414
java-version: '11'
15+
16+
- name: Select Xcode version
17+
run: sudo xcode-select -s '/Applications/Xcode_15.0.1.app/Contents/Developer'
1518

16-
- name: Setup Node.js
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version-file: .nvmrc
20-
21-
- name: Cache dependencies
22-
id: yarn-cache
23-
uses: actions/cache@v3
24-
with:
25-
path: |
26-
**/node_modules
27-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
28-
restore-keys: |
29-
${{ runner.os }}-yarn-
30-
31-
- name: Install dependencies
32-
if: steps.yarn-cache.outputs.cache-hit != 'true'
33-
run: yarn install --frozen-lockfile
34-
shell: bash
35-
36-
- name: Run CI
37-
run: bash ./scripts/run_ci_tasks.sh -a
38-
39-
ios:
40-
runs-on: macos-latest
41-
env:
42-
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
43-
steps:
44-
- uses: actions/checkout@v2
4519

4620
- name: Setup Node.js
47-
uses: actions/setup-node@v3
21+
uses: actions/setup-node@v4
4822
with:
4923
node-version-file: .nvmrc
24+
cache: 'npm'
5025

51-
- name: Cache dependencies
52-
id: yarn-cache
53-
uses: actions/cache@v3
54-
with:
55-
path: |
56-
**/node_modules
57-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
58-
restore-keys: |
59-
${{ runner.os }}-yarn-
60-
61-
- name: Install dependencies
62-
if: steps.yarn-cache.outputs.cache-hit != 'true'
63-
run: yarn install --frozen-lockfile
64-
shell: bash
65-
66-
- name: Run CI
67-
run: bash ./scripts/run_ci_tasks.sh -i
26+
- run: npm run bootstrap
27+
- run: bash ./scripts/run_ci_tasks.sh -a
28+
- run: bash ./scripts/run_ci_tasks.sh -i

.github/workflows/release.yml

+41-33
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,59 @@ jobs:
1111
runs-on: macos-latest
1212
steps:
1313
- name: Checkout repository
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1515
- name: Check Version
1616
run: bash ./scripts/check_version.sh ${GITHUB_REF/refs\/tags\//}
1717

18-
deploy:
18+
module:
19+
needs: check-version
1920
runs-on: ubuntu-latest
2021
steps:
2122
- name: Checkout repository
22-
uses: actions/checkout@v2
23+
uses: actions/checkout@v4
2324

2425
- name: Setup Node.js
25-
uses: actions/setup-node@v3
26+
uses: actions/setup-node@v4
2627
with:
2728
node-version-file: .nvmrc
2829
always-auth: true
2930
registry-url: 'https://registry.npmjs.org'
3031

31-
- name: Cache dependencies
32-
id: yarn-cache
33-
uses: actions/cache@v3
32+
- run: npm ci
33+
- run: npm publish
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
36+
37+
docs:
38+
needs: check-version
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
43+
44+
- name: Setup Node.js
45+
uses: actions/setup-node@v4
3446
with:
35-
path: |
36-
**/node_modules
37-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
38-
restore-keys: |
39-
${{ runner.os }}-yarn-
47+
node-version-file: .nvmrc
48+
always-auth: true
49+
registry-url: 'https://registry.npmjs.org'
50+
51+
- uses: google-github-actions/setup-gcloud@v0
52+
with:
53+
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
54+
service_account_key: ${{ secrets.GCP_SA_KEY }}
55+
56+
57+
- run: npm ci
58+
- run: npm run docs
59+
- run: bash ./scripts/upload_docs.sh ${GITHUB_REF/refs\/tags\//}
4060

41-
- name: Install dependencies
42-
if: steps.yarn-cache.outputs.cache-hit != 'true'
43-
run: yarn
44-
shell: bash
61+
github-release:
62+
needs: check-version
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: Checkout repository
66+
uses: actions/checkout@v4
4567

4668
- name: Get the version
4769
id: get_version
@@ -55,22 +77,7 @@ jobs:
5577
NOTES="${NOTES//$'\n'/'%0A'}"
5678
NOTES="${NOTES//$'\r'/'%0D'}"
5779
echo ::set-output name=NOTES::"$NOTES"
58-
59-
- name: Generate documentation
60-
run: yarn docs
61-
62-
- uses: google-github-actions/setup-gcloud@v0
63-
with:
64-
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
65-
service_account_key: ${{ secrets.GCP_SA_KEY }}
66-
67-
- name: Upload docs
68-
run: bash ./scripts/upload_docs.sh ${GITHUB_REF/refs\/tags\//}
69-
- name: Publish modules
70-
run: |
71-
yarn publish
72-
env:
73-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
80+
7481
- name: Github Release
7582
uses: actions/[email protected]
7683
env:
@@ -80,4 +87,5 @@ jobs:
8087
release_name: ${{ steps.get_version.outputs.VERSION }}
8188
body: ${{ steps.get_release_notes.outputs.NOTES }}
8289
draft: false
83-
prerelease: false
90+
prerelease: false
91+

.yarnrc

-3
This file was deleted.

CHANGELOG.md

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

3+
## Version 17.0.0 - November 21, 2023
4+
Major release that adds support for server side feature flag segmentation, interaction events for feature flags, and Impression billing.
5+
6+
### Changes
7+
- Updated iOS SDK to 17.6.1
8+
- Updated Android SDK to 17.5.0
9+
- Added `Airship.featureFlagManager.trackInteraction(flag)` method to track interaction events
10+
- Added a deprecated method `Airship.channel.enableChannelCreation()` for app that are using delayed channel creation instead of privacy manager
11+
- Added server side segmentation for feature flags
12+
- Added support for Impression billing
13+
- Removed the InboxMessage `isDeleted` property
14+
- Fixed the InboxMessage `listIconUrl` on iOS
15+
16+
317
## Version 16.1.2 - October 23, 2023
418
Patch release that fixes an issue with `getActiveNotifications` on Android.
519

DEV_README.md

+7-45
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,22 @@
22

33
The example is set up to reference the module using a yarn workspace.
44

5-
1) Install yarn and watchman, if necessary
5+
1) Setup
66

7-
```
8-
brew install yarn
9-
```
7+
Execute the following command in the root directory
108

119
```
12-
brew install watchman
10+
npm run bootstrap install
1311
```
1412

15-
2) Install modules
16-
17-
Execute the following command in the root directory
13+
2) Run Android
1814

1915
```
20-
yarn install
16+
npm run example android
2117
```
2218

23-
3) Perform platform-specific setup
24-
25-
## iOS
26-
27-
1) Run `pod install --repo-update` in `example/ios`
28-
29-
2) Open the `example/ios/AirshipSample.xcworkspace` Project
30-
31-
3) Create the `AirshipConfig.plist` file
32-
33-
4) Start the webserver in the top-level directory by running `yarn start`
34-
35-
5) Build and run the sample in the `example` directory: `yarn run:ios`
36-
37-
You should now be able to modify the iOS plugin source
38-
directly in the sample's workspace.
39-
40-
## Android
41-
42-
1) Open `example/android` in Android Studio
43-
44-
2) Create the `airshipconfig.properties` file in `example/android/app/src/main/assets`
45-
46-
3) If using FCM, add your `google-services.json` file in `example/android/app`
47-
48-
4) Start the webserver in the top-level directory by running `yarn start`
49-
50-
5) Build and run the sample in the `example` directory: `yarn run:android`
51-
52-
You should now be able to modify the Android plugin source directly in Android Studio.
53-
54-
55-
4) JS unit tests
56-
57-
We have unit tests for the Javascript part of the module. To run the tests, execute the following command in the root directory:
19+
2) Run iOS
5820

5921
```
60-
yarn test
22+
npm run example ios
6123
```

android/gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Airship_targetSdkVersion=31
44
Airship_compileSdkVersion=31
55
Airship_ndkversion=21.4.7075529
66

7-
Airship_airshipProxyVersion=4.3.0
7+
Airship_airshipProxyVersion=5.0.1
88

99
# workaround for now, used for HMS
10-
Airship_airshipVersion=17.2.1
10+
Airship_airshipVersion=17.5.0
1111

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

+8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import com.urbanairship.android.framework.proxy.EventType
99
import com.urbanairship.android.framework.proxy.ProxyLogger
1010
import com.urbanairship.android.framework.proxy.events.EventEmitter
1111
import com.urbanairship.android.framework.proxy.proxies.AirshipProxy
12+
import com.urbanairship.android.framework.proxy.proxies.FeatureFlagProxy
1213
import com.urbanairship.android.framework.proxy.proxies.SuspendingPredicate
1314
import com.urbanairship.json.JsonMap
1415
import com.urbanairship.json.JsonSerializable
@@ -654,6 +655,13 @@ class AirshipModule internal constructor(val context: ReactApplicationContext) :
654655
}
655656
}
656657

658+
override fun featureFlagManagerTrackInteraction(flag: ReadableMap?, promise: Promise) {
659+
promise.resolveResult {
660+
val parsedFlag = FeatureFlagProxy(Utils.convertMap(requireNotNull(flag)).toJsonValue())
661+
proxy.featureFlagManager.trackInteraction(parsedFlag)
662+
}
663+
}
664+
657665
private fun notifyPending() {
658666
if (context.hasActiveReactInstance()) {
659667
val appEventEmitter = context.getJSModule(RCTNativeAppEventEmitter::class.java)

android/src/oldarch/java/com/urbanairship/reactnative/AirshipSpec.kt

+4
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,10 @@ abstract class AirshipSpec internal constructor(context: ReactApplicationContext
380380
@ReactMethod
381381
@com.facebook.proguard.annotations.DoNotStrip
382382
abstract fun featureFlagManagerFlag(flagName: String?, promise: Promise)
383+
384+
@ReactMethod
385+
@com.facebook.proguard.annotations.DoNotStrip
386+
abstract fun featureFlagManagerTrackInteraction(flag: ReadableMap?, promise: Promise)
383387
}
384388

385389

example/ios/Podfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ target 'AirshipExample' do
5959
installer.pods_project.targets.each do |target|
6060
target.build_configurations.each do |config|
6161
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
62+
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
6263
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
6364
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
6465
end
6566
end
6667
end
6768
end
6869
end
69-

0 commit comments

Comments
 (0)