I have the same issue with the âplugin not foundâ, Iâve install the plugin via the CLI and it said âPlugin âphonegap-plugin-pushâ already installed on android.â, but when i run the app on device, it said âplugin not foundâ.
Hope you can foud the solution, and share it out with us. BTW, I use ionic1.
So I put the ionicPush in platform.ready, when I run my app in device, it still show me the âpush plugin not foundâ error.
Hereâs my code. Any idea?
$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();
}
if ($window.geofence) {
$window.geofence.initialize();
}
$ionicPush.register().then(function (t) {
alert(t);
console.log(t);
}, function (error) {
alert(error);
});
});
in the ionic 2 you should manually instantiate push object.
Example from documentation:
var push = Push.init({
android: {
senderID: â12345679â
},
ios: {
alert: âtrueâ,
badge: true,
sound: âfalseâ
},
windows: {}
});
Hi,
From my understanding, the push plugin (from ionic-cloud) doesnât work in the browser, that is expected.
The good news is that it should work nonetheless on a real device.
I was not satisfied with any of the answers here after I too ran into this problem, so here is how I solved it.
The problem occurs because I was attempting to view my app in the browser which doesnât support push capabilities, since that can only work when running a device.
So I just needed to add an if statement that only runs the device-specific code when my code is running on an actual device.
In the constructor of the app.component.ts, weâre instantiating the Platform service and declaring it as the âplatformâ variable. (see pic)
All we have to do is call one of Platformâs built-in methods to check on what platform weâre emulating our app on! This can be done easily by encasing our code in the following if statement ()
Hello @starkemc,
I donât test for ios yet, my expectation is that you could simply check for âis not browserâ rather âis androidâ.
Something like
if (!this.platform.is(âbrowserâ))
âŚ