Navigation

    Monaca & Onsen UI
    • Login
    • Search
    • Tags
    • Users
    • Blog
    • Playground
    1. Home
    2. Roger
    3. Posts
    R
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by Roger

    • RE: How to properly pair Vue.js (v1 or v2) with Onsen today?

      @munsterlander Thanks though, but I’m already working around this. For now I’m using the splitter but all pages will have to be toggled by Vue (using v-if clauses and such, which surprisingly work with Onsen components!). I will keep the app as far away from the Onsen framework as possible while using its components. That will limit some of the cool functions, but I will be able to have a much leaner code. I despise Angular and React, we wouldn’t be having this conversation if I didn’t.

      Suffice to say I need to create a semi-autonomous app for orders with barcode scanning and lots of price calculation and product variations. I’ll want components and vuex and local storage running smoothly, I’ll have to work around certain limitations already solved by onsen, but I guess I’ll have to live with that.

      Thanks again!

      posted in Onsen UI
      R
      Roger
    • RE: How to properly pair Vue.js (v1 or v2) with Onsen today?

      @munsterlander that’s what I’m doing now. But if you switch the page, using tabs or splitter, all Vue is lost.

      What would involve “getting more dynamic”? I don’t mind getting my hands dirty, but I would appreciate some guidance.

      Thanks!

      posted in Onsen UI
      R
      Roger
    • How to properly pair Vue.js (v1 or v2) with Onsen today?

      So I’ve read somewhere in this board a quick way to start off using Vue was by using the old <script> tags. Starting the vue app inside the ons.ready() call seems to do the trick.

      But, upon page switch the DOM is rebuilt and the ready callback is not called again, effectively killing vue. This is probably normal, given the DOM magic is happening behind the scenes where Onsen and Vue don’t respect each other out of the box. Also, there’s probably some problem with the scope of the vue app object I should look into.

      I haven’t really messed around too much, to be honest; I was hoping someone had some experience to share or a documentation I could check out. I’ve seen there’s a vue-onsenui nodejs module, but it’s not yet available on Monaca and uploading all dependencies it uses is impossible (I can’t really build and debug locally). There’s also the blog post from october promising a core integration with Vue2, which I guess is still under development.

      I would very much like to use Vue now. I’m ok with using Vue v1 in the meantime. But I can’t find a way to reliably use it without losing the power from Onsen or the debugging tools from Monaca.

      Can someone point me how to integrate Vue on an Onsen project right now?

      Thanks in advance for the help.

      posted in Onsen UI
      R
      Roger
    • RE: Serious problems with Barcode Scanner

      @munsterlander
      So… on a fresh app I got the BarcodeScanner plugin working on iOS 9 and Android 4.4. The app is working and we’re ready for testing! Monaca has been a breeze, once I got the gist of it.

      But, sadly, Android 6 is nagging about permissions for the camera as I fire the scanner.

      I have run through the usual suspects:

      • https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/139
        Here they suggested forcing SDK22 in AndroidManifest (which I did), however, since Monaca doesn’t use that anymore this hasn’t helped. Tweaking config.xml using <config-file> crashed the debugger. Maybe there was something wrong, but whatever.
      • I’ve tried https://github.com/dpa99c/cordova-diagnostic-plugin#requestcameraauthorization, but that did nothing as it didn’t even load. Note that I uploaded and built it using Monaca’s cloud, to have the plugin enabled and included. However the debugger warns that it’s not. Weird. At this point, local build fails, too.

      I’m not really sure about what I’m doing wrong nor what I should be doing. We’re using the free plan for now, mind you.

      debugerr created this issue in phonegap/phonegap-plugin-barcodescanner

      closed Problem with Android 6.0.1 #139

      posted in Monaca Tools
      R
      Roger
    • RE: Serious problems with Barcode Scanner

      @munsterlander

      So you only need to build once? Ok, now that’s a game-changer. It didn’t make much sense any other way, but used to just throw the folder into Cordova or PhoneGap it seemed a bit cumbersome, tbh. But I can deal with building once and coding later.

      As for Vue… Yeah, you’re probably right. I’m too excited, but Vue 2 is on RC, and I want to make it work with Onsen2 Beta… Who am I kidding, I am a daydreamer. And a newbie, who barely knows what he’s doing. I’ll probably stick with React for a while until the dust settles.

      Thanks for the insights, much appreciated!

      FWIW they should employ you for tier 1 support. Just saying… :wink:

      posted in Monaca Tools
      R
      Roger
    • RE: Serious problems with Barcode Scanner

      @munsterlander And I really enjoyed the Monaca debug app, it’s really useful compared to Phonegap’s. But it didn’t seem to work with that plugin (well, it kind of did, but not really after all).

      Where should I be declaring the Vue app for it to work with Onsen? Maybe Onsen hasn’t completely initialised yet, and that’s what is messing with Vue.

      I can’t make much sense from this anyway:
      https://onsen.io/blog/preview-vue-support-onsen-ui/

      posted in Monaca Tools
      R
      Roger
    • RE: Serious problems with Barcode Scanner

      Thanks @munsterlander, but that won’t work for me. These are my first steps with Cordova and I like the simplicity the debuggers give me in terms of real time refresh and so on. So building the app every step of the way simply won’t do it. For now, at least.

      Actually I’ve got it working just by recreating the project with Cordova CLI, loading Onsen manually (I’m also not versed in node and npm as much either tbh) and firing it up on PhoneGap. And it worked, just like that! Something in Monaca must be different than Cordova that I’m obviously not aware of.

      –

      Ok, now my setup is fine, both iOS and Android are styling beautifully. But now I would love to integrate Vue into the equation. I’ve threaded a lot this summer with v2, so for this little app I’m building it would be a great asset, and I know it would combine brilliantly for future works. I could go with React, but I’m really loving where Vue is going this new version and I’d love to see it managing Onsen’s components.

      Now I’ve seen there’s already a module that connects both, but then again all docs are refering to Monaca. And I don’t really know how much of that can or should be applied to a vanilla Cordova setup without messing with the app’s libraries and filesystem.

      I’ve put the Vue app into the onDeviceReady event and it fires up, but it can’t seem to agree with Onsen’s DOM. Do you know of any documentation more Cordova based that could get the job done? I don’t mind getting my hands dirty, but Monaca is sadly not going to work for me right now.

      Edit: Thanks a lot for your time, by the way. I really appreciate what you do for the newbs like me.

      posted in Monaca Tools
      R
      Roger
    • RE: Serious problems with Barcode Scanner

      I’ve tried that to as per the official github doc for the plugin. But it doesn’t seem to work.

      On the desktop it does repeatedly say that the cordova object i not defined, so I’m guessing it’s maybe an error on my side while configuring. Cordova CLI gives no apparent error, except it complains about the cordova-ios and cordova-android versions.

       Using this version of Cordova with older version of cordova-android is being deprecated. Consider upgrading to cordova-android@5.0.0 or newer.
       Using this version of Cordova with older version of cordova-ios is being deprecated. Consider upgrading to cordova-ios@4.0.0 or newer.
      Error: The provided path "/XXX/XXX/XXX/XXX/app/platforms/ios" is not a Cordova iOS project.
      
      

      I created this app using monaca CLI, so I guess it’s including older cordova versions or something. However, adroid sdk and xcode are fresh downloads, so that shouldn’t be the issue here.

      posted in Monaca Tools
      R
      Roger
    • Serious problems with Barcode Scanner

      I’m using this code snippet from Monaca’s docs:

      function scanBarcode() {
                  window.plugins.barcodeScanner.scan( function(result) {
                          alert("We got a barcode\n" +
                                    "Result: " + result.text + "\n" +
                                    "Format: " + result.format + "\n" +
                                    "Cancelled: " + result.cancelled);
                      }, function(error) {
                          alert("Scanning failed: " + error);
                      }
                  );
      
              }
      

      On iOS 9.3 it correctly accesses the camera, and the overlay is the usual in Cordova Barcode plugin, currently on 6.0.1. However the callbacks do not work, and on top of that the cancel button crashes Monaca App on iOS. I have tried with both the Cordova and the Monaca plugin activated separately in plugin settings, to no avail. Remotely and locally.

      I’m pretty new to Cordova, but I’m already impressed with Onsen though and jumped right into Monaca for it. I would love to be able to fix this so I don’t have to revert to more basic setups using PhoneGap or bare Cordova, because I’m really enjoying the ecosystem so far and will consider getting a paid subscription if works out fine.

      posted in Monaca Tools
      R
      Roger