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

Android PushNotification Is undefined #267

Open
Kklung011 opened this issue Apr 14, 2024 · 1 comment
Open

Android PushNotification Is undefined #267

Kklung011 opened this issue Apr 14, 2024 · 1 comment
Labels
android Related to the Android platform info-needed Further information is requested

Comments

@Kklung011
Copy link

I have a Cordova project

This is my code:

try{
alert(window.PushNotification)
var push = window.PushNotification.init({
android: {
senderID: this.$appInfo.NotificationSenderID,
},
ios: {
alert: "true",
badge: "true",
sound: "true",
clearBadge: true,
},
windows: {},
});
}catch(e){
alert(e)
}

This code in iOS is working but not working in android
It will alert ‘undefined ’

I try anyway as I can search but didn’t find solution
Can any give any solution can fixed it

@erisu
Copy link

erisu commented Nov 22, 2024

I was unable to reproduce this issue.

Please try uninstalling and reinstalling the plugin to the latest version. Monitor the console output during installation for any errors, and consider using the --verbose flag for more detailed information.

Ensure that you are using the latest version of the Cordova-Android platform. At least 12.0.0 or higher. Older versions will prevent the plugin from installing.

Also confirm that you are waiting for the deviceready event to fire before invoking any of the plugin's APIs.

@erisu erisu added info-needed Further information is requested android Related to the Android platform labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Related to the Android platform info-needed Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants