Accessing custom button with ionic capacitor

Hello, i got a task to build a walkie talkie app using any framework and i chose ionic+angular. But my client and employees will use a blackview phone which has a custom button specifically used as PTT button.

How can i access that using ionic with capacitor or cordova?

By creating a custom capacitor plugin and also using java/kotlin to be able to communicate with that button. There is no plugin for what you are trying to do.

Ok cool, i want this button to be active even on screen off. So when screen off, if that button is pressed i can trigger a recorder on my app, is that possible?

Im not 100% sure if that’s possible. Cause the app needs to be running in order to trigger that method. and even if the app is in the background(requires another plugin but not sure if it works) and the phone is off, there needs to be a way for that button to communicate with the app.

It would be easier to just build this app using native development.

so there’s no way i can listen to hardware button event on lockscreen? even with capacitor plugin?

Found this tutorial using cordova: Keep Running Ionic 5/Angular Apps In Background Mode (With Example) | Techiediaries maybe this can point you in the right direction.

No, you need to create a native app.