Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
109 stars 139 forks source link

'Invalid action' when calling getLaunchNotification() #251

Closed spacepotato closed 7 years ago

spacepotato commented 7 years ago

Currently using plugin version 6.5.1 with a Cordova 6.5 application.

The code I am running is:

var pushNotification = cordova.require('pushwoosh-cordova-plugin.PushNotification'); pushNotification.getLaunchNotification(function(notification){ console.log(notification) })

The value being logged is currently "Invalid action". I've tried wrapping the call in a timeout but the issue still persists. Push notification registration is happening successfully.

Let me know if I can provide any further info!

spacepotato commented 7 years ago

If anyone comes across this in the future, the solution was to make sure that pushNotification.registerDevice is being called on startup.