Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70434

Ionic 5 capacitor call-number failing

$
0
0

@ionic-native/call-number@5.26.0
call-number@1.0.1

Installed with:

npm install call-number
npm install @ionic-native/call-number
ionic cap sync

In package.json:

"dependencies": {
    "@agm/core": "^1.1.0",
    "@angular/common": "~9.1.6",
    "@angular/core": "~9.1.6",
    "@angular/forms": "~9.1.6",
    "@angular/platform-browser": "~9.1.6",
    "@angular/platform-browser-dynamic": "~9.1.6",
    "@angular/router": "~9.1.6",
    "@capacitor/android": "^2.1.0",
    "@capacitor/core": "2.1.0",
    "@capacitor/ios": "^2.1.0",
    "@ionic-native/call-number": "^5.26.0",
    "@ionic-native/clipboard": "^5.26.0",
    "@ionic-native/core": "^5.0.7",
    "@ionic-native/in-app-browser": "^5.26.0",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic/angular": "^5.0.0",
    "call-number": "^1.0.1",
    "lodash": "^4.17.15",
    "moment": "^2.26.0",
    "moment-timezone": "^0.5.31",
    "rxjs": "~6.5.1",
    "tslib": "^1.10.0",
    "zone.js": "~0.10.2"
  }

Installed and copied over to both Android and iOS using `ionic capacitor sync". I note that although it finds the plugin there is an error for iOS. I am on Ubuntu, so assume this to be because of that:

✔ Copying web assets from www to android/app/src/main/assets/public in 432.91ms
✔ Copying native bridge in 583.86μp
✔ Copying capacitor.config.json in 554.20μp
  Found 1 Cordova plugin for android
    call-number (1.0.1)
✔ copy in 469.95ms
✔ Updating Android plugins in 5.92ms
  Found 0 Capacitor plugins for android:
  Found 1 Cordova plugin for android
    call-number (1.0.1)
✔ update android in 24.66ms
✔ Copying web assets from www to ios/App/public in 218.04ms
✔ Copying native bridge in 248.80μp
✔ Copying capacitor.config.json in 211.39μp
  Found 1 Cordova plugin for ios
    call-number (1.0.1)
✔ copy in 228.51ms
✔ Updating iOS plugins in 4.77ms
  Found 0 Capacitor plugins for ios:
  Found 1 Cordova plugin for ios
    call-number (1.0.1)
✖ Updating iOS native dependencies with "pod install" (may take several minutes): 
✖ update ios: 
[error] Error running update: /bin/sh: 1: pod: not found

✔ copy in 277.02μp
✔ update web in 3.80μp
Sync finished in 0.75s

In app.module I have:

...
import { CallNumber } from '@ionic-native/call-number/ngx';
...
@NgModule({
 ...
  providers: [
    ...
    CallNumber
  ],
  ...
})
export class AppModule {}

In service code I have:

...
import { CallNumber } from '@ionic-native/call-number/ngx';
...
@Injectable({
  providedIn: 'root'
})
export class UtilsService {

  constructor(
    private callNumber: CallNumber
  ) { }

  public CallPhoneNumber(phoneNumber) : void{
    this.callNumber.callNumber(phoneNumber, true)
      .then(() => console.log('Launched dialer!'))
      .catch(() => console.log('Error launching dialer'));
  }
}

Calling this from a component appears to work in Android emulator, but when compiled in the online AppFlow and deployed as development build to physical iPhone pressing the “call” button which calls this CallPhoneNumber() function does nothing.

I note that it says:

  Found 0 Capacitor plugins for ios:
  Found 1 Cordova plugin for ios
    call-number (1.0.1)

I’m not sure if that’s normal?

Any idea why this isn’t working please?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 70434

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>