yasirkula / UnityNativeShare

A Unity plugin to natively share files (images, videos, documents, etc.) and/or plain text on Android & iOS
MIT License
891 stars 131 forks source link

A suggestion #49

Closed dqh147258 closed 4 years ago

dqh147258 commented 4 years ago

Hi yasirkula,

Thanks for your plugin , it is useful , actually you could do it more perfect I think.

You could add code to the AndroidManifest in your aar like this

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="YOUR_AAR_PACKAGE_NAME" >
    <application>
        <provider
               android:name="com.yasirkula.unity.UnitySSContentProvider"
               android:authorities="${applicationId}.UnitySSContentProvider"
               android:exported="false"
               android:grantUriPermissions="true" />
    </application>
</manifest>

The AndroidManifest would be merge to the main AndroidManifest , and the provider would get a unique authorities followed the applicationId

yasirkula commented 4 years ago

Does this work with the deprecated Internal build system or only the Gradle build system?

dqh147258 commented 4 years ago

Both build systems are supported , you can verify it by apktools.

yasirkula commented 4 years ago

That's interesting. Will definitely check it out. Thanks!

yasirkula commented 4 years ago

I've applied this technique to the latest releases of NativeShare and NativeCamera plugins. Your help is much appreciated!