[SOLVED] Device.cordova false from within Android app

I am using an app created with the cli (framework7 create --ui). I have

  • vue
  • types: [pwa, cordova]

I can successfully build and run an app in my android device (running build-cordova-android-dev), but in my onPageInit callback, I get
this.$f7.device.android == true but
this.$f7.device.cordova == false

I do not know if this can help, but I do not see any import of cordova.js in my cordova/www/index.html file

What is in your /src/index.html?

Here what I have: pen

I think I found the problem. My index.html is missing this section

<% if (process.env.TARGET === 'cordova') { %>
    <script src="cordova.js"></script>
<% } %>

With this line, cordova is there. In my imagination, webpack was doing all the job…I was too imaginative

1 Like

See here too: [SOLVED] Cordova Plugins with Framework7 + Vue?