0

I tried to open the application with some testing apps which allow me to create the intent. But this was not working and also not with my code. My guess for the root of the problem is the generated manifest file from Unity. There are 2 projects exported, the packagename which is visible for adb etc. is within this manifest.

<?xml version="1.0" encoding="utf-8"?>
<!-- GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.app" xmlns:tools="http://schemas.android.com/tools" android:installLocation="preferExternal">
  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
  <application android:label="@string/app_name" android:icon="@mipmap/app_icon" />
</manifest>

This manifest has no intent-filter and since there is no activity within this project, I'm not sure how I could add one. I think I need an intent filter to make the intent call from outside of my app work. Has anyone solved this before or has an idea how to solve it?

The other manifest looks like this, but has a generic package name which is also not visible from the outside (adb). But this one has an intent-filter. But I'm pretty sure, that I can't access this with an intent.

<?xml version="1.0" encoding="utf-8"?>
<!-- GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" xmlns:tools="http://schemas.android.com/tools">
  <application>
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:theme="@style/UnityThemeSelector" android:screenOrientation="fullSensor" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false">
      <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" />
      <meta-data android:name="android.notch_support" android:value="true" />
    </activity>
    <meta-data android:name="unity.splash-mode" android:value="0" />
    <meta-data android:name="unity.splash-enable" android:value="True" />
    <meta-data android:name="notch.config" android:value="portrait|landscape" />
    <meta-data android:name="unity.build-id" android:value="f5abdf68-b589-4d67-acb2-5c55e15b3fd3" />
  </application>
  <uses-feature android:glEsVersion="0x00030000" />
  <uses-feature android:name="android.hardware.vulkan.version" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
TobiasW
  • 861
  • 3
  • 13
  • 36

2 Answers2

0

If this is the android manifest in the temp->staging area folder and you modify it.. it wont work. because unity creates a new android manifest everytime you build it. Instead create an android manifest file in Plugins->Android folder and create the intent-filter and unity will automatically merge the 2 android manifest.

And make sure you make your modifications to the second intent filter the one with VIEW data. add something like android:scheme(im on mobile and just google it and you will find it) and your intent etc.

  • Thanks for you reply! This is the genereated manifest, I exported the project to check if it's correct. If I understand you correctly, you think I want to submit data? Because I don't want to do that, I just want to start my unity app from another app. – TobiasW Feb 17 '20 at 12:37
  • Yeah i get that... to do that you Just need an application scheme in a new android manifest in the Plugins-> Android folder. You can trigger the app using app:// and the intents will go after that.. See if you can follow this link - https://connect.unity.com/p/deep-linking-on-android-ios-with-unity – UniqueNickname Feb 18 '20 at 12:07
0

Please see an answer here, It took me a while as well but I figured it out: https://stackoverflow.com/a/65092095/1828990

degee147
  • 255
  • 2
  • 5
  • 14