const_missing in barcode

Hello,

tried in the controller.rb a function:

def scan_using_default_scanner

              Rho::Barcode.take({}, url_for(:action => :scan_received))

end

but i got a error message const_missing

should i declare the barcode object seperatly  and then declare it ?

Ruben Ruben
Hi,Did you enable barcode

Hi,

Did you enable barcode extension in build.yml?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
hello,yes here my build

hello,

yes here my build.yml

sdkversion: "4.0.0"

name: "RHO_APP_EL"

version: "1.0"

vendor: "rhomobile"

build: "debug"

bbver: "6.0"

applog: "rholog.txt"

iphone:

  configuration: "Release"

  sdk: "iphonesimulator6.0"

  provisionprofile:

  codesignidentity:

  entitlements:

  BundleIdentifier: "com.rhomobile.rhoappel"

  BundleURLScheme: "rhoappel"

wp:

  productid: "b66ee760-75f8-0131-98b4-00ff9cb67615"

symbian:

  uid: "0xeacbcd2b"

android:

  version: "2.3.3"

  capabilities:

    - hardware_acceleration

    - hardware_acceleration

extensions:

  - rhoconnect-client

app_type: "rhoelements"

capabilities:

  - push

  - hardware_acceleration

  - hardware_acceleration

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ruben Ruben
Please, follow the

Please, follow the instructions here, under section "Enabling the API": http://docs.rhomobile.com/en/4.0.0/api/barcode#menable

You are missing the "barcode" extension under your extensions in build.yml.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
Hello Ruben,if i set in build

Hello Ruben,

if i set in build.yml the properties

app_type: "rhoelements" that include also barcode


i change the code with

Barcode.enable({}, url_for(:action => :scan_received))

but i got the same error message

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ruben Ruben
You are right, it says app

You are right, it says app_type: "rhoelements" should be enough. Did you define method scan_received?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
yes def scan_received     #

yes

def scan_received

     # Did we actually find a barcode ?

     # If status is not 'ok', the scan was cancelled

    #Rho::Log.info(@params["data"],"Barcode result")

    Barcode.disable()

  end

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ruben Ruben
Try using Rho:: on both:Rho:

Try using Rho:: on both:

Rho::Barcode.take({}, url_for(:action => :scan_received))

def scan_using_default_scanner

              Rho::Barcode.take({}, url_for(:action => :scan_received))

end

def scan_received

     # Did we actually find a barcode ?

     # If status is not 'ok', the scan was cancelled

    #Rho::Log.info(@params["data"],"Barcode result")

    Rho::Barcode.disable()

end

If this still doesn't work, i'd try to manuall add the extension to the build.yml

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
Hello Ruben,thx it works have

Hello Ruben,

thx it works have a nice day

regards

Uwe

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Mark Nongkhlaw
What made it work, Rho:: or

What made it work, Rho:: or adding the extension in build.yml ?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
Hello Mark,adding and you

Hello Mark,

adding and you must it test on a hardware device not on a simulator .

Additonal you must if you create a project add also RHoelement to your project

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Michael Toews
,     Just to be clear, are

,

     Just to be clear, are you saying that in addition to setting `app_type: "rhoelements"` you also had to add `capabilities: "barcode"` to you build.yml in order for Barcode to work?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
Hello Michael,normaly if you

Hello Michael,

normaly if you create a project mobile Application with the barcode you must enable rhoelements in the Assistent

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Michael Toews
Uwe,     Yes, I know this,

Uwe,

     Yes, I know this, that was not my question. My question is about your particular problem and what you did to fix it. Can you say explicitly what you did to get it resolved? Did you add the extension 'barcode' into your build.yml or no?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
Yes add the entry barcode see

Yes add the entry barcode see below:

extensions:

  - rhoconnect-client

  - barcode

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
of the build.yml

of the build.yml

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Michael Toews
Uwe,     Thank you very much.

Uwe,

     Thank you very much. And if you clear the barcode extension out of the extensions section, it ceases to work?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments