- Home /
The question is answered, right answer was accepted
Share Button
Hi all, my project is augmented reality based(Android Platform). So i need to capture the screenshot and share that screenshot to facebook, twitter, gmail, etc.. How it's possible to achieve this.
Answer by BlackPanda · Dec 29, 2014 at 11:41 AM
You can use the AndroidJavaClass and AndroidJavaObject classes in Unity to create a share feature in your app. Take a look at this article:
http://www.daniel4d.com/blog/sharing-image-unity-android/
It also says about how to take screenshot and share via Android native share dialog.
Answer by HarshadK · Dec 29, 2014 at 10:03 AM
Take a screenshot using Application.CaptureScreenshot and then you can share this image using the APIs of the respective Social Networking Site you want to share to.
Facebook has their own SDK for Unity: Facebook SDK for Unity
@Harshad$$anonymous$$, actually i don't need this separately. for eg: you have a image on your android and need to share that, if you press the share button it pop-up one window which had been shown your all installed file, through that you can share the image where you want. (Sorry for my bad English)
So do you mean you want to show user the default share menu that OS shows? or you want to create your own menu using which user can choose where he wants to share?
I want to show that OS menu which one is default, but am still didn't decide that, but my objective is to share the screenshot in this way. So which one best method to achieve this? or i go with the default OS menu?
Each method has Pros and Cons like default OS menu will allow you to have many options available to share but there might not be options for some of the applications if those are not installed on the device of user. Having your own menu makes sure that all the options that you need are there but you lose the opportunity of having a long list of options available based on which application user has installed. One more thing is that default OS menu reflects the application that user uses and which is actually nice since user gets to decide what he wants to use rather than you telling him where he can share. So if you are looking for a wide range of options then go with default OS menu.
That's nice so, is that possible to create unity itself or something else? can you show me some links where i can learn about this?
Answer by alok-kr-029 · Dec 29, 2014 at 01:29 PM
I have done this using https://www.assetstore.unity3d.com/en/#!/content/10825 try this