Deep linking in Unity 2022, the app is restarted

Hello! In Unity 2022 the app is restarted on Android rather than being activated using a deep link.
The same project works as expected when built with Unity 2021.
Here is my manifest just in case:

1 Like

I’ve created a bug as well, IN-43584

Hi @hippogames ,
I got the save problem in Unity 2022.3.f1.
After some experiments between 2021 and 2022 I found a solution for this issue.

First, I recreate a new AndroidManifest.xml from Project settings in 2022 and found something different from 2021.
There is a new in
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
Add this line after your first .

Btw, you can now remove android:exported=“true” from activity.
(I also add this one because build error. However, it is useless if you add the line.)

Hi, thanks for this info! Does the new manifest work in Unity 2021?

I can confirm this workaround works with Unity 2020, 21 and 22. Thanks again for sharing this @Farl_Lee
Maybe it’s not a workaround, but Unity should update their deep linking manual in this case

1 Like

Amazing Solution: Thank you Farl_Lee
This works for me:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
  <application>
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:exported="true" android:theme=" @ /UnityThemeSelector" >
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
            <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
      <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:scheme="google.auth" />
      </intent-filter>
    </activity>
  </application>
</manifest>

After some changes in our Android Manifest generation process we introduced a regression where the manifest was not being patched with the needed attributes.

This is now fixed for 2022.3.7f1, 2023.1.7f1, 2023.2.0b3, 2023.3.0a1. Now, adding the tag
@Farl_Lee suggested as a workaround is not needed as far as the activity name is either com.unity3d.player.UnityPlayerActivity or com.unity3d.player.UnityPlayerGameActivity

Thanks for reporting it!

→ Link to issue tracker

3 Likes