- Home /
Question by
Marishka22 · Dec 04, 2017 at 11:08 PM ·
androidintent
how to send text from html page to unity android app?
c# Android
Text arguments;
void Awake()
{
arguments = GetComponent<Text>();
AndroidJavaClass UnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject currentActivity = UnityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject intent = currentActivity.Call<AndroidJavaObject>("getIntent");
arguments.text = intent.Call<string>("content");
}
AndroidManifest.xml
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="com.examle.e"
android:scheme="launch" />
</intent-filter>
link on html page
<a href="intent://com.examle.e/#Intent;scheme=launch;package=com.example.e;S.content=WebContent;end">Перейти в приложение</a>
It's work as launch app, but text "WebContent" not displaying on screen... What am I doing wrong?Thanks
Comment