Open chrislaurie-io opened 3 years ago
Hi guys, got same issue here. Also tried FlutterBeep.playSysSound(AndroidSoundIDs.TONE_CDMA_ABBR_ALERT) and got the same error.
Do this in your MainActivity.kt
import com.gonoter.flutter_beep.FlutterBeepPlugin // Add this
class MainActivity: FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState);
FlutterBeepPlugin.registerWith(registrarFor("com.gonoter.flutter_beep.FlutterBeepPlugin")); // Add this
}
}
@kbaylosis this didn't work for me, still getting the same error.
@danielle-h what version of flutter are you using? that code i provided no longer applies in the latest flutter
@kbaylosis I was using the latest flutter at the time. I haven't tried it since, I used a different solution to get a beep in my app.
@kbaylosis I tested it now, it's working great, thanks!
For java
import com.gonoter.flutter_beep.FlutterBeepPlugin;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
public class MainActivity extends FlutterActivity implements PluginRegistrantCallback {
@Override
public void registerWith(PluginRegistry registry) {
FlutterBeepPlugin.registerWith(registry.registrarFor("com.gonoter.flutter_beep.FlutterBeepPlugin"));
}
}
The exception's gone but still don't heard any sound.
FlutterBeep.beep(false);
FlutterBeep.playSysSound(AndroidSoundIDs.TONE_CDMA_ABBR_ALERT);
Calling in code FlutterBeep.beep(): Throwse this error in platform_channel.dart:
MissingPluginException(No implementation found for method stopSysSound on channel flutter_beep))