Skip to content

Commit

Permalink
NG Simulscan Multibarcode decoding added
Browse files Browse the repository at this point in the history
  • Loading branch information
NDZL committed Nov 11, 2024
1 parent 5b8d905 commit ca6a0fc
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions datawedge-MAUI-SampleApp/Platforms/Android/DWIntentReceiver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Android.Content;
using Android.OS;
using Android.Util;
using AndroidX.Core;
using CommunityToolkit.Mvvm.Messaging;
using System;
using System.Collections.Generic;
Expand All @@ -17,14 +18,27 @@ namespace datawedge_MAUI_SampleApp.Platforms.Android
{

[BroadcastReceiver(Enabled = true, Exported =true)]
public class DWIntentReceiver : BroadcastReceiver
{
public override void OnReceive(Context context, Intent intent)
{
public class DWIntentReceiver : BroadcastReceiver
{
public override void OnReceive(Context context, Intent intent)
{
System.Console.WriteLine("Here is DW on MAUI");
if (intent.Extras != null)
{
if (intent.HasExtra("com.symbol.datawedge.label_type")) {
if (intent.HasExtra("com.symbol.datawedge.barcodes"))
{
WeakReferenceMessenger.Default.Send("NG SIMULSCAN - MULTIBARCODE DETECTED");
List<Bundle> palobs = intent.Extras.GetParcelableArrayList("com.symbol.datawedge.barcodes").Cast<Bundle>().ToList();
foreach (Bundle b in palobs)
{
String barcode = b.GetString("com.symbol.datawedge.data_string");
String timestamp = b.GetString("com.symbol.datawedge.timestamp");
String symbology = b.GetString("com.symbol.datawedge.label_type");
WeakReferenceMessenger.Default.Send(symbology + " " + barcode);
}
}
else if (intent.HasExtra("com.symbol.datawedge.label_type"))
{
String bc_type = intent.Extras.GetString("com.symbol.datawedge.label_type");
String bc_data = intent.Extras.GetString("com.symbol.datawedge.data_string");

Expand All @@ -50,13 +64,7 @@ public override void OnReceive(Context context, Intent intent)
}
catch (Exception e) { }
}

}





}
}
}
}
}

0 comments on commit ca6a0fc

Please sign in to comment.