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 not working if passed number instead of string #545

Closed
aggarwalankush opened this issue Sep 13, 2016 · 2 comments
Closed

CallNumber not working if passed number instead of string #545

aggarwalankush opened this issue Sep 13, 2016 · 2 comments

Comments

@aggarwalankush
Copy link
Contributor

aggarwalankush commented Sep 13, 2016

CallNumber.callNumber('4083868925', false); - this works
CallNumber.callNumber(4083868925, false); - this fails

As mentioned in call-number.d.ts, numberToCall is expected in number format but it fails on real device. Passing numberToCall in string format works.

/**
 * @name CallNumber
 * @description
 * Call a number directly from your Cordova/Ionic application.
 *
 * @usage
 * ```
 * import {CallNumber} from 'ionic-native';
 *
 * CallNumber.callNumber(18001010101, true)
 *   .then(() => console.log('Launched dialer!'))
 *   .catch(() => console.log('Error launching dialer'));
 *
 * ```
 */
export declare class CallNumber {
    /**
     * Calls a phone number
     * @param numberToCall {number} The phone number to call
     * @param bypassAppChooser {boolean} Set to true to bypass the app chooser and go directly to dialer
     */
    static callNumber(numberToCall: number, bypassAppChooser: boolean): Promise<any>;
}

Also, behind the scenes, ionic-native uses https://github.com/Rohfosho/CordovaCallNumberPluginwhich also expects numberToCall in string.

@candelibas
Copy link

+1

@ihadeed
Copy link
Collaborator

ihadeed commented Sep 19, 2016

thanks for pointing it out, it's fixed now and the fix will be available in the next release

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

3 participants