[Barcode Scanner Plugin] Barcode Scanner Repo Updated

[Barcode Scanner Plugin] Barcode Scanner Repo Updated

  
Forge Component
(5)
Published on 14 Nov by leonardo.fernandes
5 votes
Published on 14 Nov by leonardo.fernandes

Hey guys,

It looks like this barcode scanner plugin repo was updated on Oct 25th which no longer works on Cordova 6.1.2, currently employed by OutSystems.

I was able to get the plugin to continue working by tagging a specific version (version 6.0.5 was the version that worked well on both Android & iOS; save for the result.cancelled variable in function Scan was being returned as a Number in iOS.

So I commented it out:

So far, everything has gone well since then.



Just a "heads up."


Thanks.

Daniel Brooks wrote:

Hey guys,

It looks like this barcode scanner plugin repo was updated on Oct 25th which no longer works on Cordova 6.1.2, currently employed by OutSystems.

I was able to get the plugin to continue working by tagging a specific version (version 6.0.5 was the version that worked well on both Android & iOS; save for the result.cancelled variable in function Scan was being returned as a Number in iOS.

So I commented it out:

So far, everything has gone well since then.



Just a "heads up."


Thanks.

The error caused by the result.cancelled is this:

Cannot assign a JavaScript number with value 0 to an output parameter of type Boolean Check the JavaScript node 'Scan' of the action 'ScanBarcode'.

I fixed it by setting it to:


$parameters.cancelled = typeof(result.cancelled) === "number" ? !!result.cancelled : result.cancelled;

I have only seen this in version 6.0.5, though.

Thanks.

I have uploaded a new version with those fixes included. Thank you!

Hi guys,

First of all, good job on creating this plugin!

Could you please add to the plugin's description the types of barcode it supports, something like:

The following barcode types are currently supported:

Android

  • QR_CODE
  • DATA_MATRIX
  • UPC_E
  • UPC_A
  • EAN_8
  • EAN_13
  • CODE_128
  • CODE_39
  • CODE_93
  • CODABAR
  • ITF
  • RSS14
  • RSS_EXPANDED

Not by default, but supported if you pass in the "formats" option:

  • PDF_417
  • AZTEC

iOS

  • QR_CODE
  • DATA_MATRIX
  • UPC_E
  • UPC_A
  • EAN_8
  • EAN_13
  • CODE_128
  • CODE_39
  • ITF

This is helpful for someone that is looking for a solution for a specific barcode type.

Thank you in advance.


Cheers, João


Hello João. Could you please create another discussion with that request, as this isn't related to the original subject of this discussion?

Hi Guys,

This component appears to either still be broken or has broken again after a Service Studio upgrade.  I have been using this component successfully for a while but after downloading this component to a new environment under Service Studio 10.0.823.0, it fails to compile to an APK file, returning the message below:

It seems to work fine under OutSystemsNow just not as a native APK.

Any ideas on how to get this to compile?  It works much better than the built-in Outsystems BarcodePlugin so I'd really prefer to use it.

Lester Hanger wrote:

Hi Guys,

This component appears to either still be broken or has broken again after a Service Studio upgrade.  I have been using this component successfully for a while but after downloading this component to a new environment under Service Studio 10.0.823.0, it fails to compile to an APK file, returning the message below:

It seems to work fine under OutSystemsNow just not as a native APK.

Any ideas on how to get this to compile?  It works much better than the built-in Outsystems BarcodePlugin so I'd really prefer to use it.

Hi all,

I am using Service Studio 10.0.801.0 and also experience the same error for Android.

When generating for iOS it also returns an error message: 


Error Detail
Id:
afc24f59-4b21-4950-acfe-96e6e587ccb3
Time of Log:
18-07-2018 11:00:18
eSpace:
Tenant:
ServiceCenter
User:

Session Id:
No session
Server:
E2ANI-NP344A
Module:

Message:
InvalidRequest: Invalid application package.
Environment InformationeSpaceVer: 0 (Id=1, PubId=1, CompiledWith=10.0.710.0)
RequestUrl: http://127.0.0.1/ServiceCenter/_TimerHandler.asmx (Method: POST)
AppDomain: /LM/W3SVC/1/ROOT/ServiceCenter-6-131618929239694214
FilePath: d:\OutSystems\Platform Server\running\ServiceCenter.687509456\
ClientIp: 127.0.0.1
Locale: en-US
DateFormat: dd-MM-yyyy
PID: 4544 ('w3wp', Started='1/31/2018 5:00:58 PM', Priv=586Mb, Virt=9929Mb)
TID: 72
Thread Name: 
.NET: 4.0.30319.42000
Stack:
InvalidRequest: Invalid application package.
   at ssServiceCenter.Actions.ActionRequestBuild(HeContext heContext, String inParamAppKey, String inParamPlatform, Int32 inParamRequestedBy, Int64& outParamAppMobileBuildId, Boolean& outParamSuccess)


 


@Lester Hanger and @Toine Tuerlings just to let you know that to overcome this issue I had to change the version the plugin is using. Originally it uses the version #6.0.5, changing it to the latest version (#v8.0.0) or to the version (#7.0.0) fixed the issue.

Cheers,

João

Thanks for the help, Joao! Managed to fix it like this:

Remember to put in the v before the version number...

This is the resolution for this issue.

Thanks for the feedback guys.

I found that v8.0.0 generates the same error (it needs cordova 7.1) but v7.0.0 does at least compile the APK without errors.

However, I don't know what I am doing differently to you guys but I just cannot get the plugin to work.  It fails on CheckPlugin with cordova.plugins being undefined so always returns false.

Using the Outsystems BarcodePlugin works fine but this BarcodeScannerPlugin refuses to find the plugin.

Any suggestions on what could be wrong?

Lester Hanger wrote:

Thanks for the feedback guys.

I found that v8.0.0 generates the same error (it needs cordova 7.1) but v7.0.0 does at least compile the APK without errors.

However, I don't know what I am doing differently to you guys but I just cannot get the plugin to work.  It fails on CheckPlugin with cordova.plugins being undefined so always returns false.

Using the Outsystems BarcodePlugin works fine but this BarcodeScannerPlugin refuses to find the plugin.

Any suggestions on what could be wrong?

Hey Lester Hanger!

Me and João Martins have been stuck with this same issue for the past week... 

We have tried everything we could think of, including upgrading the platform, but we don't have a solution yet. The plugin builds and compiles fine, but just never gets included in the android build. 

It seems to be some Outsystems platform blackbox type bug... 

I will be logging an official support ticket today, so I will let you know if we find the problem!


Hi All,


Sorry for the late response.

OutSystems has upgraded their supported Barcode plugin which seems to work much better now.

We have therefore not continued keeping the plugin up to date.

My suggestion would be to first try the OutSystems Barcode plugin.


Kind Regards,

Jonathan

Jonathan Bryden wrote:

Hi All,


Sorry for the late response.

OutSystems has upgraded their supported Barcode plugin which seems to work much better now.

We have therefore not continued keeping the plugin up to date.

My suggestion would be to first try the OutSystems Barcode plugin.


Kind Regards,

Jonathan


Hey Jonathan!

The reason we are using this specific plugin is because of it's support for the PDF417 barcode format (in my case, used for scanning South African vehicle license disks) , something which is not supported in the Outsystems Barcode plugin...

Chris Vorster wrote:

Lester Hanger wrote:

Thanks for the feedback guys.

I found that v8.0.0 generates the same error (it needs cordova 7.1) but v7.0.0 does at least compile the APK without errors.

However, I don't know what I am doing differently to you guys but I just cannot get the plugin to work.  It fails on CheckPlugin with cordova.plugins being undefined so always returns false.

Using the Outsystems BarcodePlugin works fine but this BarcodeScannerPlugin refuses to find the plugin.

Any suggestions on what could be wrong?

Hey Lester Hanger!

Me and João Martins have been stuck with this same issue for the past week... 

We have tried everything we could think of, including upgrading the platform, but we don't have a solution yet. The plugin builds and compiles fine, but just never gets included in the android build. 

It seems to be some Outsystems platform blackbox type bug... 

I will be logging an official support ticket today, so I will let you know if we find the problem!



Hey Lester!

The problem seems to have sorted itself out... Maybe something to do with a build service upgrade from Outsystems.

Try the plugin again, referencing v8.0.0. It is working perfectly on my side...

Thanks Chris, I appreciate the feedback.

I tried v8.0.0 again and you are right that it now compiles ok but I still can't get the plugin to be seen.  It returns null for cordova.plugins during the CheckPlugin call.

I have meantime reverted to using the supported barcode scanner which seems to be ok but still struggles a bit with focusing (which the other plugin seemed to do much better at).

I am gonna wait until Outsystems upgrades my environments with the latest security upgrade and then try again.  Perhaps there is some update waiting to be installed that I do not yet have?

Cheers,

Lester


Hey Lester!

My Service Studio is running on v 10.0.827.0 and the platform is on v 10.0.828.0.

Don't know if that helps?

But basically, if you can get by with the Outsystems supported plugin, then you should use that one... Should be more stable, and cause fewer headaches!

Good hunting!

My platform is still only on 10.0.823.0 so I'll wait for security upgrade and ask support if it still doesn't work.

After my OutSystems platform was updated to v10.0.828.0, I am happy to report this component once again is running.  I tried setting plugin version to v7.0.0 and v8.0.0 and both appear to compile and run ok.  So back to normal at last.  Thanks all for the help above.