ngCordova 捕获无法在设备上运行

ngCordova capture not working on device

我正在尝试使用 Ionic 和 ngCordova 录制音频。

这是我的代码: $scope.captureAudio = 函数() { var options = { limit: 3, duration: 10 };

$cordovaCapture.captureAudio(options).then(function(audioData) {
  // Success! Audio data is here
  alert(audioData);
  console.log(audioData);
}, function(err) {
  // An error occurred. Show a message to the user
  alert(err);
});
};

当我在模拟器中 运行 它工作正常并调出录音机,当录音完成后它注销音频数据。

当我将它上传到离子视图并 运行 时,我什么也得不到。甚至没有错误。

有人以前见过这样的东西吗?

谢谢 凯文

离子视图尚不支持$cordovaCapture 插件。

请参阅此 link 中支持的插件列表。

您可以直接使用运行命令运行设备中的代码。

ionic run android