如何实现Pushbots离子

时间:2016-10-04 14:09:02

标签: angularjs ionic-framework push-notification

想在离子中做出推送通知,但经过一些研究后我得到了一些线索,但还不够。我有点困惑如何初始化pushbot,因为在网上只有pushgap示例可用,如果有任何替代可用请提前告知谢谢。以下是代码我的代码

angular.module('app', ['ionic','app.controllers', 'app.routes', 'app.services', 'app.directives'])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {

    if(window.cordova && window.cordova.plugins.Keyboard) {
      // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
      // for form inputs)
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);

      // Don't remove this line unless you know what you are doing. It stops the viewport
      // from snapping when text inputs are focused. Ionic handles this internally for
      // a much nicer keyboard experience.
      cordova.plugins.Keyboard.disableScroll(true);


    }

    window.plugins.PushbotsPlugin.initialize("57f383574a9efa904d8b4567", {"android":{"sender_id":"438608897686"}});


    if(window.StatusBar) {
      StatusBar.styleDefault();
    }
  });
})

0 个答案:

没有答案