Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Ionic push: no sound

$
0
0

@RWilliams wrote:

I have Ionic push notifications working perfectly for Android and almost perfectly for iOS - with the exception that no sound is produced on the arrival of a notification.

My code is as follows:

    var push = new Ionic.Push({
        "debug": false,
        "onNotification": function (notification) {
            var payload = notification.payload;
            console.log("on notification: " + notification, payload);
        },
        "onRegister": function (data) {
            console.log("on register: " + data.token);
        },
        "pluginConfig": {
            "ios": {
                "alert": true,
                "sound": true,
                "badge": true
            }
        }
    });
    
    var user = Ionic.User.current();
    var callback = function (pushToken) {
        console.log('Registered token:', pushToken.token);
        user.addPushToken(pushToken);

        if (!user.id) {
            user.id = Ionic.User.anonymousId();
        }

        var success = function (response) {
            console.log('user was saved');
        };

        var failure = function (error) {
            console.log('user was NOT saved' + error);
        };

        user.save().then(success, failure);
    }

    push.register(callback);

Currently using:
iPad 2,
iOS: 8.4.1,
Ionic: 1.1.0,
Ionic CLI: 1.7.7,
phonegap-plugin-push: 1.2.3,
Cordova: 5.3.3,

If anyone has any ideas as to why this might be that'd be great :smile:

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>