Hello, is it possible in unity to get launch command line arguments and environment variables into unity when launching mobile app? I have tried Environment.CommandLine, and other Environment functions, but they always return nothing when used for mobile app, both iOS and Android.
I finally managed to solve that issue for both platforms. For iOS it was easy because the Environment.GetEnvironmentVariables () worked perfectly fine, and I just used it in wrong place earlier. For Android I had to use unity javaobject to get intent that launched application and get environment variables from there:
AndroidJavaClass unityPlayer = new
AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject intent = activity.Call<AndroidJavaObject> ("getIntent");
bool hasExtra = intent.Call<bool> ("hasExtra", "eVar_Name");
if (hasExtra)
{
AndroidJavaObject extras = intent.Call<AndroidJavaObject> ("getExtras");
string eVar = extras.Call<string> ("getString", "eVar_Name");
}