I'm developing an application using your React Native library. On Android everything is working fine, so I've just received the push information and I handle it using a custom pushHandler.

pushHandler(pushData) {

    var seeArticleFromPush = function(articleId, _this) {
      // open article
    };

    var _this = this;
    if (pushData.userdata) {
      var articleId = pushData.userdata.url;
      if (articleId) {
        if (pushData.foreground) {
          // App is opened
          _this.setState({ notifications: count });
        }
        else {
          // Push notification opened while app is closed
          seeArticleFromPush(articleId, this);
        }
      }
    }
    this.onPushOpen(this.pushHandler);
  }

But on iOS I'm receiving the notifications, but it doesn't execute the content of my pushHandler function (as you can see, I'm managing if the app is opened or not). I'm using the last version (1.2.5)

EDIT

I'm registering Pushwoosh like this on my index.js (both iOS and Android):

componentDidMount() {
  var _this = this;
  Pushwoosh.init(_this.pw_config);
    AppConfig.getAppConfig(function (config) {
      if (config.notifications) {
        Pushwoosh.register(
          (token) => {
            console.log('✓ Registered for pushes');
            Pushwoosh.onPushOpen(_this.pushHandler)
          },
          (error) => {
            console.error('Failed to register: ' + error);
          }
        );
      }
      if (callback)
        callback();
    });
  }
}
asked 23 Nov '16, 13:06
franverona's gravatar image

franverona
214

edited 06 Dec '16, 11:06

Hello!

May I ask you whether you've tried to reproduce the issue using our React Native Sample app:

https://github.com/Pushwoosh/pushwoosh-react-native-sample

Please let me know about the results!

permanent link
answered 06 Dec '16, 07:53
Nikolai's gravatar image

Nikolai
3585

The example is working fine because is just a proof of concept. In this case my app is more complicated than that. I'm going to add more code to ilustrate the problem.

(06 Dec '16, 11:00) franverona franverona's gravatar image
1

Alright, I am going to consult our developers regarding this issue and get back to you as soon as they respond.

Please stay tuned.

(07 Dec '16, 03:54) Nikolai Nikolai's gravatar image
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
×326
×5

question asked: 23 Nov '16, 13:06

question was seen: 732 times

last updated: 07 Dec '16, 03:54