I can successfully register my application for push notifications:
UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(
UIRemoteNotificationType.Alert
| UIRemoteNotificationType.Badge
| UIRemoteNotificationType.Sound);
But whenever I do this, my user interface usually freezes for 2-3 seconds. Even if I have it at an early stage of the application life cycle, as recommended (for example, even WillFinishLaunching), my user interface still freezes when my first ViewController loads.
My first thought was to register in a separate thread, but MonoTouch prevents this:
public virtual void RegisterForRemoteNotificationTypes(UIRemoteNotificationType types)
{
UIApplication.EnsureUIThread();
, , , UIAlertView, -, - , , UIAlertView !
modalPopup = new UIAlertView("Working", "The application is loading...", null, null);
modalPopup.Show();
RegisterForRemoteNotificationTypes();
modalPopup.DismissWithClickedButtonIndex(0, true);