From 317e2e359cd98e1993006a12e5cf84ee61f7ef07 Mon Sep 17 00:00:00 2001 From: crow <david.crow@airship.com> Date: Thu, 24 Oct 2024 12:17:57 -0700 Subject: [PATCH 1/6] Update to version 8.0.0 --- .../src/main/kotlin/com/airship/flutter/AirshipPluginVersion.kt | 2 +- ios/Classes/AirshipPluginVersion.swift | 2 +- ios/airship_flutter.podspec | 2 +- pubspec.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android/src/main/kotlin/com/airship/flutter/AirshipPluginVersion.kt b/android/src/main/kotlin/com/airship/flutter/AirshipPluginVersion.kt index b6898be8..bf9f7dc7 100644 --- a/android/src/main/kotlin/com/airship/flutter/AirshipPluginVersion.kt +++ b/android/src/main/kotlin/com/airship/flutter/AirshipPluginVersion.kt @@ -2,6 +2,6 @@ package com.airship.flutter class AirshipPluginVersion { companion object { - const val AIRSHIP_PLUGIN_VERSION = "7.9.0" + const val AIRSHIP_PLUGIN_VERSION = "8.0.0" } } diff --git a/ios/Classes/AirshipPluginVersion.swift b/ios/Classes/AirshipPluginVersion.swift index 6f9e4a3e..3136eb12 100644 --- a/ios/Classes/AirshipPluginVersion.swift +++ b/ios/Classes/AirshipPluginVersion.swift @@ -1,5 +1,5 @@ import Foundation class AirshipPluginVersion { - static let pluginVersion = "7.9.0" + static let pluginVersion = "8.0.0" } diff --git a/ios/airship_flutter.podspec b/ios/airship_flutter.podspec index c2913210..0e3c7d0e 100644 --- a/ios/airship_flutter.podspec +++ b/ios/airship_flutter.podspec @@ -1,5 +1,5 @@ -AIRSHIP_FLUTTER_VERSION="7.9.0" +AIRSHIP_FLUTTER_VERSION="8.0.0" # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html diff --git a/pubspec.yaml b/pubspec.yaml index 218cc609..a2cba709 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: airship_flutter description: "Cross-platform plugin interface for the native Airship iOS and Android SDKs. Simplifies adding Airship to Flutter apps." -version: 7.9.0 +version: 8.0.0 homepage: https://www.airship.com/ repository: https://github.com/urbanairship/airship-flutter issue_tracker: https://github.com/urbanairship/airship-flutter/issues From 7d150dda715e482373e273b46a4adaa7ab381c75 Mon Sep 17 00:00:00 2001 From: crow <david.crow@airship.com> Date: Thu, 24 Oct 2024 12:29:44 -0700 Subject: [PATCH 2/6] Update proxy to 11.0.0 --- android/build.gradle | 2 +- ios/airship_flutter.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 0f1cf277..104d7ff1 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -5,7 +5,7 @@ buildscript { ext.kotlin_version = '1.9.0' ext.coroutine_version = '1.5.2' ext.datastore_preferences_version = '1.1.1' - ext.airship_framework_proxy_version = '10.1.1' + ext.airship_framework_proxy_version = '11.0.0' repositories { diff --git a/ios/airship_flutter.podspec b/ios/airship_flutter.podspec index 0e3c7d0e..6fcb6fd2 100644 --- a/ios/airship_flutter.podspec +++ b/ios/airship_flutter.podspec @@ -20,6 +20,6 @@ Airship flutter plugin. s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' s.ios.deployment_target = "14.0" - s.dependency "AirshipFrameworkProxy", "10.1.1" + s.dependency "AirshipFrameworkProxy", "11.0.0" end From 44d1c1cc68343689939c02db6ae1c798a05e33c9 Mon Sep 17 00:00:00 2001 From: crow <david.crow@airship.com> Date: Thu, 24 Oct 2024 13:04:40 -0700 Subject: [PATCH 3/6] Use Object? instead of dynamic where necessary to improve type safety --- lib/src/airship_config.dart | 97 ++++++++++------------- lib/src/airship_embedded_view.dart | 6 +- lib/src/airship_feature_flag_manager.dart | 23 +++--- lib/src/airship_live_update_manager.dart | 11 +-- lib/src/airship_push.dart | 2 +- lib/src/custom_event.dart | 12 ++- lib/src/inbox_message.dart | 7 +- lib/src/inbox_message_view.dart | 2 +- lib/src/live_activity.dart | 36 ++++----- lib/src/push_notification_status.dart | 8 +- 10 files changed, 95 insertions(+), 109 deletions(-) diff --git a/lib/src/airship_config.dart b/lib/src/airship_config.dart index 48682cf9..ccbc73c8 100644 --- a/lib/src/airship_config.dart +++ b/lib/src/airship_config.dart @@ -2,7 +2,6 @@ import 'feature.dart'; import 'airship_utils.dart'; class AirshipConfig { - /// Default environment. final ConfigEnvironment? defaultEnvironment; @@ -54,24 +53,25 @@ class AirshipConfig { /// Android config. final AndroidConfig? androidConfig; - AirshipConfig({this.defaultEnvironment, - this.developmentEnvironment, - this.productionEnvironment, - this.site, - this.inProduction, - this.urlAllowList, - this.urlAllowListScopeOpenUrl, - this.urlAllowListScopeJavaScriptInterface, - this.isChannelCreationDelayEnabled, - this.initialConfigUrl, - this.enabledFeatures, - this.isChannelCaptureEnabled, - this.suppressAllowListError, - this.autoPauseInAppAutomationOnLaunch, - this.iosConfig, - this.androidConfig}); - - Map<String, dynamic> toJson() { + AirshipConfig( + {this.defaultEnvironment, + this.developmentEnvironment, + this.productionEnvironment, + this.site, + this.inProduction, + this.urlAllowList, + this.urlAllowListScopeOpenUrl, + this.urlAllowListScopeJavaScriptInterface, + this.isChannelCreationDelayEnabled, + this.initialConfigUrl, + this.enabledFeatures, + this.isChannelCaptureEnabled, + this.suppressAllowListError, + this.autoPauseInAppAutomationOnLaunch, + this.iosConfig, + this.androidConfig}); + + Map<String, Object?> toJson() { return { "default": defaultEnvironment?._toJson(), "development": developmentEnvironment?._toJson(), @@ -80,11 +80,13 @@ class AirshipConfig { "inProduction": inProduction, "urlAllowList": urlAllowList, "urlAllowListScopeOpenUrl": urlAllowListScopeOpenUrl, - "urlAllowListScopeJavaScriptInterface": urlAllowListScopeJavaScriptInterface, + "urlAllowListScopeJavaScriptInterface": + urlAllowListScopeJavaScriptInterface, "isChannelCreationDelayEnabled": isChannelCreationDelayEnabled, "initialConfigUrl": initialConfigUrl, - "enabledFeatures": enabledFeatures == null ? null : AirshipUtils - .toFeatureStringList(enabledFeatures!), + "enabledFeatures": enabledFeatures == null + ? null + : AirshipUtils.toFeatureStringList(enabledFeatures!), "isChannelCaptureEnabled": isChannelCaptureEnabled, "autoPauseInAppAutomationOnLaunch": autoPauseInAppAutomationOnLaunch, "ios": iosConfig?._toJson(), @@ -94,15 +96,15 @@ class AirshipConfig { } class ConfigEnvironment { - final String appKey; final String appSecret; final LogLevel? logLevel; final IOSEnvironment? ios; - ConfigEnvironment({required this.appKey, required this.appSecret, this.logLevel, this.ios}); + ConfigEnvironment( + {required this.appKey, required this.appSecret, this.logLevel, this.ios}); - Map<String, dynamic> _toJson() { + Map<String, Object?> _toJson() { return { "appKey": appKey, "appSecret": appSecret, @@ -117,31 +119,16 @@ class IOSEnvironment { IOSEnvironment({this.logPrivacyLevel}); - Map<String, dynamic> _toJson() { - return { - "logPrivacyLevel": logPrivacyLevel?.name - }; + Map<String, Object?> _toJson() { + return {"logPrivacyLevel": logPrivacyLevel?.name}; } } -enum AirshipLogPrivacyLevel { - private, - public -} +enum AirshipLogPrivacyLevel { private, public } -enum LogLevel { - verbose, - debug, - info, - warning, - error, - none -} +enum LogLevel { verbose, debug, info, warning, error, none } -enum Site { - us, - eu -} +enum Site { us, eu } class IOSConfig { /// iTunes ID for rate app and App Store deep links. @@ -149,10 +136,8 @@ class IOSConfig { IOSConfig({this.iTunesId}); - Map<String, dynamic> _toJson() { - return { - "iTunesId": iTunesId - }; + Map<String, Object?> _toJson() { + return {"iTunesId": iTunesId}; } } @@ -166,10 +151,10 @@ class AndroidConfig { /// Notification config. final AndroidNotificationConfig? notificationConfig; - AndroidConfig({this.appStoreUri, this.fcmFirebaseAppName, - this.notificationConfig}); + AndroidConfig( + {this.appStoreUri, this.fcmFirebaseAppName, this.notificationConfig}); - Map<String, dynamic> _toJson() { + Map<String, Object?> _toJson() { return { "appStoreUri": appStoreUri, "fcmFirebaseAppName": fcmFirebaseAppName, @@ -191,10 +176,10 @@ class AndroidNotificationConfig { /// The accent color. Must be a hex value #AARRGGBB. final String? accentColor; - AndroidNotificationConfig({this.icon, this.largeIcon, this.defaultChannelId, - this.accentColor}); + AndroidNotificationConfig( + {this.icon, this.largeIcon, this.defaultChannelId, this.accentColor}); - Map<String, dynamic> _toJson() { + Map<String, Object?> _toJson() { return { "icon": icon, "largeIcon": largeIcon, @@ -202,4 +187,4 @@ class AndroidNotificationConfig { "accentColor": accentColor }; } -} \ No newline at end of file +} diff --git a/lib/src/airship_embedded_view.dart b/lib/src/airship_embedded_view.dart index bc18a01c..7c0ac220 100644 --- a/lib/src/airship_embedded_view.dart +++ b/lib/src/airship_embedded_view.dart @@ -107,7 +107,7 @@ class AirshipEmbeddedViewState extends State<AirshipEmbeddedView> UiKitView( viewType: 'com.airship.flutter/EmbeddedView', onPlatformViewCreated: _onPlatformViewCreated, - creationParams: <String, dynamic>{ + creationParams: <String, Object?>{ 'embeddedId': widget.embeddedId, }, creationParamsCodec: const StandardMessageCodec(), @@ -135,7 +135,7 @@ class AirshipEmbeddedViewState extends State<AirshipEmbeddedView> id: params.id, viewType: 'com.airship.flutter/EmbeddedView', layoutDirection: TextDirection.ltr, - creationParams: <String, dynamic>{ + creationParams: <String, Object?>{ 'embeddedId': widget.embeddedId, }, creationParamsCodec: const StandardMessageCodec(), @@ -151,7 +151,7 @@ class AirshipEmbeddedViewState extends State<AirshipEmbeddedView> return wrapWithLayoutBuilder(AndroidView( viewType: 'com.airship.flutter/EmbeddedView', onPlatformViewCreated: _onPlatformViewCreated, - creationParams: <String, dynamic>{ + creationParams: <String, Object?>{ 'embeddedId': widget.embeddedId, }, creationParamsCodec: const StandardMessageCodec(), diff --git a/lib/src/airship_feature_flag_manager.dart b/lib/src/airship_feature_flag_manager.dart index b5d332ab..bf283cc5 100644 --- a/lib/src/airship_feature_flag_manager.dart +++ b/lib/src/airship_feature_flag_manager.dart @@ -3,24 +3,24 @@ import 'dart:convert'; /// Feature flag manager class AirshipFeatureFlagManager { - final AirshipModule _module; AirshipFeatureFlagManager(AirshipModule module) : _module = module; /// Gets and evaluates a feature flag with the given [name]. Future<FeatureFlag> flag(String name) async { - var featureFlag = await _module.channel.invokeMethod("featureFlagManager#flag", name); + var featureFlag = + await _module.channel.invokeMethod("featureFlagManager#flag", name); return FeatureFlag._fromJson(featureFlag); } - /// Tracks interaction with feature flag + /// Tracks interaction with feature flag Future<void> trackInteraction(FeatureFlag flag) async { - return await _module.channel.invokeMethod("featureFlagManager#trackInteraction", flag.toJSON()); + return await _module.channel + .invokeMethod("featureFlagManager#trackInteraction", flag.toJSON()); } } - /// Airship feature flag object. class FeatureFlag { static const IS_ELIGIBLE = "isEligible"; @@ -38,17 +38,18 @@ class FeatureFlag { final bool exists; /// Optional variables associated with the flag. - final Map<String, dynamic>? variables; + final Map<String, Object?>? variables; - const FeatureFlag._internal(this.original, this.isEligible, this.exists, this.variables); + const FeatureFlag._internal( + this.original, this.isEligible, this.exists, this.variables); static FeatureFlag _fromJson(dynamic json) { var isEligible = json[IS_ELIGIBLE]; var exists = json[EXISTS]; - Map<String, dynamic>? variables; + Map<String, Object?>? variables; if (json[VARIABLES] != null) { - variables = Map<String, dynamic>.from(json[VARIABLES]); + variables = Map<String, Object?>.from(json[VARIABLES]); } var original = json[ORIGINAL]; @@ -57,7 +58,7 @@ class FeatureFlag { } String toJSON() { - final Map<String, dynamic> data = { + final Map<String, Object?> data = { IS_ELIGIBLE: isEligible, EXISTS: exists, VARIABLES: variables, @@ -70,4 +71,4 @@ class FeatureFlag { String toString() { return "FeatureFlag($ORIGINAL=$original, $IS_ELIGIBLE=$isEligible, $EXISTS=$exists, $VARIABLES=$variables)"; } -} \ No newline at end of file +} diff --git a/lib/src/airship_live_update_manager.dart b/lib/src/airship_live_update_manager.dart index 3497698a..88c717a5 100644 --- a/lib/src/airship_live_update_manager.dart +++ b/lib/src/airship_live_update_manager.dart @@ -27,20 +27,13 @@ class AirshipLiveUpdateManager { Future<List<LiveUpdate>> list(LiveUpdateListRequest request) async { var response = await _module.channel.invokeMethod('liveUpdate#list', request.toJson()); - return (response as List<dynamic>) - .map((e) => LiveUpdate.fromJson(e as Map<String, dynamic>)) + return (response as List<Object?>) + .map((e) => LiveUpdate.fromJson(e as Map<String, Object?>)) .toList(); } /// Lists all Live Updates. /// @returns A Future with the result. - // Future<List<LiveUpdate>> listAll() async { - // var response = await _module.channel.invokeMethod('liveUpdate#listAll'); - // return (response as List<dynamic>) - // .map((e) => LiveUpdate.fromJson(e as Map<String, dynamic>)) - // .toList(); - // } - Future<List<LiveUpdate>> listAll() async { try { final result = await _module.channel.invokeMethod('liveUpdate#listAll'); diff --git a/lib/src/airship_push.dart b/lib/src/airship_push.dart index 3b70d0c0..02be41a8 100644 --- a/lib/src/airship_push.dart +++ b/lib/src/airship_push.dart @@ -38,7 +38,7 @@ class AirshipPush { /// Returns a Future with the permission result. The result may be null if the operation fails. Future<bool?> enableUserNotifications( {EnableUserPushNotificationsArgs? options}) async { - final Map<String, dynamic> arguments = options?.toJson() ?? {}; + final Map<String, Object?> arguments = options?.toJson() ?? {}; return await _module.channel .invokeMethod('push#enableUserNotifications', arguments); } diff --git a/lib/src/custom_event.dart b/lib/src/custom_event.dart index e8e407ec..c783a47f 100644 --- a/lib/src/custom_event.dart +++ b/lib/src/custom_event.dart @@ -23,11 +23,17 @@ class CustomEvent { final String? interactionType; /// The event properties. - final Map<String, dynamic>? properties; + final Map<String, Object?>? properties; - CustomEvent({required this.name, this.value, this.transactionId, this.interactionId, this.interactionType, this.properties}); + CustomEvent( + {required this.name, + this.value, + this.transactionId, + this.interactionId, + this.interactionType, + this.properties}); - Map<String, dynamic> toJSON() { + Map<String, Object?> toJSON() { return { EVENT_NAME: name, EVENT_VALUE: value, diff --git a/lib/src/inbox_message.dart b/lib/src/inbox_message.dart index 0687f892..ea70f844 100644 --- a/lib/src/inbox_message.dart +++ b/lib/src/inbox_message.dart @@ -1,4 +1,3 @@ - /// Inbox message object. class InboxMessage { /// The message title. @@ -20,7 +19,7 @@ class InboxMessage { final bool isRead; /// String to String map of any message extras. - final Map<String, dynamic>? extras; + final Map<String, Object?>? extras; const InboxMessage._internal(this.title, this.messageId, this.sentDate, this.expirationDate, this.listIcon, this.isRead, this.extras); @@ -32,7 +31,7 @@ class InboxMessage { var expirationDate = json["expirationDate"]; var listIcon = json["listIconUrl"]; var isRead = json["isRead"]; - var extras = Map<String, dynamic>.from(json["extras"]); + var extras = Map<String, Object?>.from(json["extras"]); return InboxMessage._internal( title, messageId, sentDate, expirationDate, listIcon, isRead, extras); } @@ -41,4 +40,4 @@ class InboxMessage { String toString() { return "InboxMessage(title=$title, messageId=$messageId)"; } -} \ No newline at end of file +} diff --git a/lib/src/inbox_message_view.dart b/lib/src/inbox_message_view.dart index cc7c723f..119f1f64 100644 --- a/lib/src/inbox_message_view.dart +++ b/lib/src/inbox_message_view.dart @@ -98,7 +98,7 @@ class InboxMessageView extends StatelessWidget { id: params.id, viewType: 'com.airship.flutter/InboxMessageView', layoutDirection: TextDirection.ltr, - creationParams: <String, dynamic>{}, + creationParams: <String, Object?>{}, creationParamsCodec: StandardMessageCodec(), ) ..addOnPlatformViewCreatedListener(params.onPlatformViewCreated) diff --git a/lib/src/live_activity.dart b/lib/src/live_activity.dart index f011f5f9..02fb8611 100644 --- a/lib/src/live_activity.dart +++ b/lib/src/live_activity.dart @@ -3,7 +3,7 @@ class LiveActivity { final String id; final String attributeTypes; final LiveActivityContent content; - final Map<String, dynamic> attributes; + final Map<String, Object?> attributes; final String state; LiveActivity({ @@ -14,8 +14,8 @@ class LiveActivity { required this.state, }); - static Map<String, dynamic> _ensureStringDynamicMap(dynamic data) { - if (data is Map<String, dynamic>) { + static Map<String, Object?> _ensureStringDynamicMap(dynamic data) { + if (data is Map<String, Object?>) { return data; } else if (data is Map) { return data.map((key, value) => MapEntry(key.toString(), @@ -26,7 +26,7 @@ class LiveActivity { } factory LiveActivity.fromJson(dynamic json) { - final Map<String, dynamic> data = _ensureStringDynamicMap(json); + final Map<String, Object?> data = _ensureStringDynamicMap(json); return LiveActivity( id: data['id'] as String? ?? '', @@ -37,7 +37,7 @@ class LiveActivity { ); } - Map<String, dynamic> toJson() => { + Map<String, Object?> toJson() => { 'id': id, 'attributeTypes': attributeTypes, 'content': content.toJson(), @@ -47,7 +47,7 @@ class LiveActivity { } class LiveActivityContent { - final Map<String, dynamic> state; + final Map<String, Object?> state; final String? staleDate; final double relevanceScore; @@ -58,7 +58,7 @@ class LiveActivityContent { }); factory LiveActivityContent.fromJson(dynamic json) { - final Map<String, dynamic> data = + final Map<String, Object?> data = LiveActivity._ensureStringDynamicMap(json); return LiveActivityContent( @@ -68,7 +68,7 @@ class LiveActivityContent { ); } - Map<String, dynamic> toJson() => { + Map<String, Object?> toJson() => { 'state': state, 'staleDate': staleDate, 'relevanceScore': relevanceScore, @@ -81,7 +81,7 @@ abstract class LiveActivityRequest { const LiveActivityRequest({required this.attributesType}); - Map<String, dynamic> toJson(); + Map<String, Object?> toJson(); } /// Live Activity list request. @@ -90,13 +90,13 @@ class LiveActivityListRequest extends LiveActivityRequest { : super(attributesType: attributesType); @override - Map<String, dynamic> toJson() => {'attributesType': attributesType}; + Map<String, Object?> toJson() => {'attributesType': attributesType}; } /// Live Activity start request. class LiveActivityStartRequest extends LiveActivityRequest { final LiveActivityContent content; - final Map<String, dynamic> attributes; + final Map<String, Object?> attributes; const LiveActivityStartRequest({ required String attributesType, @@ -105,7 +105,7 @@ class LiveActivityStartRequest extends LiveActivityRequest { }) : super(attributesType: attributesType); @override - Map<String, dynamic> toJson() => { + Map<String, Object?> toJson() => { 'attributesType': attributesType, 'content': content.toJson(), 'attributes': attributes, @@ -124,7 +124,7 @@ class LiveActivityUpdateRequest extends LiveActivityRequest { }) : super(attributesType: attributesType); @override - Map<String, dynamic> toJson() => { + Map<String, Object?> toJson() => { 'attributesType': attributesType, 'activityId': activityId, 'content': content.toJson(), @@ -145,7 +145,7 @@ class LiveActivityStopRequest extends LiveActivityRequest { }) : super(attributesType: attributesType); @override - Map<String, dynamic> toJson() => { + Map<String, Object?> toJson() => { 'attributesType': attributesType, 'activityId': activityId, if (content != null) 'content': content!.toJson(), @@ -157,21 +157,21 @@ class LiveActivityStopRequest extends LiveActivityRequest { abstract class LiveActivityDismissalPolicy { const LiveActivityDismissalPolicy(); - Map<String, dynamic> toJson(); + Map<String, Object?> toJson(); } class LiveActivityDismissalPolicyImmediate extends LiveActivityDismissalPolicy { const LiveActivityDismissalPolicyImmediate(); @override - Map<String, dynamic> toJson() => const {'type': 'immediate'}; + Map<String, Object?> toJson() => const {'type': 'immediate'}; } class LiveActivityDismissalPolicyDefault extends LiveActivityDismissalPolicy { const LiveActivityDismissalPolicyDefault(); @override - Map<String, dynamic> toJson() => const {'type': 'default'}; + Map<String, Object?> toJson() => const {'type': 'default'}; } class LiveActivityDismissalPolicyAfterDate extends LiveActivityDismissalPolicy { @@ -180,7 +180,7 @@ class LiveActivityDismissalPolicyAfterDate extends LiveActivityDismissalPolicy { const LiveActivityDismissalPolicyAfterDate(this.date); @override - Map<String, dynamic> toJson() => { + Map<String, Object?> toJson() => { 'type': 'after', 'date': date, }; diff --git a/lib/src/push_notification_status.dart b/lib/src/push_notification_status.dart index 92bd2299..daaaf126 100644 --- a/lib/src/push_notification_status.dart +++ b/lib/src/push_notification_status.dart @@ -41,7 +41,9 @@ class PushNotificationStatus { var isOptedIn = json["isOptedIn"] ?? false; var isUserOptedIn = json["isUserOptedIn"] ?? false; var notificationPermissionStatus = - json["notificationPermissionStatus"] ?? PermissionStatus.notDetermined; + json["notificationPermissionStatus"] is PermissionStatus + ? json["notificationPermissionStatus"] as PermissionStatus + : PermissionStatus.notDetermined; return PushNotificationStatus._internal( isUserNotificationsEnabled, areNotificationsAllowed, @@ -91,8 +93,8 @@ class EnableUserPushNotificationsArgs { this.fallback, }); - Map<String, dynamic> toJson() { - final Map<String, dynamic> json = {}; + Map<String, Object?> toJson() { + final Map<String, Object?> json = {}; if (fallback != null) { json['fallback'] = fallback!.name; From 557c693c83158a8bb5b87eb3f5d4f52797f4f179 Mon Sep 17 00:00:00 2001 From: crow <david.crow@airship.com> Date: Thu, 24 Oct 2024 13:06:59 -0700 Subject: [PATCH 4/6] Set Airship Proxy Delegate on Airship Autopilot --- ios/Classes/AirshipAutopilot.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ios/Classes/AirshipAutopilot.swift b/ios/Classes/AirshipAutopilot.swift index 25e4075b..67891d21 100644 --- a/ios/Classes/AirshipAutopilot.swift +++ b/ios/Classes/AirshipAutopilot.swift @@ -11,6 +11,9 @@ public class AirshipAutopilot: NSObject { public func onLoad(launchOptions: [UIApplication.LaunchOptionsKey : Any]?) { self.launchOptions = launchOptions try? AirshipProxy.shared.attemptTakeOff(launchOptions: launchOptions) + + /// Set Airship Proxy Delegate on Airship Autopilot + AirshipProxy.shared.delegate = self } private (set) var launchOptions: [UIApplication.LaunchOptionsKey : Any]? From 8e9b9a86216e8161620f04d1880a285b448e1881 Mon Sep 17 00:00:00 2001 From: crow <david.crow@airship.com> Date: Thu, 24 Oct 2024 14:35:23 -0700 Subject: [PATCH 5/6] Fix delegate call order --- ios/Classes/AirshipAutopilot.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Classes/AirshipAutopilot.swift b/ios/Classes/AirshipAutopilot.swift index 67891d21..64284fd8 100644 --- a/ios/Classes/AirshipAutopilot.swift +++ b/ios/Classes/AirshipAutopilot.swift @@ -10,10 +10,10 @@ public class AirshipAutopilot: NSObject { @MainActor @objc public func onLoad(launchOptions: [UIApplication.LaunchOptionsKey : Any]?) { self.launchOptions = launchOptions - try? AirshipProxy.shared.attemptTakeOff(launchOptions: launchOptions) - /// Set Airship Proxy Delegate on Airship Autopilot AirshipProxy.shared.delegate = self + + try? AirshipProxy.shared.attemptTakeOff(launchOptions: launchOptions) } private (set) var launchOptions: [UIApplication.LaunchOptionsKey : Any]? From 32b8c5cb9f3a1213b173a688e7385971e37e5116 Mon Sep 17 00:00:00 2001 From: crow <david.crow@airship.com> Date: Thu, 24 Oct 2024 15:10:32 -0700 Subject: [PATCH 6/6] Update CHANGELOG --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f931fd7..1fd24364 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Flutter Plugin Changelog +## Version 8.0.0 - October 24, 2024 + +Major version that makes it easier to include Airship in a hybrid app. The only breaking change is when extending the AirshipPluginExtender protocol on java there is a new extendConfig(Contex, AirshipConfigOptions.Builder) method to implement. Most application will not be affected. + +### Changes + +- Added new methods to the plugin extender to make hybrid app integrations easier + ## Version 7.9.0 - October 20, 2024 Minor version release with several new features including: iOS Live Activities, Android Live Updates, Message Center improvements, and iOS notification service extension support in the iOS example project.