0

I am writing a Flutter app that listens for barcode scans via Zebra's Datawedge service. I have the service configured that it launches an Android Intent with the barcode information.

I am able to successfully register a broadcast receiver, and I know that I am receiving the broadcasts when I scan. The problem however is that for some reason the Intent action is not the same as what I have registered. I have never run into this problem working with Datawedge in Android Studio, and my profile is identical to any other project.

Every time I scan I receive an Intent with the action android.intent.action.RUN, and the extras Bundle[{enable-checked-mode=true, start-paused=true, enable-dart-profiling=true, verify-entry-points=true, enable-background-compilation=true}]

My question is, does Dart or Flutter obscure incoming Android Intents in some way? I've also tried registering my action/category in the AndroidManifest, and that has also not worked, I am still getting the same intent.

  • I tested DataWedge Intents with Flutter and I did not see the Intents being modified, https://github.com/ZebraDevs/DataWedge-Flutter-Demo. I was using broadcast Intents. – Darryn Campbell Oct 15 '21 at 15:25
  • I did get this figured out in the end, the problem was that I was using an anonymous BroadcastReceiver object( a pattern which I have used successfully outside of Flutter). Once I extracted that into a proper class it worked fine. – Thomas Frantz Oct 19 '21 at 18:13

1 Answers1

1

My mistake here was using an anonymous BroadcastReceiver object. Once I refactored that into a full class and created an instance of it, then it worked just fine.