phone 间隙寄存器甚至没有在 iOS 上触发

phone gap register even not firing on iOS

所以我的应用程序在 android 上运行完美。但是当我在真实的 iOS 设备上进行测试时,我无法注册设备以获取设备令牌。这是我的代码:

.run(function($ionicPlatform, $rootScope) {
  $ionicPlatform.ready(function() {
    if(window.cordova && window.cordova.plugins.Keyboard) {
      // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
      // for form inputs)
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);

      // Don't remove this line unless you know what you are doing. It stops the viewport
      // from snapping when text inputs are focused. Ionic handles this internally for
      // a much nicer keyboard experience.
      cordova.plugins.Keyboard.disableScroll(true);
    }
    if(window.StatusBar) {
      StatusBar.styleDefault();
    }
    var push = PushNotification.init({
        android: {
          senderID: "411587591993"
        },
        browser: {
            pushServiceURL: 'http://push.api.phonegap.com/v1/push'
        },
        ios: {
            alert: "true",
            badge: "true",
            sound: "true"
        },
        windows: {}
    });
      push.on('registration', function(data) {
          console.log("Device Token: " + data.registrationId);
          $rootScope.devToken = data.registrationId;
      })
      push.on('notification', function(data) {
          if (data.additionalData.foreground) {
            alert(data.message);
          }
      })
  });
})

谁能帮我弄清楚为什么 push.on('registration') 甚至不注册我的设备来获取 ID? 这是我的 Xcode 控制台日志:

2016-08-19 15:43:27.474 pushNotify[930:236258] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/91498E22-6A53-405A-9497-B0EC644365B2/Library/Cookies/Cookies.binarycookies
2016-08-19 15:43:27.566 pushNotify[930:236258] Apache Cordova native platform version 4.1.0 is starting.
2016-08-19 15:43:27.567 pushNotify[930:236258] Multi-tasking -> Device: YES, App: YES
2016-08-19 15:43:27.622 pushNotify[930:236258] Using UIWebView
2016-08-19 15:43:27.625 pushNotify[930:236258] [CDVTimer][handleopenurl] 0.119984ms
2016-08-19 15:43:27.626 pushNotify[930:236258] [CDVTimer][intentandnavigationfilter] 1.450002ms
2016-08-19 15:43:27.626 pushNotify[930:236258] [CDVTimer][gesturehandler] 0.083029ms
2016-08-19 15:43:27.626 pushNotify[930:236258] CDVPlugin class CDVSplashScreen (pluginName: splashscreen) does not exist.
2016-08-19 15:43:27.627 pushNotify[930:236258] [CDVTimer][splashscreen] 0.093997ms
2016-08-19 15:43:27.627 pushNotify[930:236258] CDVPlugin class CDVStatusBar (pluginName: statusbar) does not exist.
2016-08-19 15:43:27.627 pushNotify[930:236258] [CDVTimer][statusbar] 0.087023ms
2016-08-19 15:43:27.627 pushNotify[930:236258] CDVPlugin class IonicKeyboard (pluginName: keyboard) does not exist.
2016-08-19 15:43:27.627 pushNotify[930:236258] [CDVTimer][keyboard] 0.083983ms
2016-08-19 15:43:27.627 pushNotify[930:236258] [CDVTimer][TotalPluginStartup] 2.694964ms
2016-08-19 15:43:27.761 pushNotify[930:236258] createNotificationChecker
2016-08-19 15:43:27.762 pushNotify[930:236258] not coldstart
2016-08-19 15:43:27.763 pushNotify[930:236258] active
2016-08-19 15:43:27.764 pushNotify[930:236258] PushPlugin skip clear badge
2016-08-19 15:43:28.001 pushNotify[930:236258] Resetting plugins due to page load.
2016-08-19 15:43:28.374 pushNotify[930:236258] Finished load of: file:///var/containers/Bundle/Application/E3454A9E-D203-4335-A64F-602C0AE8C181/pushNotify.app/www/index.html
2016-08-19 15:43:28.650 pushNotify[930:236258] CDVPlugin class CDVDevice (pluginName: Device) does not exist.
2016-08-19 15:43:28.650 pushNotify[930:236258] ERROR: Plugin 'Device' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2016-08-19 15:43:28.651 pushNotify[930:236258] -[CDVCommandQueue executePending] [Line 142] FAILED pluginJSON = ["Device651815033","Device","getDeviceInfo",[]]
2016-08-19 15:43:28.654 pushNotify[930:236258] CDVPlugin class CDVStatusBar (pluginName: StatusBar) does not exist.
2016-08-19 15:43:28.654 pushNotify[930:236258] ERROR: Plugin 'StatusBar' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2016-08-19 15:43:28.654 pushNotify[930:236258] -[CDVCommandQueue executePending] [Line 142] FAILED pluginJSON = ["StatusBar651815034","StatusBar","_ready",[]]

如有任何帮助,我们将不胜感激。我不明白为什么它在 android 上完美运行,而在 iOS 上却完全不运行。提前致谢!

我所要做的就是卸载我的平台并重新安装它们。它修复了 iOS 错误。现在一切正常。