[Barcode Plugin] In which cases is this plug-in working?

[Barcode Plugin] In which cases is this plug-in working?

  
Forge Component
(2)
Published on 24 Nov (2 weeks ago) by OutSystems
2 votes
Published on 24 Nov (2 weeks ago) by OutSystems

Hi,

We tried to get this plugin working on the P10 platform with native apps in both IOS and Android, but this function always returns false.

What is needed to get this plug-in working?

Hi Remco,

I don't have enough information to help you troubleshoot. Off the top of my head I would guess your native build isn't including the plugin code, and therefore the call always fails. Some blind troubleshooting steps you could take are to republish the plugin application, remove the reference to the plugin in your own application and then add it again and then republish your application.

I would also suggest you take a look at the Field Services sample app we published on the Forge, for the new runtime. This application uses the barcode plugin and you can use it as a code reference and as a litmus test to check the health of the plugin.

Let us know what you find, or any additional info.

Cheers,

Daniel

Hi Daniel,

I've tried all things you suggested.

  1. Remove/add references.
  2. Delete/add the plugin.
  3. Check how the Field Services Mobile app is using the barcode scanner.

But unfortunately nothing worked. We got the "Barcode plugin not available" in the Field Services app.

We have created an app that scans QR codes (currently we have something working with the camera app and the ZXing QR code decoder), but we would like to scan and decode in one action to speed up the scanning process. The app should run native (without Outsystems Now) in both iOS and Android.

What I added is exactly the same as in the Field Services app (FieldServices > MainFlow > Install > OpenModal), but I feel like I'm missing something related to a javascript Init or configuration setting somewhere that enables the plugin on mobiles?

Could you point out where to look further?

Kind regards,

Remco Dekkinga

Solution

Hey, Remco,

It indeed looks like something is stopping the plugins from being included in the Native Build. Could I ask you to do one more attempt at solving this?

Please try to:

  1. Make a trivial non-functional change on the plugin's code (like this, for example)
  2. Now refresh the app, by opening the module, go to add/remove references, click "Refresh All" (if enabled), then "OK"
  3. Now, generate a new native build for the application (Field Services or otherwise) and be sure to install it on your device afterwards

This will ensure that the platform generates necessary meta-data for the build to include the plugin (it should be fixed for the final version), so when you request the build it will include the plugin in the request. 

Please let me know if things were solved through this method.

Best regards,

Carlos Simões

Solution

Hi Carlos,

After changing the plugin's code nothing changed, but then I changed to git plugin json code to use a fork of the tjwoon zbar cordova plugin and deleting and adding the app to my phone, it worked.

Then I changed to plugin code back to the one from tjwoon and again deleted and added the app on my phone and the plugin was still working.

Your suggestion with changing the plugin code did the trick, because I already had uninstalled and installed the app several times on my phone without the result I was hoping for.

I marked your reply as the solution, but it does need the extra comment related to deleting and adding the app to the iphone.

Kind regards,

Remco

Will do, Remco! Indeed, I mentioned generating the build but was not clear that the device's app needed replacing, or else the same thing would happen.

Glad you solved it and thank you for sharing your solution. Be sure to let us know if you need a hand with anything else!

Best regards,

Carlos Simões

Btw, for anyone who is still having the same problem, the fix for Beta 2 installations is installing the newest version from the Forge, for the following plugins:

  • Camera;
  • Barcode;
  • Location;
  • Contact;
  • Shake.

If you have a native app that isn't including any of these plugins, try to install their latest version and generate a new one.

Best regards,

Carlos Simões