Mirrors android:android.app.ApplicationStartInfo getIntent() method, returning the URI string representation of the launch intent via Intent.toUri(0).
For more information, refer to Android's documentation on getIntent().
Returns null if there was no intent associated with this start.
This property returns the intent as a URI string rather than an AndroidJavaObject to avoid keeping a native JNI handle alive beyond the lifetime of the ApplicationStartInfoProvider.GetHistoricalProcessStartReasons call. To reconstruct the original Android Intent from this URI, use Intent.parseUri.
using UnityEngine; using UnityEngine.Android;
public class ApplicationStartInfoExample : MonoBehaviour { void PrintLaunchAction(IApplicationStartInfo info) { if (info.intentUri == null) return; #if UNITY_ANDROID using var intentClass = new AndroidJavaClass("android.content.Intent"); using var intent = intentClass.CallStatic<AndroidJavaObject>("parseUri", info.intentUri, 0); string action = intent.Call<string>("getAction"); Debug.Log($"Launch action: {action}"); #endif } }