android - ionic 1 push notification not working Error: Push plugin not found! See logs -
last week working on ionic 1 push notification based on link https://docs.ionic.io/services/push/#setup version 1. installed per doc.i have app id sendeid etc. here code app.js
.config(function ($urlrouterprovider, $ionicconfigprovider, $stateprovider, $cordovaapprateprovider, $ioniccloudprovider) { var paths = constants.paths; var rootname = paths.auth; $stateprovider.state(paths.app, { url: '/' + paths.app, abstract: true, templateurl: paths.modules + 'side/views/menu.html', controller: 'navigationcontroller vm' }), $ioniccloudprovider.init({ "core": { "app_id": "1:756854:android:849322b85"[not correct this] }, "push": { "sender_id": "myid", "pluginconfig": { "ios": { "badge": true, "sound": true }, "android": { "iconcolor": "#343434" } } } }); ; // catch deviceready event document.addeventlistener("deviceready", function () { var prefs = { language: 'en', appname: 'fuel buddy', iosurl: '<my_app_id>', androidurl: 'my url', windowsurl: 'my url' }; $cordovaapprateprovider.setpreferences(prefs) }, false); $ionicconfigprovider.scrolling.jsscrolling(false); //disable cache globally $ionicconfigprovider.views.maxcache(0); $urlrouterprovider.otherwise('/login'); }) .run(function ($log, $ionicplatform, $ionicpush, $ionicuser) { $ionicplatform.ready(function () { // native **must** go here // register push notifications receive unique token bot not working $ionicpush.register({ canshowalert: true, //can pushes show alert on screen? cansetbadge: true, //can pushes update app icon badges? canplaysound: true, //can notifications play sound? canrunactionsonwake: true, //can run actions outside app, }).then(function (token) { alert(token); console.log(token); return $ionicpush.savetoken(token); }); // ionic user data -- not working $ionicuser.load().then(function () { // register push notifications receive unique token $ionicpush.register({ canshowalert: true, //can pushes show alert on screen? cansetbadge: true, //can pushes update app icon badges? canplaysound: true, //can notifications play sound? canrunactionsonwake: true, //can run actions outside app, }).then(function (token) { alert('token:'+token); console.log(token); return $ionicpush.savetoken(token); }); }); }); })
i tried code in $ionicpush.register()
inside $ionicuser.load()
, out side nothing works, refereed links. tried run apk in adnroid device , tried in ipad. token not creating using register. if knows please me lase console.loged
$ionicpush
object created without error.
Comments
Post a Comment