I have a cordova based app using the cordova pushwoosh plugin. The app has a corresponding server application which uses the GoMoob PHP library to send notifications to specific devices through the API.

The notifications are sent with custom data in format {"guid": 123456, "external_url": "http://example.com"}

In my app code I register the device to receive notifications, and I have an event listener that does stuff with the guid and external url.

var pushNotification = window.plugins.pushNotification;

      //set push notification callback before we initialize the plugin
      document.addEventListener('push-notification', function(event) {
          //get the notification payload
          var pushNotification = window.plugins.pushNotification;
          var notification = event.notification;

            if (notification.hasOwnProperty('userdata')) {
                var user_guid = 0;
                if (AuthService.currentUser.hasOwnProperty('guid')) {
                    user_guid = AuthService.currentUser.guid;
                }

                var guid = 0;
                if (notification.userdata.hasOwnProperty('guid')) {
                    guid = notification.userdata.guid;
                }

                var pushToken = 0;
                if ($rootScope.hasOwnProperty('deviceToken')) {
                    pushToken = $rootScope.deviceToken.pushToken;
                }
                var params = {
                    guid: guid,
                    user_guid: user_guid,
                    deviceToken: pushToken
                };

                AnalyticsService.recordNotification(params);

                if (notification.userdata.hasOwnProperty('external_link')) {
                    $rootScope.nativeBrowser(notification.userdata.external_link);
                }
            }

          //clear the app badge
          pushNotification.setApplicationIconBadgeNumber(0);
      });

This all works great when the Pushwoosh 'debug' setting is on (for that hour). As soon as 'debug' is turned off the notifications still come through, but the actions in my event listener do not fire. The app code isn't changing, and the notification being sent from PHP to the API is exactly the same, the only variable changing is the status of 'debug' mode.

Anyone have any ideas?

asked 10 Oct '16, 18:31
mbeckett's gravatar image

mbeckett
111

I'm having the same issue.

permanent link
answered 10 Oct '16, 18:33
Paul%20Stewart's gravatar image

Paul Stewart
111

Same problem here since a few days... we updated to latest SDK 6.2.2 but it did not help

permanent link
answered 13 Oct '16, 14:06
Tobsen77's gravatar image

Tobsen77
111

Hello!

Actually, the issue had been fixed for both Native iOS and Cordova plugin.

May I ask you to test it again and see whether the issue still persists?

permanent link
answered 20 Oct '16, 07:08
Nikolai's gravatar image

Nikolai
3585

@Nikolai I am still seeing this issue.

permanent link
answered 31 Oct '16, 14:22
TomF's gravatar image

TomF
113

edited 31 Oct '16, 14:23

@TomF may I ask you what framework do you use, or the app is a native one?

permanent link
answered 02 Nov '16, 10:21
Nikolai's gravatar image

Nikolai
3585

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×353
×190
×83

question asked: 10 Oct '16, 18:31

question was seen: 935 times

last updated: 02 Nov '16, 10:21