2017-08-08 15 views
1

ionic3のphoneRTCを使用してリアルタイムの音声通話アプリを作成しています。Cordovaプラグインのインポート

は、私が今

<plugin name="com.dooble.phonertc" spec="~2.0.1" /> 

をからconfig.xmlには、次のコマンド私のpackage.json

"cordova": { 
     "plugins": { 
      "com.dooble.phonertc": {} 
     } 
    } 

と次に次の行を追加します

ionic cordova plugin add cordova-plugin-phonertc --save 

を使用してコルドバプラグインを追加しました私はhome.tsファイルでこれをどのように使用したり、インポートしたりするのか分かりません。上記の方法は、あなたが動作しません場合は

.TS

declare var cordova; 

@Component({ 
}) 
export class Page2 { 

    constructor(public platform: Platform) { 

    } 

    getMyPluginInfo() { 

    this.platform.ready().then(() => {//this is very important 

     cordova.plugins.yourPlugin.YourPluginMethod();//replace plugin's name with this `yourPlugin` and `YourPluginMethod` with plugin's method which you want 

    }); 
    } 
} 

注:phonertc以来

答えて

1

は、あなたがこのようにそれを使用する必要がネイティブプラグインではありませんthis articleで説明されている別の方法を試みることができる(タイトルUsing a Plugin Not Included in Ionic Nativeの下にそれを見てください)

関連する問題