Hi all! I am pleased to announce an API we decided to make public, open, free: NatShare. With NatShare, you can share images and videos, save to the camera roll, and retrieve a thumbnail for a video. NatShare has been made an independent project from NatCorder , our video recording API for Unity Engine.
NatShare Features Include:
Share images (Texture2D) using the native sharing UI
Share videos (using the video path) using the native sharing UI
Save images (Texture2D) to the camera roll
Save videos (using the video path) to the camera roll
Get a thumbnail for a video (using the video path)
The API is free and is hosted on the Asset Store and GitHub. Please feel free to open issues for bugs and feature requests:
Hi. Coming back to my question about custom actions, the idea is to allow the player to choose what to do with a video. They can share on a social network, but might, on the other hand, to place it on the in game chat. We could make to share buttons in the game, but it feels much cleaner if we have a single share button, that shows the Native Share Sheet, but it includes, not only the supported share targets for that media type, but also some in game action, like for example share share in clan chat, or send to in game friendās inbox.
This use case is pretty specific to your application from the looks of it. This level of modification would have to be done by developers (you). You can fork the NatShare project and begin to modify it.
Does this api allow for posting to social media, such as Facebook, Twitter, Instagram? I think those are the main ones my boss wants. Weād like to be able to share images (taken with a different api) and video taken from NatCorder.
It seems there are some pretty common device-native solutions for this that I wouldnāt know where to begin to access. I presume they are device native because a lot of the Android apps and games seem to do these things in the exact same way.
Thanks! I got that implemented so far (was easy - or at least it seemed easyā¦ Iām building the first test now.)
Is there a way to be able to write the text of the post? I know a lot of games post messages to Facebook with things like coin requests or whatnot. Weād like to use it to be able to add event hashtags for our Augmented Reality campaigns.
Using natshare, Iām trying to get the thumbnail for the recorded video. Works perfect on Android, but iOS I get a weird result with the image becoming warped.
I updated the NatCorder assets in my project and added the NatShare assets as well.
I am getting this error: āā¦/NatShare-API-1.0/WebGL/NatShare.js(6,6): UCE0001: ā;ā expected. Insert a semicolon at the end.ā
This semicolon error appears for all 9 lines with āconstā. Is there something I need to do for these imported assets to make this not appear as an error?
Can you share a screenshot of the error? You arenāt supposed to be receiving any error with the raw Javascript file (it shouldnāt be compiled by anything). What version of Unity are you using? Did you move files around after importing?
I am using Unity 2017.3.1.
I imported the files into a specific sub-folder, but didnāt move anything after it had been added to the project.
Also, I reimported it and this error shows up in addition: āYou are trying to import an asset which contains a global game manager. This is not allowed.ā
It seems that you downloaded the entire GitHub project. You should download the unitypackage instead. When you import it, do not move it into a sub-folder as it may break Unityās plugin import schemes.