Xamarin Forms, How to scan a barcode from another application and get a response?

Jasur Berdiyev 1 Reputation point
2021-10-02T18:53:07.897+00:00

I am using zxing to scan barcodes, zxing is not working as well as I would like. Requires scanning with external QRbot app. I run QRbot from the app, but I don't know how to get the response, after scanning, the URL opens. How to get value?

QRbot Documentation https://ioshelp.qrbot.net/xcallback

Launching QRbot, I don't know how to get the Barcode.

private async void QRbot_Clicked(object sender, EventArgs e)
{
Uri uri = new Uri("https://qrbot.net/x-callback-url/scan?x-success=https%3A%2F%2Fyourwebsite.com");
await Browser.OpenAsync(uri, BrowserLaunchMode.SystemPreferred);
}

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,325 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 29,301 Reputation points Microsoft Vendor
    2021-10-04T05:21:32.787+00:00

    Hello,
    Welcome to our Microsoft Q&A platform!

    Your app launch QRbot, it scans the barcode and gets the response , then you want pass this response to your own app, right? I notice that QRbot uses x-callback-url,if you want pass through parameters, you need set Uri Scheme. I 'm afraid you need to connect QRbot support for more detail docs.

    For more information, you can refer to
    https://social.msdn.microsoft.com/Forums/en-US/4aaeed85-b123-4816-8d05-2260f8e49c25/how-to-open-other-apps-from-xamarin-forms?forum=xamarinforms
    https://learn.microsoft.com/en-us/xamarin/essentials/web-authenticator?WT.mc_id=friends-0000-jamont&tabs=ios

    ------update-----
    This is a thread about share data from other app, you could check it. You could also refer to
    https://learn.microsoft.com/en-us/dotnet/api/android.content.intent?view=xamarin-android-sdk-9

    By the way, I install the QRbot APP to my android device, I don't find detail supported docs about communication between two apps, you could check if the result can be share to your app.

    Best Regards,
    Wenyan Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.