nativescript-vue: Android application events are not fired
Version
1.3.2-rc.3
Reproduction link
https://github.com/msaelices/nativescript-vue-android-event-issue
Platform and OS info
Android 7.0 / NativeScript 3.4.1 / Ubuntu Xenial
Steps to reproduce
-
vue init nativescript-vue/vue-cli-template myproject
-
Select default options: no vue-router, no vuex
-
Add this code to the
src/main.js
file:
# after import HelloWorld from './components/HelloWorld';
const application = require('tns-core-modules/application')
application.android.on(application.AndroidApplication.activityStartedEvent, args => {
console.log('activityStarted event called')
})
What is expected?
See the activityStarted event called
message.
What is actually happening?
The console.log
sentence is not reached. Even if you change the console.log
to a throw Error('Foo')
the error is not raised so that function is never reached.
The issue is only happening with the vue-cli-template
, which uses webpack for building the bundle. There are no issues with the nativescript-vue-template
.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (7 by maintainers)
Use the new template, upgrade guide: https://nativescript-vue.org/en/docs/getting-started/upgrade-guide/
@bundyo use the
next
branch https://github.com/nativescript-vue/vue-cli-template/tree/next and those issues won’t be there 😃