【问题标题】:ERROR Error: Uncaught (in promise): MyPlugin does not have web implementationERROR 错误:未捕获(承诺中):MyPlugin 没有 Web 实现
【发布时间】:2019-09-24 06:56:17
【问题描述】:
我为 iOS、Android 和 Web (PWA) 制作了一个自定义电容器插件,但是当我在浏览器中打开基于电容器的应用时,我收到以下错误消息:
ERROR Error: Uncaught (in promise): MyPlugin does not have web implementation.
所以问题接缝是Capacitor没有找到插件的web实现。
【问题讨论】:
标签:
ios
angular
ionic-framework
progressive-web-apps
capacitor
【解决方案2】:
要在 Angular 应用程序中修复它,您必须在 app.component.ts 中添加以下行:
import {Component} from '@angular/core';
import {MyPlugin} from "capacitor-myplugin";
import {registerWebPlugin} from "@capacitor/core";
@Component({
selector: 'app-root',
templateUrl: 'app.component.html'
})
export class AppComponent {
constructor() {
this.initializeApp();
}
initializeApp() {
this.platform.ready().then(() => {
registerWebPlugin(MyPlugin);
});
}
}
www.onexip.com