Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
109 stars 139 forks source link

Windows notification callback contains NullException #219

Closed TimKolberger closed 7 years ago

TimKolberger commented 7 years ago

Environment: Cordova 4.2 with the latest pushwoosh-phonegap-plugin on the windows platform.

I am receiving the notification from pushwoosh in my listener and the it is visible on the screen with its text, but its payload in my listener is not as expected:

document.addEventListener('push-notification', onNotification);

function onNotification (event) {
    // debug content:
    event.notification = {
        foreground: true,
        onStart: false,
        userdata: [],
        windows: {
            ... 
            content: {
                description: "Invalid pointer\r\n\r\nSystem.ArgumentNullException: Value cannot be null.\r\n   at System.StubHelpers.HStringMarshaler.ConvertToNative(String managed)",
                message: "Invalid pointer\r\n\r\nSystem.ArgumentNullException: Value cannot be null.\r\n   at System.StubHelpers.HStringMarshaler.ConvertToNative(String managed)",
                number: -2147467261,
                stack: "WinRTError: Invalid pointer\r\n\r\nSystem.ArgumentNullException: Value cannot be null.\r\n   at System.StubHelpers.HStringMarshaler.ConvertToNative(String managed)\n   at PushWoosh.prototype.onNotification (ms-appx://***.***/www/js/Pushwoosh.js:229:5)"
            },
            ...
        } 
    };
}
wfhm commented 7 years ago

Hi,

This is quite strange, since it is not an expected payload. Could you please specify how exactly did you send this notification? Was it sent via the dashboard or via API (if so, please provide us with your /createMessage request)?

TimKolberger commented 7 years ago

I sent the notification via the pushwoosh dashboard. I sent a 'standard' Notification, and the Toast Notification. Either of them are not accessible in my notification listener.

TimKolberger commented 7 years ago

any news on this issue?

wfhm commented 7 years ago

Hi,

At the moment pushwoosh-phonegap-plugin does not support push content on Windows platform. As a workaround, to pass any data to your app you can use "data" key in your /createMessage request.

TimKolberger commented 7 years ago

Unfortunately this workaround is not applicable for me. I would have to update the backend services for this to work. Please let me know when the bug is fixed.

takethefake commented 7 years ago

+1

shaders commented 7 years ago

The workaround is available by putting push title and any other necessary fields to the push custom data, which is available on the device.