Ionic-native: phonegap-push-plugin says it is not installed

Created on 29 Jan 2018  路  11Comments  路  Source: ionic-team/ionic-native

I'm submitting a ... (check one with "x")
[X ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/

Current behavior:
After installation and configuration of this plugin, on the Chorme inspect tab, I can find warn log with informaiton:

Native: tried calling PushNotification.init, but the PushNotification plugin is not installed.
pluginWarn @ main.js:58006

Expected behavior:
Successfull registration device by the plugin without warning about installation fail.

Steps to reproduce:
Install plugin step by step this introduction: https://ionicframework.com/docs/native/push/ and insert necessary code into your application. Run application on real android device and check the logs on Chrome inspect tab.

Related code:

  private pushInit() {
    let pushObject = this.push.init({
      android: {
        senderID: "xxxxxxxxxxxxx",
        sound: 'true',
        forceShow: true,
      },
      ios: {
        alert: 'true',
        badge: true,
        sound: 'false'
      }
    });

    pushObject.on('registration').subscribe((registration: any) => console.log('Device registered', registration));
  }

Other information:
You need to replace senderID: "xxxxxx" with the real sender ID. I created issue on the plugin github but it was closed as ionic issue. You can find this issue here: https://github.com/phonegap/phonegap-plugin-push/issues/2169

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

cli packages: (/Users/michazzz/Repo/test-ionic/test-ionic-webapp/node_modules)

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 7.0.1 

local packages:

    @ionic/app-scripts : 1.3.12
    Cordova Platforms  : android 6.4.0
    Ionic Framework    : ionic-angular 3.3.0

System:

    Android SDK Tools : 26.1.1
    ios-deploy        : 1.9.2 
    Node              : v6.10.3
    npm               : 5.0.3 
    OS                : macOS High Sierra
    Xcode             : Xcode 9.2 Build version 9C40b 

Environment Variables:

    ANDROID_HOME : /Users/michazzz/Library/Android/sdk

Misc:

    backend : pro

bug need to reproduce

Most helpful comment

Hi guys. I resolved problem install android 7.1.0 with comand
$ cordova platform add [email protected]
and $ ionic cordova run [email protected]

All 11 comments

Having the same trouble here.
The method "push.hasPermission()" enters the ".catch" case with the error "plugin_not_installed" because of that error.

same problem

same problem too

@Michazzz, you resolved this problem?

@Michazzz @vanessasoutoc @mateuspontesmoraes
have you resolved the issue guys

@aneeskodappana @vanessasoutoc No, I didn't

I have the same problem. Did you have solve the issue? Please shame me the fix.

I tried to reinstall the plugin but after this I receive this build error:

> Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
> For input string: "+"

my project.properties is:

target=android-26
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.system.library.1=com.squareup.okhttp3:okhttp-urlconnection:3.10.0
cordova.system.library.2=com.android.support:support-v4:24.1.1+
cordova.system.library.3=com.google.android.gms:play-services-analytics:+
cordova.system.library.4=com.android.support:support-v13:26.+
cordova.system.library.5=me.leolin:ShortcutBadger:1.1.17@aar
cordova.system.library.6=com.google.firebase:firebase-messaging:11.6.2
cordova.gradle.include.1=phonegap-plugin-push/acronym-push.gradle

Thanks

Hi guys. I resolved problem install android 7.1.0 with comand
$ cordova platform add [email protected]
and $ ionic cordova run [email protected]

I have the same problem, can someone help me?
Here are my ionic infos:

Ionic:

   ionic (Ionic CLI)  : 4.6.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.3
   @ionic/app-scripts : 3.2.1

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.4.0, (and 9 other plugins)

System:

   NodeJS : v9.10.1 (/usr/local/bin/node)
   npm    : 6.2.0
   OS     : macOS Mojave

and here my plugin list:

cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 2.4.0 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-streaming-media 2.2.0 "StreamingMedia"
cordova-plugin-whitelist 1.3.3 "Whitelist"
phonegap-plugin-push 2.0.0 "PushPlugin"

Updating Android version with the last Push plugin didn't solve this problem...
I'm just going mad on this. :(

Try this
setTimeout(()=>{

   this.pushInit();

 }, 1000);
Was this page helpful?
0 / 5 - 0 ratings