Giter Site home page Giter Site logo

natshare's People

Contributors

olokobayusuf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

natshare's Issues

SaveToCameraRoll

When using 'NatShare.SaveToCameraRoll(Texture2D texture)', there is a significant delay before image is saved to your device on the Android. Saving video to file is fine. Additional plugin that is being used is ARCore. This delay doesn't occur on iOS using ARKit.

Can Payload API on Android be set to API 16+ ?

Hi, the new payload API is very nice.

I'm able to using it on iOS by calling it on a Coroutine after capture a screenshot with no crash.

But when I try to compile it on Android, it says the minimum android API is 18.

The 1.2 version is 16, can the Payload API be changed to compile on android API 16?

cheers from Brazil!

Crash when sharing iOS, missing NSPhotoLibraryAddUsageDescription

Hi, please update PostProcessBuild to include NSPhotoLibraryAddUsageDescription

iOS (13.1.3) crashes when trying to Save Image.

[access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryAddUsageDescription key with a string value explaining to the user how the app uses this data.

Sharing a Texture2D on Android always uses the same thumbnail

It seems like sharing a texture uses the same filename every time. The thumbnail used for a shared image in a text message always uses the same thumbnail from the first share. Either adding an optional file name to the interface or generating unique filenames (such as appending a timestamp) every time a texture is shared would solve this issue. Currently, a workaround requires saving the texture as a file (which requires additional app permissions) then sharing it from there.

Save to album in camera roll

I'm describing the feature for Android; I'm not sure if it can work similarly under iOS.

Currently the pictures saved to camera roll are always found in the camera roll folder "Pictures" because they are saved directly to the ENVIRONMENT.DIRECTORY_PICTURES folder.

It would be great to be able to add the name of a subfolder as a second argument to SaveToCameraRoll().

Being able to name the pictures would also be nice.

Missing symbols on ARMv7

Hello @olokobayusuf ,

I am currently facing an issue with building the NatShare plugin for an iPhone 5c and iPad4 with iOS 10.3 and armv7. The library builds properly for iPhone 5s and iPhone 6s.

When building in XCode the following linking errors occur:

Ld /Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Products/ReleaseForRunning-iphoneos/thor.app/thor normal armv7 cd /Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808 export IPHONEOS_DEPLOYMENT_TARGET=10.0 export PATH="/Applications/Xcode 9.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode 9.2.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode\ 9.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode\ 9.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk -L/Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Products/ReleaseForRunning-iphoneos -L/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808 -L/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries -L/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCorder/Plugins/iOS -L/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCam/Plugins/iOS -L/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatShare/Plugins/iOS -F/Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Products/ReleaseForRunning-iphoneos -filelist /Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/armv7/thor.LinkFileList -Xlinker -map -Xlinker /Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/thor-LinkMap-normal-armv7.txt -miphoneos-version-min=10.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/armv7/thor_lto.o -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -lc++ -weak_framework CoreMotion -weak-lSystem -weak_framework Photos -framework AssetsLibrary -framework MobileCoreServices -framework Security -framework MediaToolbox -liPhone-lib -framework CoreText -framework AudioToolbox -weak_framework AVFoundation -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework CoreMedia -weak_framework CoreMotion -framework CoreVideo -framework Foundation -framework MediaPlayer -framework OpenAL -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -framework UIKit -liconv.2 -lil2cpp -lVuforiaWrapper -lVuforia -lNatCorder -lNatCamRenderPipeline -lNatShare -lNatCam -weak_framework Metal -weak_framework GameController -weak_framework Accelerate -weak_framework CoreImage -weak_framework Photos -Xlinker -dependency_info -Xlinker /Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/Unity-iPhone.build/Objects-normal/armv7/thor_dependency_info.dat -o /Users/henrique/Library/Developer/Xcode/DerivedData/Unity-iPhone-ccjcnoysdzekpcfnxcoyfkyhhbwo/Build/Products/ReleaseForRunning-iphoneos/thor.app/thor ld: warning: ignoring file /Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatShare/Plugins/iOS/libNatShare.a, file was built for archive which is not the architecture being linked (armv7): /Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatShare/Plugins/iOS/libNatShare.a ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCorder/Plugins/iOS/libNatCorder.a(Bridge.o)) was built for newer iOS version (10.2) than being linked (10.0) ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCorder/Plugins/iOS/libNatCorder.a(NatCorder.o)) was built for newer iOS version (10.2) than being linked (10.0) ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCam/Plugins/iOS/libNatCamRenderPipeline.a(GLRenderContext.o)) was built for newer iOS version (10.3) than being linked (10.0) ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCam/Plugins/iOS/libNatCamRenderPipeline.a(GLTransferContext.o)) was built for newer iOS version (10.3) than being linked (10.0) ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCam/Plugins/iOS/libNatCamRenderPipeline.a(MTLTransferContext.o)) was built for newer iOS version (10.3) than being linked (10.0) ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCam/Plugins/iOS/libNatCamRenderPipeline.a(RenderContext.o)) was built for newer iOS version (10.3) than being linked (10.0) ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCam/Plugins/iOS/libNatCamRenderPipeline.a(RenderTrigger.o)) was built for newer iOS version (10.3) than being linked (10.0) ld: warning: object file (/Users/henrique/Projects/unity/938-ah-thor/frontend/AHThor/Builds/938-ah-thor-build-0419-1808/Libraries/NatCam/Plugins/iOS/libNatCamRenderPipeline.a(TransferContext.o)) was built for newer iOS version (10.3) than being linked (10.0) Undefined symbols for architecture armv7: "_NSFreeThumbnail", referenced from: _NatShareBridge_FreeThumbnail_m2682538311 in Bulk_Assembly-CSharp_6.o _NatShareiOS_NatShareU_INatShare_GetThumbnail_m3910153246 in Bulk_Assembly-CSharp_6.o _U3CGetThumbnailU3Ec__Iterator0_MoveNext_m168441619 in Bulk_Assembly-CSharp_6.o "_NSGetThumbnail", referenced from: _NatShareBridge_GetThumbnail_m1365058599 in Bulk_Assembly-CSharp_6.o _NatShareiOS_NatShareU_INatShare_GetThumbnail_m3910153246 in Bulk_Assembly-CSharp_6.o _NatShareWebGL_NatShareU_INatShare_GetThumbnail_m783373813 in Bulk_Assembly-CSharp_6.o "_NSSaveVideoToCameraRoll", referenced from: _NatShareBridge_SaveToCameraRoll_m3813728512 in Bulk_Assembly-CSharp_6.o _NatShareiOS_NatShareU_INatShare_SaveToCameraRoll_m1414728861 in Bulk_Assembly-CSharp_6.o _NatShareWebGL_NatShareU_INatShare_SaveToCameraRoll_m345998860 in Bulk_Assembly-CSharp_6.o "_NSSaveImageToCameraRoll", referenced from: _NatShareBridge_SaveToCameraRoll_m1715948791 in Bulk_Assembly-CSharp_6.o _NatShareiOS_NatShareU_INatShare_SaveToCameraRoll_m293370051 in Bulk_Assembly-CSharp_6.o _NatShareWebGL_NatShareU_INatShare_SaveToCameraRoll_m3521617472 in Bulk_Assembly-CSharp_6.o "_NSShareVideo", referenced from: _NatShareBridge_Share_m740276308 in Bulk_Assembly-CSharp_6.o _NatShareiOS_NatShareU_INatShare_Share_m599193430 in Bulk_Assembly-CSharp_6.o _NatShareWebGL_NatShareU_INatShare_Share_m3151828097 in Bulk_Assembly-CSharp_6.o "_NSShareImage", referenced from: _NatShareBridge_Share_m2665191448 in Bulk_Assembly-CSharp_6.o _NatShareiOS_NatShareU_INatShare_Share_m1414757877 in Bulk_Assembly-CSharp_6.o _NatShareWebGL_NatShareU_INatShare_Share_m323996880 in Bulk_Assembly-CSharp_6.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Share crash on iOS 12/13

An empty scene with one button that executes:

var texture = ScreenCapture.CaptureScreenshotAsTexture(2);
NatShare.Share(texture);

It works on Android, but crashes on iOS. Tested on iOS 12 Simulator and iOS13 Public Beta 2 device. Logs are attached.

NativeShare Device iOS13.txt
NativeShare Simulator iOS12.txt

We used the latest NatShare 1.2 version from GitHub.
Unity version: 2019.1.7f1

Thank you.

Crash when sharing

java.lang.Error: FATAL EXCEPTION [main]
Unity version     : 2018.3.0f2
Device model      : samsung SM-J710F
Device fingerprint: samsung/j7xeltexx/j7xelte:8.1.0/M1AJQ/J710FXXU5CRJD:user/release-keys
Caused by
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:3805)
  at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:3845)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3065)
  at android.app.ActivityThread.-wrap11 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1724)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:164)
  at android.app.ActivityThread.main (ActivityThread.java:7000)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:441)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1408)
