Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CallNumber's .isCallSupported() throws "plugin_not_installed" error, but the functionality still works #2428

Closed
uzbekjon opened this issue Apr 3, 2018 · 5 comments
Assignees

Comments

@uzbekjon
Copy link
Contributor

uzbekjon commented Apr 3, 2018

I'm submitting a ...
[x] bug report
[ ] feature request
[ ] support request

Current behavior:

Call Number plugin's .isCallSupported() method throws "plugin_not_installed" error. Even though the plugin is installed AND work as expected.

Expected behavior:

The promise returned by the method should resolve to true on devises that support the functionality.

Steps to reproduce:

Install the plugin as usual:

$ ionic cordova plugin add call-number
$ npm install --save @ionic-native/call-number

Add the module to providers list:

import { CallNumber } from '@ionic-native/call-number';

...

@NgModule({
  ...

  providers: [
    ...
    CallNumber
    ...
  ]
  ...
})
export class AppModule { }

Related code:

import { Component } from '@angular/core';
import { CallNumber } from "@ionic-native/call-number";

@Component({
  selector: 'page-home',
  template: `
    {{isSupported | json}}
    <button ion-button (click)="callNumber()">CallNumber</button>
  `
})
export class HomePage {
  isSupported = false;

  constructor(public phone: CallNumber) {
    this.phone.isCallSupported()
      .then(support => this.isSupported = support)
      .catch(err => this.isSupported = err);
  }

  callNumber(){
    this.phone.callNumber("123456789", true)
      .then(res => this.result = res)
      .catch(err => this.result = err);
  }
}

Other information:

Ionic info:

cli packages: (/Users/uzbekjon/.nvm/versions/node/v8.9.4/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0 

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.0.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v8.9.4
    npm               : 5.7.1 
    OS                : macOS High Sierra
    Xcode             : Xcode 9.2 Build version 9C40b 

Environment Variables:

    ANDROID_HOME : /Users/uzbekjon/Library/Android/sdk

Misc:

    backend : pro
@anjildhamala
Copy link

The plugin does not even have the function isCallSupported() and @ionic-native plugin code doesn't seem to be doing anything by itself. I wonder why the function is even there.

@uzbekjon
Copy link
Contributor Author

The plugin has it here and iOS as well as Android native codes in the plugin also have it.

@danielsogl danielsogl self-assigned this Apr 14, 2018
@ng22792
Copy link

ng22792 commented Sep 21, 2018

I would like to reopen this issue as the exact behaviour is still occurring.

@ManigandanRaamanathan
Copy link

Im having 2 ionic project, It works fine on one. Another it's not working at all. No respond at all when executing the function

@ManigandanRaamanathan
Copy link

@ng22792 my solution for your problem is that try remove your ionic platform based on ( https://ionicframework.com/docs/cli/cordova/platform/ ) and then add the platform back. This will download all the missed out plugin in platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants