I am new to Ionic 2 and all around. I'm trying to set up my first mobile application: by clicking a button, I will open my own navigation (for example, Google Maps for Android). I installed the launchnavigator
plugin:
ionic plugin add uk.co.workingedge.phonegap.plugin.launchnavigator
and inside the cremony.ts page:
import { Component } from '@angular/core'; import { NavController } from 'ionic-angular'; import { LaunchNavigator, LaunchNavigatorOptions } from 'ionic-native'; @Component({ selector: 'page-ceremony', templateUrl: 'ceremony.html' }) export class Ceremony { constructor(public navCtrl: NavController) { } navigate() { let options: LaunchNavigatorOptions = { start: "" }; LaunchNavigator.navigate("London, UK", options) .then( success => alert('Launched navigator'), error => alert('Error launching navigator: ' + error) ); } }
build npm run build
and upload it to IonicView using ionic upload
. I do everything as suggested in this link , but with different luck.
But when I click the button (simple <button ion-button (click)="navigate()">Navigate</button>
in the .html ceremony) in Ionic View, say: Error launghing navigator: plugin_not_installed
.
I checked the project, the plugins
directory contains the uk.co.workingedge.phonegap.plugin.launchnavigatorlooks
directory. So I look at package.json
and config.xml
and I added the value uk.co.workingedge.phonegap.plugin.launchnavigator
to cordovaPlugins
and the tag <plugin name="uk.co.workingedge.phonegap.plugin.launchnavigator" spec="~3.2.1" />
at the root of the widget
. npm run build
, ionic upload
, but nothing has changed.
Where is my mistake?
source share