Skip to content

Commit

Permalink
Fix MC mark read and delete methods in Airship.Net
Browse files Browse the repository at this point in the history
  • Loading branch information
jyaganeh committed Mar 15, 2024
1 parent 6d99b64 commit 9264063
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Minor release that updates the Airship SDK to iOS 17.9.0 and Android 17.7.3, and
- Updated iOS SDK to 17.9.0
- Updated Android SDK to 17.7.3
- Support for dark mode and extended theming options for Message Center plist
- Fixed an iOS bug in the Message Center message delete and mark read methods in Airship.Net

## Version 19.1.0 - Jan 25, 2024
Minor release that updates the Airship SDK to iOS 17.7.3 and Android 17.7.2, fixes an iOS custom event properties reporting issue, and Android contact subscription list editing. Apps that target iOS and make use of custom events or Android and make use of contact subscription editing should update.
Expand Down
9 changes: 7 additions & 2 deletions MauiSample/MessagePage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using AirshipDotNet.MessageCenter.Controls;
using AirshipDotNet;
using AirshipDotNet.MessageCenter.Controls;

namespace MauiSample;

Expand Down Expand Up @@ -32,9 +33,13 @@ void MessageView_LoadStarted(object sender, MessageLoadStartedEventArgs args) =>
void MessageView_LoadFailed(object sender, MessageLoadFailedEventArgs args) =>
LoadFailed?.Invoke(this, args);

void MessageView_LoadFinished(object sender, MessageLoadFinishedEventArgs args) =>
void MessageView_LoadFinished(object sender, MessageLoadFinishedEventArgs args)
{
LoadFinished?.Invoke(this, args);

Airship.Instance.MarkMessageRead(MessageId);
}

void MessageView_Closed(object sender, MessageClosedEventArgs args) =>
Closed?.Invoke(this, args);
}
4 changes: 2 additions & 2 deletions src/Airship.Net/Platforms/iOS/Airship.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,13 @@ public void AssociateIdentifier(string key, string identifier)
public void MarkMessageRead(string messageId)
{
string[] toRead = { messageId };
UAMessageCenter.Shared.Inbox.MarkReadWithMessageIDs(toRead, null);
UAMessageCenter.Shared.Inbox.MarkReadWithMessageIDs(toRead, () => { });
}

public void DeleteMessage(string messageId)
{
string[] toDelete = { messageId };
UAMessageCenter.Shared.Inbox.DeleteWithMessageIDs(toDelete, null);
UAMessageCenter.Shared.Inbox.DeleteWithMessageIDs(toDelete, () => { });
}

public void MessageCenterUnreadCount(Action<int> messageCount)
Expand Down

0 comments on commit 9264063

Please sign in to comment.