2015-07-19 47 views
0

我的設備上有IonicPush推送通知,但是如果通過mp3聲音路徑發送,則忽略它。我快速查看了https://github.com/driftyco/ionic-service-push-client/blob/master/ionic-push.js,並懷疑第185行的window.Media可能未定義。離子推動支持聲音?

  $ionicPush.register({ 
       canShowAlert: false, //Should new pushes show an alert on your screen? 
       canSetBadge: true, //Should new pushes be allowed to update app icon badges? 
       canPlaySound: false, //Should notifications be allowed to play a sound? 
       canRunActionsOnWake: true, // Whether to run auto actions outside the app, 
       onNotification: function(notification) { 
       return true; 
       } 
      } 

有沒有其他人得到它的工作?

回答

0

好吧,所以我得到它的工作,這完全是我的錯,我現在將關閉此問題。對於將來出現同樣問題的任何人。以下可能會有用。

1)請確保您添加NG-科爾多瓦到應用程序模塊

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

2)確保你把MP3文件www目錄內,並用相對URL引用它。

如果仍有問題,請嘗試使用ionic emulate ios -lc來模擬應用程序以查看控制檯中的任何js錯誤。