Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Resolved Deep linking in Unity 2022, the app is restarted

Discussion in 'Android' started by hippogames, Jun 11, 2023.

  1. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    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:
    upload_2023-6-11_13-34-38.png
     
    EmeralLotus likes this.
  2. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    I've created a bug as well, IN-43584
     
  3. Farl_Lee

    Farl_Lee

    Joined:
    Mar 20, 2014
    Posts:
    4
    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 <meta-data> in <activity></activity>
    <meta-data android:name="unityplayer.UnityActivity" android:value="true" />

    Add this line after your first <indent-filter>.

    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.)
     
  4. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    Hi, thanks for this info! Does the new manifest work in Unity 2021?
     
  5. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    Farl_Lee likes this.
  6. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,457
    Amazing Solution: Thank you Farl_Lee
    This works for me:
    Code (CSharp):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
    3.   <application>
    4.     <activity android:name="com.unity3d.player.UnityPlayerActivity" android:exported="true" android:theme="[USER=863766]@StyLe[/USER]/UnityThemeSelector" >
    5.       <intent-filter>
    6.         <action android:name="android.intent.action.MAIN" />
    7.         <category android:name="android.intent.category.LAUNCHER" />
    8.       </intent-filter>
    9.             <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    10.       <intent-filter>
    11.         <action android:name="android.intent.action.VIEW" />
    12.         <category android:name="android.intent.category.DEFAULT" />
    13.         <category android:name="android.intent.category.BROWSABLE" />
    14.         <data android:scheme="google.auth" />
    15.       </intent-filter>
    16.     </activity>
    17.   </application>
    18. </manifest>
     
  7. manugil

    manugil

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    41
    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 <meta-data> 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
     
    Last edited: Jul 26, 2023
    hippogames and pixelsprite_unity like this.