Orientation error in barcode scanner



  • i use the barcode plugin of monaca but on android, when show camera scanner, the orientatation is always landscape and i need portrait orientation

    I use this parameters:

      {
          "orientation" : "portrait" // Android only (portrait|landscape), default unset so it rotates with the device
    }
    

    and in the config.xml this

      <platform name="android">
        <preference name="orientation" value="portrait"/>
      </platform>
    

    But not run, any ideas, thanks



  • @ntc Did you use the Monaca version? If so, it can’t be used with Android 6.0 or higher. They recommend you use this plugin: https://github.com/phonegap/phonegap-plugin-barcodescanner

    It is a very powerful plugin and I have used it successfully. For it, you just use:

    orientation : "portrait"
    

    The big difference between what you posted and it, is you don’t need the double quotes around orientation. If you are using this plugin, then remove the quotes and let us know.


Log in to reply