代码之家  ›  专栏  ›  技术社区  ›  nachshon f

与Ionic 4集成对讲机?

  •  1
  • nachshon f  · 技术社区  · 6 年前

    我想把对讲机和离子4整合起来。

    我唯一能找到的文件是关于离子3的。。。 https://ionicframework.com/docs/native/intercom/

    core.js:12501 ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function
    TypeError: Object(...) is not a function
    

    是不是还不能把对讲机和离子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 回复  |  直到 6 年前
        1
  •  4
  •   Jay Ordway    6 年前

    使用Ionic 4和Ionic Native 5及以上版本时,需要使用“/ngx”导入它们

    import { Intercom } from '@ionic-native/intercom/ngx';
    
    推荐文章