我正在尝试将对讲机与Ionic 4集成。
我能找到的唯一文档是Ionic 3的文档... https://ionicframework.com/docs/native/intercom/
我知道它适用于Ionic 3,并且我正在使用Ionic 4,但这是我唯一能找到的文档。当我尝试实现它时,出现此错误...
core.js:12501 ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function
TypeError: Object(...) is not a function
难道还无法将对讲机与Ionic 4集成在一起吗?这是我的代码(简体)...
import { Component } from '@angular/core';
import { Intercom } from '@ionic-native/intercom';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
constructor(private intercom: Intercom) {
}
ShowIntercom() {
this.intercom.displayMessenger();
}
}
任何帮助将不胜感激。
答案 0 :(得分:2)
在使用Ionic 4和Ionic Native版本5及更高版本时,您需要使用“ / ngx”导入它们
import { Intercom } from '@ionic-native/intercom/ngx';
答案 1 :(得分:0)
当时没有。我们决定更换客户通信提供商(出于商业目的)所以不能再说了。我不认为原始问题是特定于平台的。