Skip to content

Commit

Permalink
Release 14.1.0 (#392)
Browse files Browse the repository at this point in the history
* Update SDKs

* Changelog

* Update gcloud version

* Fix config call
  • Loading branch information
rlepinski authored May 5, 2022
1 parent 3a7bf43 commit 32c83a7
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
run: |
yarn install
yarn generate-docs
- uses: google-github-actions/setup-gcloud@daadedc81d5f9d3c06d2c92f49202a3cc2b919ba # v0.2.1
- uses: google-github-actions/setup-gcloud@v0
with:
version: '351.0.0'
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Cordova Plugin Changelog

## Version 14.1.0 - May 4, 2022
Minor release that updates Airship Android SDK to 16.4.0, and iOS SDK to 16.6.0. These SDK releases fix several issues with Scenes and Surveys. Apps using Scenes & Surveys should update.

- Added support for randomizing Survey responses.
- Added subscription list action.
- Added firebase app name to config.
- Updated localizations. All strings within the SDK are now localized in 48 different languages.
- Improved accessibility with OOTB Message Center UI.
- In-App rules will now attempt to refresh before displaying. This change should reduce the chances of showing out of data or cancelled in-app automations, scenes, or surveys when background refresh is disabled.
- Fixed reporting issue with a single page Scene.
- Fixed rendering issues for Scenes & Surveys.
- Fixed deep links that contain invalid characters by encoding those deep links.
- Fixed crash on Android 8 with Scenes & Surveys.
- Fixed Survey attribute storage on Android.
- Fixed silent push events on Android.


## Version 14.0.0 - March 10, 2022
Major release that changes the config returned by `getPreferenceCenterConfig`.

Expand Down
2 changes: 1 addition & 1 deletion urbanairship-accengage-cordova/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "urbanairship-accengage-cordova",
"version": "14.0.0",
"version": "14.1.0",
"description": "Urban Airship-Accengage Cordova plugin",
"cordova": {
"id": "urbanairship-accengage-cordova",
Expand Down
8 changes: 4 additions & 4 deletions urbanairship-accengage-cordova/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<plugin id="urbanairship-accengage-cordova"
version="14.0.0"
version="14.1.0"
xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android">

Expand All @@ -16,13 +16,13 @@
<engine name="cordova" version=">=9.0.1"/>
</engines>

<dependency id="urbanairship-cordova" version="14.0.0"/>
<dependency id="urbanairship-cordova" version="14.1.0"/>

<!-- ios -->
<platform name="ios">

<config-file target="*-Info.plist" parent="UACordovaPluginVersion">
<string>14.0.0</string>
<string>14.1.0</string>
</config-file>

<!-- Airship Accengage Module -->
Expand All @@ -31,7 +31,7 @@
<source url="https://github.com/CocoaPods/Specs.git"/>
</config>
<pods use-frameworks="true">
<pod name="Airship/Accengage" spec="16.4.0" />
<pod name="Airship/Accengage" spec="16.6.0" />
</pods>
</podspec>

Expand Down
2 changes: 1 addition & 1 deletion urbanairship-cordova/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "urbanairship-cordova",
"version": "14.0.0",
"version": "14.1.0",
"description": "Urban Airship Cordova plugin",
"cordova": {
"id": "urbanairship-cordova",
Expand Down
16 changes: 8 additions & 8 deletions urbanairship-cordova/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin id="urbanairship-cordova"
version="14.0.0"
version="14.1.0"
xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android">

Expand Down Expand Up @@ -40,7 +40,7 @@
<config-file parent="/manifest/application" target="AndroidManifest.xml">
<meta-data
android:name="com.urbanairship.cordova.version"
android:value="14.0.0"/>
android:value="14.1.0"/>

<meta-data
android:name="com.urbanairship.autopilot"
Expand Down Expand Up @@ -145,7 +145,7 @@
</config-file>

<config-file target="*-Info.plist" parent="UACordovaPluginVersion">
<string>14.0.0</string>
<string>14.1.0</string>
</config-file>

<config-file parent="/widget" target="config.xml">
Expand Down Expand Up @@ -198,11 +198,11 @@
<source url="https://cdn.cocoapods.org/"/>
</config>
<pods use-frameworks="true">
<pod name="Airship/Core" spec="16.4.0" />
<pod name="Airship/MessageCenter" spec="16.4.0" />
<pod name="Airship/Automation" spec="16.4.0" />
<pod name="Airship/ExtendedActions" spec="16.4.0" />
<pod name="Airship/PreferenceCenter" spec="16.4.0" />
<pod name="Airship/Core" spec="16.6.0" />
<pod name="Airship/MessageCenter" spec="16.6.0" />
<pod name="Airship/Automation" spec="16.6.0" />
<pod name="Airship/ExtendedActions" spec="16.6.0" />
<pod name="Airship/PreferenceCenter" spec="16.6.0" />
</pods>
</podspec>

Expand Down
31 changes: 1 addition & 30 deletions urbanairship-cordova/src/android/UAirshipPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ private void openPreferenceCenter(@NonNull JSONArray data, @NonNull CallbackCont
*/
private void getPreferenceCenterConfig(@NonNull JSONArray data, @NonNull CallbackContext callbackContext) throws JSONException {
String preferenceCenterId = data.getString(0);
getConfigJson(preferenceCenterId).addResultCallback(result -> {
PreferenceCenter.shared().getJsonConfig(preferenceCenterId).addResultCallback(result -> {
if (result == null) {
callbackContext.success();
return;
Expand All @@ -1513,35 +1513,6 @@ private void getPreferenceCenterConfig(@NonNull JSONArray data, @NonNull Callbac
});
}

@SuppressLint("RestrictedApi")
private PendingResult<JsonValue> getConfigJson(final String prefCenterId) {
PendingResult<JsonValue> result = new PendingResult<>();

UAirship.shared().getRemoteData().payloadsForType("preference_forms")
.flatMap((payload) -> {
JsonList forms = payload.getData().opt("preference_forms").optList();
for (JsonValue formJson : forms) {
JsonMap formMap = formJson.optMap().opt("form").optMap();
if (formMap.opt("id").optString().equals(prefCenterId)) {
return Observable.just(formMap.toJsonValue());
}
}
return Observable.empty();
}).distinctUntilChanged()
.subscribe(new Subscriber<JsonValue>() {
@Override
public void onNext(@NonNull JsonValue value) {
result.setResult(value);
}

@Override
public void onError(@NonNull Exception e) {
result.setResult(null);
}
});
return result;
}

/**
* Set to true the override the preference center.
*
Expand Down
2 changes: 1 addition & 1 deletion urbanairship-cordova/src/android/build-extras.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies {
def airshipVersion = "16.3.3"
def airshipVersion = "16.4.0"
implementation "com.urbanairship.android:urbanairship-fcm:$airshipVersion"
implementation "com.urbanairship.android:urbanairship-message-center:$airshipVersion"
implementation "com.urbanairship.android:urbanairship-automation:$airshipVersion"
Expand Down
23 changes: 4 additions & 19 deletions urbanairship-cordova/src/ios/UAirshipPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ - (void)setUserNotificationsEnabled:(CDVInvokedUrlCommand *)command {

- (void)enableUserNotifications:(CDVInvokedUrlCommand *)command {
UA_LTRACE("enableUserNotifications called with command arguments: %@", command.arguments);

[self performCallbackWithCommand:command withBlock:^(NSArray *args, UACordovaCompletionHandler completionHandler) {
[[UAirship push] enableUserPushNotifications:^(BOOL success) {
completionHandler(CDVCommandStatus_OK, [NSNumber numberWithBool:success]);
Expand Down Expand Up @@ -1096,26 +1096,11 @@ - (void)openPreferenceCenter:(CDVInvokedUrlCommand *)command {

- (void)getPreferenceCenterConfig:(CDVInvokedUrlCommand *)command {
UA_LTRACE("getPreferenceCenterConfig called with command arguments: %@", command.arguments);

[self performCallbackWithCommand:command withBlock:^(NSArray *args, UACordovaCompletionHandler completionHandler) {
NSString *preferenceCenterID = [args firstObject];
UARemoteDataManager *remoteData = (UARemoteDataManager *)[UAirship componentForClassName:@"UARemoteDataManager"];

__block UADisposable *disposable = [remoteData subscribeWithTypes:@[@"preference_forms"] block:^(NSArray<UARemoteDataPayload *> *payloads) {
NSArray *forms = [payloads firstObject].data[@"preference_forms"];

id result;
for (id form in forms) {
NSString *formID = form[@"form"][@"id"];
if ([formID isEqualToString:preferenceCenterID]) {
result = form[@"form"];
break;
}
}

[disposable dispose];
completionHandler(CDVCommandStatus_OK, result);
}];
[[UAPreferenceCenter shared] jsonConfigForPreferenceCenterID:preferenceCenterID completionHandler:^(NSDictionary *config) {
completionHandler(CDVCommandStatus_OK, config);
}];
}];
}

Expand Down
2 changes: 1 addition & 1 deletion urbanairship-hms-cordova/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "urbanairship-hms-cordova",
"version": "14.0.0",
"version": "14.1.0",
"description": "Urban Airship HMS Cordova plugin",
"cordova": {
"id": "urbanairship-hms-cordova",
Expand Down
4 changes: 2 additions & 2 deletions urbanairship-hms-cordova/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<plugin id="urbanairship-hms-cordova"
version="14.0.0"
version="14.1.0"
xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android">

Expand All @@ -15,7 +15,7 @@
<engine name="cordova" version=">=9.0.1"/>
</engines>

<dependency id="urbanairship-cordova" version="14.0.0"/>
<dependency id="urbanairship-cordova" version="14.1.0"/>

<!-- android -->
<platform name="android">
Expand Down
4 changes: 2 additions & 2 deletions urbanairship-hms-cordova/src/android/build-extras.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ repositories {
}

dependencies {
implementation 'com.urbanairship.android:urbanairship-hms:16.3.3'
implementation 'com.huawei.hms:push:6.1.0.300'
implementation 'com.urbanairship.android:urbanairship-hms:16.4.0'
implementation 'com.huawei.hms:push:6.3.0.304'
}

cdvPluginPostBuildExtras.push({
Expand Down

0 comments on commit 32c83a7

Please sign in to comment.