public override void ViewDidLoad() { base.ViewDidLoad(); // Create and set a delegate to receive callbacks on channel registration this.MyRegistrationDelegate = new RegistrationDelegate(); this.MyRegistrationDelegate.ChannelButton = this.ChannelButton; UAirship.Push.RegistrationDelegate = this.MyRegistrationDelegate; // Display the channel ID if it's already set string channelID = UAirship.Push.ChannelID; if (channelID != null) { this.ChannelButton.SetTitle(channelID, UIControlState.Normal); } // Copy the channel ID to the clipboard when tapped this.ChannelButton.TouchUpInside += delegate { if (UAirship.Push.ChannelID != null) { UIPasteboard.General.String = UAirship.Push.ChannelID; new UIAlertView("Channel copied to clipboard", null, null, "OK", null).Show(); } }; }
public override void ViewDidLoad() { base.ViewDidLoad (); // Create and set a delegate to receive callbacks on channel registration this.MyRegistrationDelegate = new RegistrationDelegate (); this.MyRegistrationDelegate.ChannelButton = this.ChannelButton; UAirship.Push.RegistrationDelegate = this.MyRegistrationDelegate; // Display the channel ID if it's already set string channelID = UAirship.Push.ChannelID; if (channelID != null) { this.ChannelButton.SetTitle (channelID, UIControlState.Normal); } // Copy the channel ID to the clipboard when tapped this.ChannelButton.TouchUpInside += delegate { if (UAirship.Push.ChannelID != null) { UIPasteboard.General.String = UAirship.Push.ChannelID; new UIAlertView("Channel copied to clipboard", null, null, "OK", null).Show(); } }; }