Skip to content

Commit

Permalink
Add FIXME
Browse files Browse the repository at this point in the history
  • Loading branch information
khmMouna committed Oct 20, 2023
1 parent 57fd139 commit 43cac84
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 26 deletions.
6 changes: 3 additions & 3 deletions MauiSample/AppShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
Route="Inbox" />

<ShellContent
Title="Sttings"
Icon="settings_inbox.png"
Title="Settings"
Icon="icon_settings.png"
ContentTemplate="{DataTemplate local:PushSettingsViewController}"
Route="Inbox" />
Route="Settings" />

</TabBar>
</Shell>
Expand Down
7 changes: 5 additions & 2 deletions MauiSample/HomePageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,19 @@ public HomePageViewModel()
OnPrefCenterButtonClicked = new Command(PerformOnPrefCenterButtonClicked);

Airship.Instance.OnChannelCreation += OnChannelEvent;
Airship.Instance.OnPushNotificationStatusUpdate += OnPushNotificationStatusEvent;
// FIXME:
//Airship.Instance.OnPushNotificationStatusUpdate += OnPushNotificationStatusEvent;

Refresh();
}

~HomePageViewModel()
{
Airship.Instance.OnChannelCreation -= OnChannelEvent;
// FIXME:
//Airship.Instance.OnPushNotificationStatusUpdate -= OnPushNotificationStatusEvent;
}

private void OnChannelEvent(object sender, EventArgs e) => Refresh();

private void OnPushNotificationStatusEvent(object sender, EventArgs e) => Refresh();
Expand Down
16 changes: 9 additions & 7 deletions MauiSample/PushSettingsViewController.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ void UpdateTagsCell()
void UpdateNamedUser()
{
namedUserLabel.Text = "";
Airship.Instance.GetNamedUser(namedUser =>
{
Device.BeginInvokeOnMainThread(() => {
namedUserLabel.Placeholder = namedUser != null ? namedUser : "named user";
});
});
}
// FIXME:
// Airship.Instance.GetNamedUser(namedUser =>
// {
// Device.BeginInvokeOnMainThread(() =>
// {
// namedUserLabel.Placeholder = namedUser != null ? namedUser : "named user";
// });
// });
//}
}

Check failure on line 88 in MauiSample/PushSettingsViewController.xaml.cs

View workflow job for this annotation

GitHub Actions / ci

*** expected
1 change: 1 addition & 0 deletions src/Airship.Net/Platforms/Android/Airship.cs
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ private void ApplyChannelSubscriptionListHelper(List<Channel.SubscriptionListEdi
}
}

// FIXME:
//private void ApplyContactSubscriptionListHelper(List<Contact.SubscriptionListEditor.SubscriptionListOperation> operations, ScopedSubscriptionListEditor editor)
private void ApplyContactSubscriptionListHelper(List<Contact.SubscriptionListEditor.SubscriptionListOperation> operations)
{
Expand Down
32 changes: 18 additions & 14 deletions src/Airship.Net/Platforms/iOS/Airship.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,20 @@ private void Initialize()
OnChannelCreation?.Invoke(this, new ChannelEventArgs(channelID));
});

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)
)
);
});
// 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)
// )
// );
//});

//Adding Inbox updated Listener
NSNotificationCenter.DefaultCenter.AddObserver(aName: (NSString)"com.urbanairship.notification.message_list_updated", (notification) =>
Expand Down Expand Up @@ -204,7 +205,10 @@ private static Features FeaturesFromUAFeatures(UAFeatures uAFeatures)

public string? ChannelId => UAirship.Channel.Identifier;

Check warning on line 206 in src/Airship.Net/Platforms/iOS/Airship.cs

View workflow job for this annotation

GitHub Actions / ci

Nullability of reference types in return type of 'string? Airship.ChannelId.get' doesn't match implicitly implemented member 'string IAirship.ChannelId.get' (possibly because of nullability attributes).

public void GetNamedUser(Action<string> namedUser) => UAirship.Contact.GetNamedUserID(namedUser);
public void GetNamedUser(Action<string> namedUser)
{
UAirship.Contact.GetNamedUserID(namedUser);
}

public void ResetContact() => UAirship.Contact.Reset();

Expand Down

0 comments on commit 43cac84

Please sign in to comment.