问题描述:

Is there a way to disable the vibration via push notification payload when notification displayed?

This is my sample payload.

$payload = array

(

'title' => 'Title',

'message' => 'Message',

'vibrate' => 0,

'content-available' => 1

);

But vibration is still working even I set the vibrate value to 0.

Any help will be greatly appreciated. Thank you!

网友答案:

Within the PushNotification.init() method you also need to set 'vibrate' to false, as it defaults to true for Android. iOS however does not have a similar setting, but setting sound to false may also work (i haven't tested this).

var push = PushNotification.init({
    android: {
        senderID: "12345679",
        vibrate: false
    },
    ios: {
        sound: false
    },
    windows: {}
});

https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/API.md#pushnotificationinitoptions

相关阅读:
Top