using UIKit; public class MyAppDelegate : UIApplicationDelegate { public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { application.RegisterForRemoteNotifications(); return true; } }
using UIKit; public class MyViewController : UIViewController { public override void ViewDidLoad() { base.ViewDidLoad(); UIApplication.SharedApplication.RegisterForRemoteNotifications(); } }In this example, the RegisterForRemoteNotifications method is called in the ViewDidLoad method of a ViewController class. This registers the application to receive remote notifications when the ViewController is loaded. The package library for the UIApplication class is the UIKit framework, which is part of the iOS SDK.