How can i check if app is opened using push notification in unity ?

0 votes
if app is opened using push notification in unity , then i need to fire event. Is there any way to do this thing.

I mean i need to check wheather  the app is opened through notification or not. I need some flag that gives me the app is opened using push notification tapping

Thanks
asked Apr 7, 2016 in Android by jns7309 (10 points)
edited Apr 7, 2016 by jns7309

1 Answer

0 votes

Hi JNS,

You need to modify plugin source for that handles such kind of thing and also change in Unity side as well.

You can try the alternative in which you can make validation on last message if its similar to the previous one then its is not opened using Notification else it can be.

we have provided the specific function getLastMessage on which you can apply your logic.

Let me know if it helps.

 

Thanks

Vishnu Garg

answered Apr 7, 2016 by Vishnu Garg (674 points)
Currently we haven't have any demo for your requirement, But you can modify the same based on your logic.
Thanks for answer

 But if i want to open specific screen when we tap on notification, how can i create activity in unity ?
Please let me know  for this.

thanks
Generally Unity have only one Activity name as UnitPlayerActivity, It actually loads the first Screen of Unity while tapping the Notification, where you can write logic of Screen or scene switching based on the last message you will get.
yes right ,
I will get always last message, and i dont want open screen every time. As I am getting lastMessage every time, and this  thing is not right.

thanks for answer.
So Again on Unity side you need to save a variable that validate the status of screen open against that message
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...