I'm using React Native library with Pushwoosh. I wrote a function to handle my push notifications, which includes some conditions and view changes according to push content info.

But now I'm facing a very annoying issue. If my app is being used, and I send a push, I receive it (all ok) and my push handler function logic will being executed; so my users experience that "view changes" if any push notification arrive when they're using the app.

I'm wondering if is there any way to know if my push notification was opened while my app is open. If exists, I can create a piece of code to show my notifications in a popup (instead of an instant view change) or store it somewhere to see it later.

asked 26 Aug '16, 08:49
franverona's gravatar image

franverona
214

Object received by push handler function has a property called foreground.

If foreground is true -> app is opened.

If foreground is false -> app is closed.

permanent link
answered 26 Aug '16, 08:58
franverona's gravatar image

franverona
214

edited 26 Aug '16, 08:58

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:

×447
×446
×6

question asked: 26 Aug '16, 08:49

question was seen: 777 times

last updated: 26 Aug '16, 08:58