I have implemented code for when broadcast for barcode is received it will create order but it only works when the application in RAM.
It only received a barcode only when App is in Ram
Below is my code for manifest-
<receiver android:name="com.apple.utility.BarcodeBroadcastReceiver" android:enabled="true" android:exported="false"> <intent-filter> <action android:name="com.clover.BarcodeBroadcast" /> </intent-filter> </receiver>
my BroadcastReciever for barcode -
class BarcodeBroadcastReceiver : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
val barcodeResult = BarcodeResult(intent)
Toast.makeText(context, "Here is your barcode data11 - ${barcodeResult.barcode}", Toast.LENGTH_SHORT).show()
}
}
Thanks in advance,