Finding out if a user entered the game from notification (iOS/Android)

Hey, I was wondering how I can tell if a user came into my game through a local/remote push notification (both on Android and on iOS) - I looked around the internet and couldn’t find anything on doing this specifically on Unity.

Thanks!

Are you working on a multiplayer game? if you are using unity multiplayer just use

void OnConnectedToServer()
{
   //Player connected do stuffs
}

or if you are using Photon cloud (photon unity networking)

public void OnPhotonPlayerConnected(PhotonPlayer player)
{
    // Player connected do stuffs here
}

here is good unity networking tutorial

For iOS you can search here : http://docs.unity3d.com/ScriptReference/NotificationServices.html

For Android it seems that Unity doesn’t integrate push notification natively, but you can easily write a plugin (in Java (Android SDK) or C++ (NDK)) for your application that you will call in your Unity Scripts. Here is a guide for writing plugins : Unity - Manual: Create and use plug-ins in Android