Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

IApplicationStartInfo.intentUri

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public string intentUri;

Description

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 } }