Caused by: java.lang.RuntimeException: 
  at android.app.ActivityThread.deliverResults (ActivityThread.java:4519)
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:3777)
Caused by: java.lang.NullPointerException: 
  at com.yusufolokoba.natshare.NatShareCallbacks.onActivityResult (NatShareCallbacks.java:25)
  at android.app.Activity.dispatchActivityResult (Activity.java:7665)
  at android.app.ActivityThread.deliverResults (ActivityThread.java:4515)

Unknown CPU Architecture when building for a Samsung Galaxy Tab A

Hello,

When I try to build to my Android Galaxy Tab device it gives me this error.

Works great on iOS.

Exception: Unknown CPU architecture  for library Assets/NatShare/Plugins/iOS/libNatShare.a
UnityEditor.Android.PostProcessor.Tasks.NativePlugins.ProcessPlugin (UnityEditor.Android.PostProcessor.PostProcessorContext context, System.String pluginPath, System.String pluginTargetCPU)
UnityEditor.Android.PostProcessor.Tasks.NativePlugins.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTargetGroup targetGroup, BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:287)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Link sharing is unavailable

When I'm trying to share link to the game, share dialog is not shown up. But with plain text it works fine.

Add sharing callback

The callback should ideally provide information as to whether the user actually shared, or whether they cancelled.

