From 5492f427b00bbd99118be090cedca7e134dd18a3 Mon Sep 17 00:00:00 2001 From: khmMouna Date: Tue, 24 Oct 2023 15:24:52 +0200 Subject: [PATCH] Remove leftover extendedActions && FIXME --- Airship.Net.sln | 6 ----- Airship.iOS.slnf | 3 +-- MauiSample/HomePageViewModel.cs | 6 ++--- MauiSample/MessageCenterPage.xaml.cs | 7 +++-- MauiSample/PushSettingsViewController.xaml.cs | 15 +++++------ src/Airship.Net/Platforms/iOS/Airship.cs | 27 +++++++++---------- 6 files changed, 28 insertions(+), 36 deletions(-) diff --git a/Airship.Net.sln b/Airship.Net.sln index a5e02896..b7e78af0 100644 --- a/Airship.Net.sln +++ b/Airship.Net.sln @@ -23,8 +23,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AirshipBindings.iOS.Core", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AirshipBindings.iOS.Automation", "src\AirshipBindings.iOS.Automation\AirshipBindings.iOS.Automation.csproj", "{70434FB5-A468-4777-9478-DD2AB80BE0E2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AirshipBindings.iOS.ExtendedActions", "src\AirshipBindings.iOS.ExtendedActions\AirshipBindings.iOS.ExtendedActions.csproj", "{BFFFE653-04CD-4563-BF2D-B6F31349F30D}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AirshipBindings.iOS.MessageCenter", "src\AirshipBindings.iOS.MessageCenter\AirshipBindings.iOS.MessageCenter.csproj", "{AC22EEC5-DCA6-49D3-8B37-533B5565E2CF}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Airship.Net", "src\Airship.Net\Airship.Net.csproj", "{C419463A-31A8-477B-A99E-1B0947AA416B}" @@ -89,10 +87,6 @@ Global {70434FB5-A468-4777-9478-DD2AB80BE0E2}.Debug|Any CPU.Build.0 = Debug|Any CPU {70434FB5-A468-4777-9478-DD2AB80BE0E2}.Release|Any CPU.ActiveCfg = Release|Any CPU {70434FB5-A468-4777-9478-DD2AB80BE0E2}.Release|Any CPU.Build.0 = Release|Any CPU - {BFFFE653-04CD-4563-BF2D-B6F31349F30D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BFFFE653-04CD-4563-BF2D-B6F31349F30D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BFFFE653-04CD-4563-BF2D-B6F31349F30D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BFFFE653-04CD-4563-BF2D-B6F31349F30D}.Release|Any CPU.Build.0 = Release|Any CPU {AC22EEC5-DCA6-49D3-8B37-533B5565E2CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AC22EEC5-DCA6-49D3-8B37-533B5565E2CF}.Debug|Any CPU.Build.0 = Debug|Any CPU {AC22EEC5-DCA6-49D3-8B37-533B5565E2CF}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/Airship.iOS.slnf b/Airship.iOS.slnf index 550c68de..530b35f5 100644 --- a/Airship.iOS.slnf +++ b/Airship.iOS.slnf @@ -5,11 +5,10 @@ "src\\AirshipBindings.iOS.Basement\\AirshipBindings.iOS.Basement.csproj", "src\\AirshipBindings.iOS.Core\\AirshipBindings.iOS.Core.csproj", "src\\AirshipBindings.iOS.Automation\\AirshipBindings.iOS.Automation.csproj", - "src\\AirshipBindings.iOS.ExtendedActions\\AirshipBindings.iOS.ExtendedActions.csproj", "src\\AirshipBindings.iOS.MessageCenter\\AirshipBindings.iOS.MessageCenter.csproj", "src\\AirshipBindings.iOS.NotificationContentExtension\\AirshipBindings.iOS.NotificationContentExtension.csproj", "src\\AirshipBindings.iOS.NotificationServiceExtension\\AirshipBindings.iOS.NotificationServiceExtension.csproj", "src\\AirshipBindings.iOS.PreferenceCenter\\AirshipBindings.iOS.PreferenceCenter.csproj" ] } -} \ No newline at end of file +} diff --git a/MauiSample/HomePageViewModel.cs b/MauiSample/HomePageViewModel.cs index 8eec25ae..7f517c08 100644 --- a/MauiSample/HomePageViewModel.cs +++ b/MauiSample/HomePageViewModel.cs @@ -62,8 +62,7 @@ public HomePageViewModel() OnPrefCenterButtonClicked = new Command(PerformOnPrefCenterButtonClicked); Airship.Instance.OnChannelCreation += OnChannelEvent; - // FIXME: - //Airship.Instance.OnPushNotificationStatusUpdate += OnPushNotificationStatusEvent; + Airship.Instance.OnPushNotificationStatusUpdate += OnPushNotificationStatusEvent; Refresh(); } @@ -71,8 +70,7 @@ public HomePageViewModel() ~HomePageViewModel() { Airship.Instance.OnChannelCreation -= OnChannelEvent; - // FIXME: - //Airship.Instance.OnPushNotificationStatusUpdate -= OnPushNotificationStatusEvent; + Airship.Instance.OnPushNotificationStatusUpdate -= OnPushNotificationStatusEvent; } private void OnChannelEvent(object sender, EventArgs e) => Refresh(); diff --git a/MauiSample/MessageCenterPage.xaml.cs b/MauiSample/MessageCenterPage.xaml.cs index 3501ac4c..d826812b 100644 --- a/MauiSample/MessageCenterPage.xaml.cs +++ b/MauiSample/MessageCenterPage.xaml.cs @@ -30,8 +30,11 @@ public void Refresh() { Airship.Instance.InboxMessages(messages => { - listView.ItemsSource = messages; - refreshView.IsRefreshing = false; + MainThread.BeginInvokeOnMainThread(() => + { + listView.ItemsSource = messages; + refreshView.IsRefreshing = false; + }); }); } diff --git a/MauiSample/PushSettingsViewController.xaml.cs b/MauiSample/PushSettingsViewController.xaml.cs index e6022b75..1743a880 100644 --- a/MauiSample/PushSettingsViewController.xaml.cs +++ b/MauiSample/PushSettingsViewController.xaml.cs @@ -76,13 +76,12 @@ void UpdateTagsCell() void UpdateNamedUser() { namedUserLabel.Text = ""; - // FIXME: - // Airship.Instance.GetNamedUser(namedUser => - // { - // Device.BeginInvokeOnMainThread(() => - // { - // namedUserLabel.Placeholder = namedUser != null ? namedUser : "named user"; - // }); - // }); + Airship.Instance.GetNamedUser(namedUser => + { + MainThread.BeginInvokeOnMainThread(() => + { + namedUserLabel.Placeholder = namedUser != null ? namedUser : "named user"; + }); + }); } } \ No newline at end of file diff --git a/src/Airship.Net/Platforms/iOS/Airship.cs b/src/Airship.Net/Platforms/iOS/Airship.cs index e13cb9f3..cbc40198 100644 --- a/src/Airship.Net/Platforms/iOS/Airship.cs +++ b/src/Airship.Net/Platforms/iOS/Airship.cs @@ -30,20 +30,19 @@ private void Initialize() OnChannelCreation?.Invoke(this, new ChannelEventArgs(channelID)); }); - // FIXME: - //NSNotificationCenter.DefaultCenter.AddObserver(aName: (NSString)UAPush.NotificationStatusUpdateEvent, (notification) => - //{ - // OnPushNotificationStatusUpdate?.Invoke(this, - // new PushNotificationStatusEventArgs( - // notification.UserInfo[UAPush.IsUserNotificationsEnabled].Equals((NSNumber)1), - // notification.UserInfo[UAPush.AreNotificationsAllowed].Equals((NSNumber)1), - // notification.UserInfo[UAPush.IsPushPrivacyFeatureEnabled].Equals((NSNumber)1), - // notification.UserInfo[UAPush.IsPushTokenRegistered].Equals((NSNumber)1), - // notification.UserInfo[UAPush.IsUserOptedIn].Equals((NSNumber)1), - // notification.UserInfo[UAPush.IsOptedIn].Equals((NSNumber)1) - // ) - // ); - //}); + NSNotificationCenter.DefaultCenter.AddObserver(aName: (NSString)UAPush.NotificationStatusUpdateEvent, (notification) => + { + OnPushNotificationStatusUpdate?.Invoke(this, + new PushNotificationStatusEventArgs( + notification.UserInfo[UAPush.IsUserNotificationsEnabled].Equals((NSNumber)1), + notification.UserInfo[UAPush.AreNotificationsAllowed].Equals((NSNumber)1), + notification.UserInfo[UAPush.IsPushPrivacyFeatureEnabled].Equals((NSNumber)1), + notification.UserInfo[UAPush.IsPushTokenRegistered].Equals((NSNumber)1), + notification.UserInfo[UAPush.IsUserOptedIn].Equals((NSNumber)1), + notification.UserInfo[UAPush.IsOptedIn].Equals((NSNumber)1) + ) + ); + }); //Adding Inbox updated Listener NSNotificationCenter.DefaultCenter.AddObserver(aName: (NSString)"com.urbanairship.notification.message_list_updated", (notification) =>