ngCordova push register not working in iOS8

Hi there I’m building an iOS app with ngCordova with push notifications. I’ve done all the certificate and provisioning profile stuff already and I’m using pushbots as service to send the notification to the devices. It works perfectly in iOS9 (specifically 9.1) but not in 8.4.1. By not working I mean that doesn’t fire the register method so I don’t get the popup asking to allow notification.

Here’s my code:

document.addEventListener('deviceready', onDeviceReady, false);

function onDeviceReady() {


      $cordovaPush.register(iosConfig).then(function(deviceToken) {

        $http({
          method: 'PUT',
          url: 'https://api.pushbots.com/deviceToken',
          headers: {
            'Content-Type': 'application/json',
            'x-pushbots-appid': 'xxxxxxxxxxxxx',
            'x-pushbots-secret': 'xxxxxxxxxxxxxxxx',
          },
          data: {
            platform: 0,
            token: deviceToken,
          },
        });

      }, function(err) {
        alert('Registration error: ' + err);
      });
      
      ...

Any idea? is this a known issue?

Thanks

UPDATE:
While building the app with cordova command line with cordova run ios --device when on iOS 8 I see this error which I don’t see when I build for iOS 9: enabledRemoteNotificationTypes is not supported in iOS 8.0 and later. Which doesn’t make sense because it works in iOS 9. I’ve seen some posts regarding this but very confusing indeed, any idea? Thanks

Can you show us the decleration of iosConfig?

Do you mean the config.xml?

no

you have

$cordovaPush.register(iosConfig)

but have you declared iosConfig?

see Xoilac TV - Website Trực Tiếp Bóng Đá Số 1 VN XoilacTV

Yes of course, as I said it works in iOS9

var iosConfig = {
      "badge": true,
      "sound": true,
      "alert": true,
    };

have you tried to remove the last comma? Maybe ios8 doesn’t like it and then you have an js error?

I can try but when I remote debug it with safari I don’t have any js error in the console