intentUri
Mirrors android:android.app.ApplicationStartInfo getIntent() method, returning the URI string representation of the launch intent via Intent.toUri(0).
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Property
- Namespace: UnityEngine.Android
- Assembly: UnityEngine.AndroidJNIModule
string intentUri { get; }
Remarks
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 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.
AndroidJavaObjectExamples
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 }}