Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue 3: android.startActivity & android.foregroundActivity are undefined #1073

Open
ignacio68 opened this issue Dec 12, 2023 · 4 comments
Open

Comments

@ignacio68
Copy link

I don't know if it's a bug in Vue exclusively but both Application.android.startActivity and and Application.android.foregroundActivity are always undefined.

code:

onMounted(() => {
    console.log(`application.android.startActivity = ${Application.android.startActivity}`);
    console.log(`application.android.foregroundActivity = ${Application.android.foregroundActivity}`);
  });

result:

Captura de pantalla 2023-12-12 a las 19 10 48

@rigor789
Copy link
Member

Try loaded or Application.displayed events - mounted is called before the native app is fully booted so possible that these are still undefined.

@minhnhut
Copy link

@rigor789 I knew the loaded event. But unsure about Application.displayed. Can you point me to a documention or example of how to hook on this event? Thanks heaps

@vallemar
Copy link
Contributor

vallemar commented Jan 2, 2024

@minhnhut https://docs.nativescript.org/core/application#cross-platform-application-events

import { Application, ApplicationEventData } from '@nativescript/core'

Application.on('displayed', (args: ApplicationEventData) => {
  // handle the event
})

@minhnhut
Copy link

minhnhut commented Jan 2, 2024

@vallemar thanks alot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants