Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Ionic push: no sound

$
0
0

@RWilliams did you ever figure this out?

I'm having the same problem where I want to send push notifications from the ionic.io dashboard and trigger a badge and sound when the push arrives. My pushes work from the dashboard, but the pluginConfig doesn't seem to be acknowledged. I also checked my notification settings for my app and ensured everything is turned on and that my sound on my device is turned on.

Here's my code:

angular.module('starter', ['ionic','ionic.service.core', 'starter.controllers', 'starter.services', 'ionic.service.push'])

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

    }
    if (window.StatusBar) {
      // org.apache.cordova.statusbar required
      StatusBar.styleDefault();
    }

    $ionicPush.init({
      "debug": true,
      "onNotification": function(notification) {
        console.log(notification.text);
        $state.go('tab.chats');
        alert(notification.text);
      },
      "onRegister": function(data) {
        alert(data.token);
      },
      "pluginConfig": {
        "ios": {
          badge: "true",
          sound: "true"
        }
      }
    });

    $ionicPush.register();
  });
})

Viewing all articles
Browse latest Browse all 228595

Trending Articles



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