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

Support to only share via specific apps? #10

Closed Whyser closed 6 years ago

Whyser commented 6 years ago

Hey and thanks for this simple Unity Plugin!

I'm wondering if you're planning to add support to "force" user to use specific app to share through. I don't know how to do it straight off, but with some googling I can probably do it myself, but would be a great addition to this plugin!

Something like: new NativeShare.AddAppPackage("com.facebook.messenger").SetContent("Hello World").Share()

I think this is only supported on Android though.

Anyway, thanks!

yasirkula commented 6 years ago

That sounds interesting. You are right that it won't support iOS but I might still give it a shot.

Whyser commented 6 years ago

Awesome! :D

yasirkula commented 6 years ago

I've added SetTarget function with the latest update, but it supports one app package only. So, you can't use it to e.g. narrow down the applications to Facebook and Twitter. I initially tried to support this functionality but then Twitter just stopped accepting the shared image, no matter what I tried. Feel free to implement it yourself, though, if it is a requirement of your project :)

Whyser commented 6 years ago

Sounds weird! Anyway, thanks a lot! If I need the functionality I will make sure to make a pull request. :)