tchvu3 / capacitor-voice-recorder

Capacitor plugin for voice recording
69 stars 57 forks source link

Cant get it to work on iOS #8

Closed NickHatBoecker closed 3 years ago

NickHatBoecker commented 3 years ago

Hey there,

I try to implement a chat where the user can record voice messages. I added your plugin via yarn add capacitor-voice-recorder and I have the following lines in my Info.plist:

<key>NSMicrophoneUsageDescription</key>
<string>To Record Audio Messages in Chat</string>

In my Vue file I have:

import { Plugins } from '@capacitor/core'

const { VoiceRecorder } = Plugins

VoiceRecorder.canDeviceVoiceRecord().then((result) => { alert('works') })

But VoiceRecorder is undefined on an iOS Emulator. There are other Plugins available, but not this one. I guess there is something missing in the README. Because for Android you added the Plugin Class in the Android code.

UPDATE: I'm using Capacitor 2.4.2 and it's also not working under Android. On Android's MainActivity.java it says:

Cannot resolve symbol "tchvu3"

On this line import com.tchvu3.capvoicerecorder.VoiceRecorder;

Can you please help me?

Thanks in advance Nick

NickHatBoecker commented 3 years ago

Update 2 Got it working in Android now, but had to add the following line to app/build.gradle:

dependencies {
    ...
    implementation project(':capacitor-voice-recorder')
}

But still no luck for iOS

tchvu3 commented 3 years ago

I have updated the plugin to capacitor v3. please let me know how it is or if you find any bug