Skip to content

Commit

Permalink
Release 17.0.0 (#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
rlepinski committed Nov 22, 2023
1 parent a8dcfdf commit 50dfc79
Show file tree
Hide file tree
Showing 23 changed files with 32,131 additions and 11,766 deletions.
63 changes: 12 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,26 @@ name: CI
on: [pull_request]

jobs:
android:
runs-on: ubuntu-latest
test:
runs-on: macos-13-xlarge
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_15.0.1.app/Contents/Developer'

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
shell: bash

- name: Run CI
run: bash ./scripts/run_ci_tasks.sh -a

ios:
runs-on: macos-latest
env:
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
steps:
- uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'npm'

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
shell: bash

- name: Run CI
run: bash ./scripts/run_ci_tasks.sh -i
- run: npm run bootstrap
- run: bash ./scripts/run_ci_tasks.sh -a
- run: bash ./scripts/run_ci_tasks.sh -i
74 changes: 41 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,59 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Check Version
run: bash ./scripts/check_version.sh ${GITHUB_REF/refs\/tags\//}

deploy:
module:
needs: check-version
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
always-auth: true
registry-url: 'https://registry.npmjs.org'

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

docs:
needs: check-version
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version-file: .nvmrc
always-auth: true
registry-url: 'https://registry.npmjs.org'

- uses: google-github-actions/setup-gcloud@v0
with:
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}


- run: npm ci
- run: npm run docs
- run: bash ./scripts/upload_docs.sh ${GITHUB_REF/refs\/tags\//}

- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
shell: bash
github-release:
needs: check-version
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get the version
id: get_version
Expand All @@ -55,22 +77,7 @@ jobs:
NOTES="${NOTES//$'\n'/'%0A'}"
NOTES="${NOTES//$'\r'/'%0D'}"
echo ::set-output name=NOTES::"$NOTES"
- name: Generate documentation
run: yarn docs

- uses: google-github-actions/setup-gcloud@v0
with:
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}

- name: Upload docs
run: bash ./scripts/upload_docs.sh ${GITHUB_REF/refs\/tags\//}
- name: Publish modules
run: |
yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Github Release
uses: actions/[email protected]
env:
Expand All @@ -80,4 +87,5 @@ jobs:
release_name: ${{ steps.get_version.outputs.VERSION }}
body: ${{ steps.get_release_notes.outputs.NOTES }}
draft: false
prerelease: false
prerelease: false

3 changes: 0 additions & 3 deletions .yarnrc

This file was deleted.

14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# React Native Module Changelog

## Version 17.0.0 - November 21, 2023
Major release that adds support for server side feature flag segmentation, interaction events for feature flags, and Impression billing.

### Changes
- Updated iOS SDK to 17.6.1
- Updated Android SDK to 17.5.0
- Added `Airship.featureFlagManager.trackInteraction(flag)` method to track interaction events
- Added a deprecated method `Airship.channel.enableChannelCreation()` for app that are using delayed channel creation instead of privacy manager
- Added server side segmentation for feature flags
- Added support for Impression billing
- Removed the InboxMessage `isDeleted` property
- Fixed the InboxMessage `listIconUrl` on iOS


## Version 16.1.2 - October 23, 2023
Patch release that fixes an issue with `getActiveNotifications` on Android.

Expand Down
52 changes: 7 additions & 45 deletions DEV_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,22 @@

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

1) Install yarn and watchman, if necessary
1) Setup

```
brew install yarn
```
Execute the following command in the root directory

```
brew install watchman
npm run bootstrap install
```

2) Install modules

Execute the following command in the root directory
2) Run Android

```
yarn install
npm run example android
```

3) Perform platform-specific setup

## iOS

1) Run `pod install --repo-update` in `example/ios`

2) Open the `example/ios/AirshipSample.xcworkspace` Project

3) Create the `AirshipConfig.plist` file

4) Start the webserver in the top-level directory by running `yarn start`

5) Build and run the sample in the `example` directory: `yarn run:ios`

You should now be able to modify the iOS plugin source
directly in the sample's workspace.

## Android

1) Open `example/android` in Android Studio

2) Create the `airshipconfig.properties` file in `example/android/app/src/main/assets`

3) If using FCM, add your `google-services.json` file in `example/android/app`

4) Start the webserver in the top-level directory by running `yarn start`

5) Build and run the sample in the `example` directory: `yarn run:android`

You should now be able to modify the Android plugin source directly in Android Studio.


4) JS unit tests

We have unit tests for the Javascript part of the module. To run the tests, execute the following command in the root directory:
2) Run iOS

```
yarn test
npm run example ios
```
4 changes: 2 additions & 2 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Airship_targetSdkVersion=31
Airship_compileSdkVersion=31
Airship_ndkversion=21.4.7075529

Airship_airshipProxyVersion=4.3.0
Airship_airshipProxyVersion=5.0.1

# workaround for now, used for HMS
Airship_airshipVersion=17.2.1
Airship_airshipVersion=17.5.0

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.urbanairship.android.framework.proxy.EventType
import com.urbanairship.android.framework.proxy.ProxyLogger
import com.urbanairship.android.framework.proxy.events.EventEmitter
import com.urbanairship.android.framework.proxy.proxies.AirshipProxy
import com.urbanairship.android.framework.proxy.proxies.FeatureFlagProxy
import com.urbanairship.android.framework.proxy.proxies.SuspendingPredicate
import com.urbanairship.json.JsonMap
import com.urbanairship.json.JsonSerializable
Expand Down Expand Up @@ -654,6 +655,13 @@ class AirshipModule internal constructor(val context: ReactApplicationContext) :
}
}

override fun featureFlagManagerTrackInteraction(flag: ReadableMap?, promise: Promise) {
promise.resolveResult {
val parsedFlag = FeatureFlagProxy(Utils.convertMap(requireNotNull(flag)).toJsonValue())
proxy.featureFlagManager.trackInteraction(parsedFlag)
}
}

private fun notifyPending() {
if (context.hasActiveReactInstance()) {
val appEventEmitter = context.getJSModule(RCTNativeAppEventEmitter::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,10 @@ abstract class AirshipSpec internal constructor(context: ReactApplicationContext
@ReactMethod
@com.facebook.proguard.annotations.DoNotStrip
abstract fun featureFlagManagerFlag(flagName: String?, promise: Promise)

@ReactMethod
@com.facebook.proguard.annotations.DoNotStrip
abstract fun featureFlagManagerTrackInteraction(flag: ReadableMap?, promise: Promise)
}


2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ target 'AirshipExample' do
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
end
end
end
end
end

Loading

0 comments on commit 50dfc79

Please sign in to comment.