Skip to content

Commit

Permalink
Merge pull request #129 from urbanairship/release-5.5.0
Browse files Browse the repository at this point in the history
Release 5.5.0
  • Loading branch information
rlepinski authored May 4, 2022
2 parents d14c96f + 05af6d0 commit 132fd47
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 40 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Flutter Plugin Changelog

## Version 5.5.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.
- 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.


## Version 5.4.0 - April 4, 2022
Minor release that adds support for registering a handler that will be
called when a message is received in the background on Android.
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version '1.0-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.5.31'
ext.coroutine_version = '1.5.0'
ext.airship_version = '16.3.3'
ext.airship_version = '16.4.0'

repositories {
google()
Expand Down
25 changes: 5 additions & 20 deletions android/src/main/kotlin/com/airship/flutter/AirshipPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -692,26 +692,11 @@ class AirshipPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {

@SuppressLint("RestrictedApi")
private fun getPreferenceCenterConfig(call: MethodCall, result: Result) {
val preferenceCenterID = call.arguments as String
val remoteData = UAirship.shared().remoteData

remoteData.payloadsForType("preference_forms")
.flatMap { payload ->
val payloadForms = payload.data.opt("preference_forms").optList()
val form = payloadForms.mapNotNull {
val form = it.optMap().opt("form").optMap()
if (form.opt("id").optString() == preferenceCenterID) {
form
} else {
null
}
}.firstOrNull()
Observable.just(form ?: JsonMap.EMPTY_MAP)
}.subscribe(object : Subscriber<JsonMap>() {
override fun onNext(value: JsonMap) {
result.success(value.toString())
}
})
val preferenceCenterId = call.arguments as String

PreferenceCenter.shared().getJsonConfig(preferenceCenterId).addResultCallback { config ->
result.success(config?.toString() ?: JsonMap.EMPTY_MAP.toString())
}
}

private fun setAutoLaunchDefaultPreferenceCenter(call: MethodCall, result: Result) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package com.airship.flutter

class AirshipPluginVersion {
companion object {
const val AIRSHIP_PLUGIN_VERSION = "5.4.0"
const val AIRSHIP_PLUGIN_VERSION = "5.5.0"
}
}
2 changes: 1 addition & 1 deletion ios/Classes/AirshipPluginVersion.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Foundation

class AirshipPluginVersion {
static let pluginVersion = "5.4.0"
static let pluginVersion = "5.5.0"
}
16 changes: 4 additions & 12 deletions ios/Classes/SwiftAirshipPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -692,21 +692,13 @@ public class SwiftAirshipPlugin: NSObject, FlutterPlugin, PreferenceCenterOpenDe
}

private func getPreferenceCenterConfig(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
guard let preferenceCenterID = call.arguments as? String else {
guard let configID = call.arguments as? String else {
result(nil)
return
}

var disposable: Disposable?
let remoteData = Airship.requireComponent(ofType: RemoteDataManager.self)
disposable = remoteData.subscribe(types: ["preference_forms"]) { payloads in
let data = payloads.first?.data["preference_forms"] as? [[String : Any]]
let config = data?
.compactMap { $0["form"] as? [String : Any] }
.first(where: { $0["id"] as? String == preferenceCenterID})

disposable?.dispose()
result(JSONUtils.string(config ?? [:]))

PreferenceCenter.shared.jsonConfig(preferenceCenterID: configID) { config in
result(JSONUtils.string(config))
}
}

Expand Down
10 changes: 5 additions & 5 deletions ios/airship_flutter.podspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

AIRSHIP_FLUTTER_VERSION="5.4.0"
AIRSHIP_FLUTTER_VERSION="5.5.0"

#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
Expand All @@ -21,9 +21,9 @@ Airship flutter plugin.
s.dependency 'Flutter'

s.ios.deployment_target = "11.0"
s.dependency 'Airship/Core', '~> 16.5.1'
s.dependency 'Airship/MessageCenter', '~> 16.5.1'
s.dependency 'Airship/Automation', '~> 16.5.1'
s.dependency 'Airship/PreferenceCenter', '~> 16.5.1'
s.dependency 'Airship/Core', '~> 16.6.0'
s.dependency 'Airship/MessageCenter', '~> 16.6.0'
s.dependency 'Airship/Automation', '~> 16.6.0'
s.dependency 'Airship/PreferenceCenter', '~> 16.6.0'
end

0 comments on commit 132fd47

Please sign in to comment.