Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on May 10, 2026. It is now read-only.

I found a way to replace the <queries> tag. #145

TCXYao started this conversation in Ideas
Discussion options

I modified the manifest file in NativeShare.aar.
As shown below

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.yasirkula.unity">
	<application>
		<activity android:name=".NativeShareCustomShareDialogActivity" android:theme="@style/Theme.NativeShareTransparent" android:exported="true">
		 <intent-filter>
		 <action android:name="android.intent.action.SEND" />
			<data android:mimeType="*/*" />
		 </intent-filter>
		 <intent-filter>
		 <action android:name="android.intent.action.SEND_MULTIPLE" />
			<data android:mimeType="*/*" />
		 </intent-filter>
		</activity>
		<receiver android:name=".NativeShareBroadcastListener" android:exported="false" />
		<provider
		 android:name="com.yasirkula.unity.NativeShareContentProvider"
		 android:authorities="${applicationId}.NativeShareContentProvider"
		 android:exported="false"
		 android:grantUriPermissions="true" />
	</application>
	<uses-sdk android:targetSdkVersion="4" />
	<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
</manifest>

I replaced the <queries> and <intent> tags with <intent-filter>.
I also added QUERY_ALL_PACKAGES permission.
This works well on Unity 2019439f1.
It met my needs, but I don't know if that would have some bad consequences.

You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

It can have bad consequences because QUERY_ALL_PACKAGES permission requires special permission on Google Play: https://support.google.com/googleplay/android-developer/answer/10158779?hl=en

You must be logged in to vote
2 replies
Comment options

Thanks for your reply.
I have tried update Gradle, but for some reason, it caused apk build fail.
It seems the best way for me is to upgrade Unity to a version that supports the new Gradle version.

Comment options

If the APK build issue can't be resolved, then that seems to be the only option if you wish to continue using NativeShare with queries tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /