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

PDF file not attached #81

Closed AliAkbarMontazeri closed 4 years ago

AliAkbarMontazeri commented 4 years ago

The file is not attached. Only shows text from SetText() function. I'm just using a line of code from the examples here.

public void ShareIt() { new NativeShare().AddFile(Application.streamingAssetsPath + "/" + fileName).SetSubject("Subject goes here").SetText("Hello world!").Share(); } When I'm building the app I got an error that says it collide with another value. So I added tools:replace in the AndroidManifest and it works. Does adding tools:replace makes the file not attached?

yasirkula commented 4 years ago

On Android, you need to use WWW in a coroutine to extract files from StreamingAssetsPath. Example code: https://forum.unity.com/threads/native-share-for-android-ios-open-source.519865/page-3#post-3917233

AliAkbarMontazeri commented 4 years ago

Wow thanks @yasirkula ! It works! I think you should put that on wiki section