Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Assets/AirConsole/scripts/Runtime/AirConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Collections.ObjectModel;
using System;
using System.Diagnostics;
using System.Threading;
using NDream.AirConsole.Android.Plugin;
using WebSocketSharp.Server;
using Newtonsoft.Json.Linq;
Expand Down Expand Up @@ -2115,6 +2114,8 @@ private void CreateAndroidWebview(string connectionUrl) {
url += $"&bundle-version={GetAndroidBundleVersionCode()}";
}

androidGameVersion = AndroidIntentUtils.GetIntentExtraString("game_version", androidGameVersion);

url += "&game-id=" + Application.identifier;
url += "&game-version=" + androidGameVersion;
url += "&unity-version=" + Application.unityVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static string GetIntentExtraString(string key, string defaultValue) {
using (AndroidJavaClass unityPlayer = new("com.unity3d.player.UnityPlayer")) {
AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject intent = currentActivity.Call<AndroidJavaObject>("getIntent");
return intent.Call<string>("getStringExtra", key);
return intent.Call<string>("getStringExtra", key) ?? defaultValue;
}
} catch (System.Exception e) {
AirConsoleLogger.LogWarning(() => "Error getting intent extra: " + e);
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This includes security related updates like requiring fixed Unity versions and i

- **Unity API:** `OnMaximumVolumeChanged` event to notify when the games maximum volume must be changed.
- **Android:** After the last device disconnects, the webview is reset along the game state.
- **Android:** Add support to override the game version used in a previously built android game through intent extras with adb.

### Removed

Expand Down