Android API 28 version MediaScanning issue

When video recording is finished with Natcorder.
It is stored in the device.
And when I run the media scanning plugin, it means that the image file is not displayed in the gallery.
Storage is good.
There are only problems with media scanning.
And this problem only occurs in Android API version 28 or later.
I want to know if you are working well. Will it appear right in the gallery after I save it?
It seems that the problem is not updating the thumbnail.

Sharing text and image at the same time not working

I am not being able to share image and text together at least on facebook, twitter and facebook messenger.
It only shares image.

Also is there any way of only share text like share a link or something?

Can't save to Camera Roll on Android

When using NatShare.SaveToCameraRoll(path), the Android build is able to save to local storage (I can see several recordings at android/data/<app.id>), but it's not transferring it into CameraRoll.

Looking at the ADB log, I see:
2019-05-31 13:32:02.794 13791-13813/com.Armor2020.ProtoLocalStorage E/Unity: NatShare Error: Failed to save media to camera roll
java.io.FileNotFoundException: /storage/emulated/0/DCIM/recording_2019_05_31_13_32_01_650.mp4 (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:308)
at java.io.FileOutputStream.(FileOutputStream.java:238)
at java.io.FileOutputStream.(FileOutputStream.java:180)
at com.yusufolokoba.natshare.NatShare.copyFile(NatShare.java:163)
at com.yusufolokoba.natshare.NatShare.saveMediaToCameraRoll(NatShare.java:124)
at com.unity3d.player.ReflectionHelper.nativeProxyInvoke(Native Method)
at com.unity3d.player.ReflectionHelper.a(Unknown Source:0)
at com.unity3d.player.ReflectionHelper$1.invoke(Unknown Source:77)
at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
at $Proxy9.onRecording(Unknown Source)
at com.yusufolokoba.natcorder.MP4Recorder$4$1.run(MP4Recorder.java:199)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)

Looking at the forum I saw someone had an issue with DCIM/Camera folder not existing. I double checked and the folder is there, but no data related to the videos being recorded from my app.

Also, same build on iOS works fine.

This is using NatShare 1.3, Pixel 2, Android v9.

Sharing video on skype

While sharing video on Skype over Andorid platform it shares video not text
and while sharing on Skype over iOS platform it shares text not video

Add copy argument to SaveToCameraRoll

When copy is false, the media file will be deleted from the app's private documents directory once it has been added to the camera roll. The default will be copy = true

Instagram sharing fails

[default] [ERROR] Could not create a bookmark: Error Domain=NSFileProviderInternalErrorDomain Code=1 "The reader is not permitted to access the URL." UserInfo={NSLocalizedDescription=The reader is not permitted to access the URL.}
[default] [ERROR] Failed to determine whether URL /var/mobile/Containers/Data/Application/XXXXXX/Documents/recording_2018_10_10_16_04_13_208.mov (n) is managed by a file provider
  • Could be part of a larger problem regarding sandboxed files

Crash just after sharing on iOS

Unity application appears to stall right after I share a video. The video is successfully getting shared (tried camera roll, email, etc), but it crashes when returning.

Debugging in xcode doesn't give much info:

app startup...
2019-10-06 22:01:21.507467-0400 astrogolf[336:9959] UnityIAP: Add transaction observer
2019-10-06 22:01:21.507536-0400 astrogolf[336:9959] UnityIAP UnityEarlyTransactionObserver: Request to initiate queued payments
2019-10-06 22:01:39.300781-0400 astrogolf[336:9959] NatCorder: Prepared MP4 video encoder at resolution [email protected] with average bitrate 5909760 and keyframe interval 3s
2019-10-06 22:01:49.466819-0400 astrogolf[336:9959] NatCorder: MP4 recorder finishing
2019-10-06 22:02:27.989389-0400 astrogolf[336:10173] [ShareSheet] connection invalidated
libc++abi.dylib: terminating with uncaught exception of type Il2CppExceptionWrapper

