在xamarin iOS中获取运行时警告

coo*_*shu 2 notifications push-notification xamarin.ios ios

我正在创建xamarin iOS应用程序.我的项目基于推送通知.对于注册推送通知,我已经编写了以下代码应用程序.

public override bool FinishedLaunching (UIApplication app, NSDictionary options)
        {
// some code
            UIRemoteNotificationType notificationType = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound;
            UIApplication.SharedApplication.RegisterForRemoteNotificationTypes (notificationType);
    // some code        
        }
public override void RegisteredForRemoteNotifications(UIApplication application,NSData deviceToken)
        {
//some code
}
public override void FailedToRegisterForRemoteNotifications(UIApplication application,NSError error)
        {
            Console.WriteLine ("Error AppDelegate push notification");
            new UIAlertView ("Error For Push Notification",error.LocalizedDescription,null,"OK",null).Show();
        }
        public override void ReceivedRemoteNotification(UIApplication application,NSDictionary userInfo)
        {
            Console.WriteLine ("Recieve Notification calling ");
        }


        public override void DidReceiveRemoteNotification (UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler)
        {

            Console.WriteLine ("From DidReceiveRemoteNotification");
//              if([content-available]) {
//                  // fetch content
//                  completionHandler (UIBackgroundFetchResult.NewData);
//              }
        }
Run Code Online (Sandbox Code Playgroud)

所以当我在设备上运行此应用程序时,我还没有找到允许推送通知警报.有两个警告.

warning MT1108: Could not find developer tools for this 7.1 (11D167) device. Please ensure you are using a compatible Xcode version and then connect this device to Xcode to install the development support files.



error MT1007: Failed to launch the application 'com.laitkor.pilat' on the device 'Laitkor iPod': Look for earlier warnings returned: 0x454. You can still launch the application manually by tapping on it.
Run Code Online (Sandbox Code Playgroud)

所以我认为这些警告可能是推送通知错误的原因.所以请帮助我任何帮助将不胜感激.

pou*_*pou 5

看起来你正在使用旧的Xcode(例如5.0)和运行iOS 7.1的设备.你得到的警告,即MT1108.

这样的配置可以工作(大部分时间)但是会有一些缺点.例如,Xcode附带的代码无法与设备通信(启动应用程序).那个错误发生了什么,即MT1007.

如果您无法更新Xcode(至5.1),则需要手动启动应用程序(点击它的图标).一旦启动它应该连接回调试器,你将恢复正常.