private void Initialize() { // Load unreferenced modules AirshipAutomation.Init(); AirshipExtendedActions.Init(); NSNotificationCenter.DefaultCenter.AddObserver(aName: (NSString)UAChannel.ChannelCreatedEvent, (NSNotification notification) => { string channelID = notification.UserInfo[UAChannel.ChannelIdentifierKey].ToString(); OnChannelCreation?.Invoke(this, new ChannelEventArgs(channelID)); }); NSNotificationCenter.DefaultCenter.AddObserver(aName: (NSString)UAChannel.ChannelUpdatedEvent, (NSNotification notification) => { string channelID = notification.UserInfo[UAChannel.ChannelIdentifierKey].ToString(); OnChannelUpdate?.Invoke(this, new ChannelEventArgs(channelID)); }); //Adding Inbox updated Listener NSNotificationCenter.DefaultCenter.AddObserver(aName: (NSString)"com.urbanairship.notification.message_list_updated", (notification) => { EventHandler handler = OnMessageCenterUpdated; if (handler != null) { handler(this, EventArgs.Empty); } }); }
public void OnChannelCreated(string channelId) { OnChannelCreation?.Invoke(this, new ChannelEventArgs(channelId)); }