我现在正在使用ionic3,ionic3中没有clarification.d.ts文件。因此,我无法在该文件中声明cordova。谁能以ionic3方式解决问题?非常感谢!
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Platform } from 'ionic-angular';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
/*Cordova add */
wikitudePlugin: any;
requiredFeatures = [ "2d_tracking", "geo" ];
constructor(public navCtrl: NavController, public platform: Platform) {
platform.ready().then(() => {
this.wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");
this.wikitudePlugin.isDeviceSupported(this.onDeviceSupported, this.onDeviceNotSupported, this.requiredFeatures);
console.log('The wikitude object: ', this.wikitudePlugin);
console.log('The wikitude test method: ',this.wikitudePlugin.isDeviceSupported);
});
}
onDeviceSupported () {
console.log('device supported');
}
onDeviceNotSupported () {
console.log('device not supported');
}
}