I'm using the payload-api branch, commit 13fe819. The code to call NatShare is:

using (var payload = new SharePayload()) {
    payload.AddMedia("video.mp4");
}

I'm on a 10.5 inch iPad pro running ios 13.1.2

Issue building for WebGL

Hi,

I'm attempting my iOS and Android App which uses NatShare (great job btw!) to WebGL. I'm using the latest version from the Asset store on Unity 2018.1f.6

Builds on iOS and Android compile fine, however the WebGL Build fails with the following error:

423: [Unity] stderr:ERROR:root:/BUILD_PATH/xxxx.xxxx.default-webgl/Assets/NatShare/Plugins/iOS/libNatShare.a: Unknown format, not a static library! 424: [Unity] UnityEditor.CloudBuild.BuildLogger:HighlightUnityErrors(String, String, LogType) 425: [Unity] stderr:ERROR:root:/BUILD_PATH/deraggi.fortdesigner.default-webgl/Assets/NatShare/Plugins/iOS/libNatShare.a: Unknown format, not a static library!

I have no idea what this means, but do you know any way how I can fix that?

Thanks a ton!

Sharing on twitter not working

The sharing on any other platform like facebook, discord, slack, facebook messeger and etc. Its working fine but on twitter only shows up the text and the image isn't shared.

I tested this with an android phone

"Save Image" option no longer available

When sharing a Texture2D image on an iPhone 7 plus running the latest iOS 12.1.4 , the option on the share menu to "Save Image" is no longer available. The only option to save the image is "Save to Files" which does not add to the camera roll.

Saved images are in a folder called "NatShare"

On Android, can we replace the "NatShare" from the save path with something generic like "Screenshots" or "Game Photos". Additionally, having the option to provide a directory name would be nice so we could put screenshots in a folder with the Name of the App. I'd do it myself but I'm a noob at Native Android and don't know how to compile the .java into an .aar file.

Twitter sharing image not working

A simple image sharing is not working on twitter enven if i passa empty string on message it doesnt share the image. I talked to someone on twitter they said that the android doesnt like very much to pass a uri file:// and the alternative would be passinga uri that its not file:// , they also advised a workaround would be some thing like this StrictMode.setVmPolicy(StrictMode.VmPolicy.LAX);

Could you take a look on this ? or tell how ae you doing it ?

Generalize ShareVideo to media files

  • Refactor to NatShare::ShareFile
  • This is to add support for NatMic audio recordings (.wav's and whatever else in the future).
  • On Android, infer MIME type of file

New front-end API draft

The goals of this will be:

  • Support composite sharing payloads (multiple images, multiple videos, and so on) instead of restricting to one image or one video or one piece of text
  • Finally take care of #44
  • A more object-oriented front-end. This has been a recent trend across all the Nat* API's; NatCam, NatCorder, and NatMic have all moved away from the static class pattern to functional instances.

Here's a draft:

namespace NatShare { // No more `NatShareU`

    public class SharePayload : IDisposable? { // Does this need to be disposable?
        /// <summary>
        /// Subject of the share payload
        /// </summary>
        public string Subject { get; set; }
        /// <summary>
        /// Add plain text
        /// </summary>
        public void AddText (string text);
        /// <summary>
        /// Add an image
        /// </summary>
        public void AddImage (Texture2D image);
        /// <summary>
        /// Add media with at a given URI
        /// </summary>
        public void AddMedia (string uri);
        /// <summary>
        /// Commit the payload to the operating system for sharing
        /// </summary>
        public void Commit (Action completionHandler = null);
        /// <summary>
        /// Dispose the payload
        /// </summary>
        public void Dispose ();
    }

    public class MediaPayload : IDisposable {
        /// <summary>
        /// Create a media payload for a given image
        /// </summary>
        public MediaPayload (Texture2D image);
        /// <summary>
        /// Create a media payload for media at a given URI
        /// </summary>
        public MediaPayload (string uri);
        /// <summary>
        /// Get an image from the backing media
        /// </summary>
        public Texture2D GetImage (float time = 0f);
        /// <summary>
        /// Save the media to the camera roll
        /// </summary>
        public void SaveToCameraRoll (string album = null);
        /// <summary>
        /// Dispose the media payload
        /// </summary>
        public void Dispose ();
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.