Ejemplo n.º 1
0
        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);
                }
            });
        }
Ejemplo n.º 2
0
 public void OnChannelUpdated(string channelId)
 {
     OnChannelUpdate?.Invoke(this, new ChannelEventArgs(channelId));
 }