How to open a specific window after clicking on a push notification on Android

0 votes
Hello, Is there anyway to detect when app is opened after clicking on a push notification ? Thank you in advance.
asked Jan 29, 2016 in Unity by catwalk5av (16 points)

1 Answer

0 votes

Hi CatWalk,

Yes, There is a way to open a specific scene based on the message received in Push Notification, after clicking the Notification icon.

So wheneever you main App scene is open after clicking the Notification,

You can validate the message get from following code and switch to respetive scene accordingly the message.

message=App42Push.getLastPushMessage();
 
Let me know if it helps.
 
Thanks
Vishnu Garg
 
answered Jan 29, 2016 by Vishnu Garg (674 points)
Hi Vishnu,

I think it's a little more complex than that.

I have to detect when the app is opened after clicking on the app-icon or after clicking on the push notification.

I think I have to launch a custom activity that extends UnityPlayerActivity, but I'm not sure and it seems to be complicated.

Thank in advance.
Yes, you can define custom Activity on Android native side and show some popup on that when its opened, But again and you can write a native code to switch from that Activity to your launcher Activity.
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
...