Ionic Cordova Push Prevents iOS Vibration and Sound Problem

I play with the ionic and plugin notifications about connecting the phone to the plugin, but it seems it can not make the sound play. I initialize push with:

var push = new Ionic.Push({
                        "debug": true,
                        "onNotification": function(notification) {
                            var payload = notification.payload;
                        },
                        "onRegister": function(data) {
                            console.log(data.token);
                        },
                        "pluginConfig": {
                            "ios": {
                                "badge": true,
                                "sound": true, 
                                "alert":true,
                                "vibration": true
                            }
                        } 
                    });

I can send a push signal through an ionic push REST api https://push.ionic.io/api/v1/push , as shown below, which sends a warning successfully, but without sound or vibration.

{
  "user_ids":[
    "14"
  ],
  "notification":{
    "alert":"Hello World!"
    }
  }

I seem to have tried a bunch of different combinations of the above, including using specific iOS options according to the docs:

{
  "user_ids":[
    "14"
  ],
  "notification":{
    "alert":"Hello World!",
    "ios":{
      "expiry": 1454927886239,
      "badge":1,
      "priority": 10,
      "contentAvailable": 1,
      "payload":{
          "sound":"default"
      }
    }
  }
}

. -- push- , , . - ?

+4

Source: https://habr.com/ru/post/1627789/


All Articles