I'm facing a really troubling issue with my React Native app and Pushwoosh.

If I close my app completely and send a notification from Pushwoosh control panel, it appears, I tap on it on my phone and my app receive push info.

But if my app is in background (for example, I've already opened it and just press "Home" button on my phone) and I send the notificacion from control panel, it appears, I tap on it BUT my app won't receive any push data.

It seems like onPushHandler function is being unregistered if my app is in background.

Here is my code (I removed a lot of useless code for this purpose):

import React, {
  Component,
} from 'react';
import {
  AppRegistry,
} from 'react-native';

class App extends Component {

  constructor(props) {
    super(props);
    this.state = {};    
    this.pushHandler = this.pushHandler.bind(this);    
  }

  componentDidMount() {
    Pushwoosh.init(/* myconfig */);
    Pushwoosh.register(
      (token) => {
        console.log('✓ Registered for pushes');
      },
      (error) => {
        console.error('Failed to register: ' + error);
      }
    );
    Pushwoosh.onPushOpen(this.pushHandler);
  }

  render() {
    return (
      <View><Text>Test</Text></View>
    );
  }

  pushHandler(pushData) {    
    console.log(pushData);    
    Pushwoosh.onPushOpen(this.pushHandler);    
  }

}

AppRegistry.registerComponent('MyApp', () => App);
asked 18 Aug '16, 10:34
franverona's gravatar image

franverona
214

Hello,

Thank you for drawing our attention to this issue!

This bug has been fixed recently. Please update our React Native plugin to the latest version (1.1.3):

http://docs.pushwoosh.com/docs/react-native-pushwoosh-push-notifications-module-for-android

Please let us know about the results!

permanent link
answered 23 Aug '16, 04:37
Max%20Kuzakov's gravatar image

Max Kuzakov
4165

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:

×446
×76
×21

question asked: 18 Aug '16, 10:34

question was seen: 817 times

last updated: 23 Aug '16, 04:37