nicholassheehan / unity-native-sharing Goto Github PK
View Code? Open in Web Editor NEWA Unity plugin to open native sharing dialogs on iOS and Android, primarily for text and files
License: MIT License
A Unity plugin to open native sharing dialogs on iOS and Android, primarily for text and files
License: MIT License
Hi,
This plugins is very useful and working perfectly fine.
I have one question, is there any way i can find whether user has actually shared the post or just came back by click share popup.
Thanks for your help in advance.
Sending just text to Facebook Messenger doesn't work, Messenger says it cant recognize the file. The fix is simple, don't send an empty array to the ShareMultiple function, send an actual null value. The ShareMultiple function is incorrectly looking for a null array, but since the array isn't null it is still attaching an empty EXTRA_STREAM. This is for Android.
In the ShareAndroid function, add a simple null check to the filePath conditional.
else if (filePaths != null) becomes:
else if (filePaths != null && filePaths.Length > 0 && !string.IsNullOrEmpty(filePaths[0]))
On iOS, it seems to only share the text without the image (providing image and text)
Hey ! First of all, thank you so much for your code, it's simple, clear and do what I exactly needed !
I've just encounter a bug, which is when you want to share an image (PNG file) with Messenger. Everytime I try, I get a popup message saing "Sorry, Messenger was unable to process the file".
Just to let you know, it works perfectly fine on Facebook, Snapchat, WhatsApp, Inbox (Gmail), and a lot more.
I'm using an Android 7.1 and an Android 4.4 for testing.
Hello,
To avoid unwanted screenshots on the disk, i've add a small code that allow users to share Base64 image, without the need to save them on disk.
PR : #8
thanks
No image is added when sharing on WhatsApp.
No text is added when sharing on Facebook.
iOS 10.2.1
When we run same code within Android Nougat, sharing is not working.
Some other people also discussing over here:
https://forum.unity3d.com/threads/share-code-not-working-on-new-android-nougat-7-0.476450/
Can you check the reason??
Every time I share a screenshot on IOS it crashes. This is the crash log.
018-01-07 04:40:24.445 Mzito[6106:1067828] Uncaught exception: NSInvalidArgumentException: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
(
0 CoreFoundation 0x25143933 <redacted> + 150
1 libobjc.A.dylib 0x248dee17 objc_exception_throw + 38
2 CoreFoundation 0x25058d5f <redacted> + 622
3 Mzito 0x007d585d -[iOSNativeShare initWithText:withFilePaths:withSubject:] + 870
4 Mzito 0x007d54ed +[iOSNativeShare withText:withFilePaths:withSubject:] + 62
5 Mzito 0x007d5e3d showSocialSharing + 48
6 Mzito 0x000a18ef NativeShare_showSocialSharing_m407316830 + 38
7 Mzito 0x000a182b NativeShare_ShareIOS_m2364977555 + 262
8 Mzito 0x000a1705 NativeShare_Share_m424583087 + 134
9 Mzito 0x000ec115 U3CdelayedShareU3Ec__Iterator0_MoveNext_m961221407 + 310
10 Mzito 0x006c1cb9 SetupCoroutine_InvokeMoveNext_m2975616245 + 112
11 Mzito 0x007a2113 _Z53RuntimeInvoker_Void_t1841601450_Il2CppObject_IntPtr_tPK10MethodInfoPvPS2_ + 24
12 Mzito 0x0123b815 _ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException + 116
13 Mzito 0x00c731b3 _Z23scripting_method_invoke18ScriptingMethodPtr18ScriptingObjectPtrR18ScriptingArgumentsP21ScriptingExceptionPtrb + 62
14 Mzito 0x00c6d463 _ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb + 44
15 Mzito 0x00b86805 _ZN9Coroutine14InvokeMoveNextEP21ScriptingExceptionPtr + 118
16 Mzito 0x00b865b3 _ZN9Coroutine3RunEPb + 32
17 Mzito 0x00a870f9 _ZN18DelayedCallManager6UpdateEi + 470
18 Mzito 0x00b73235 _Z10PlayerLoopv + 956
19 Mzito 0x00db9437 _ZL19UnityPlayerLoopImplb + 22
20 Mzito 0x0008374b UnityRepaint + 218
21 Mzito 0x00083605 -[UnityAppController(Rendering) repaintDisplayLink] + 76
22 libMTLInterpose.dylib 0x03a08865 -[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 276
23 QuartzCore 0x2779fa0b <redacted> + 106
24 QuartzCore 0x2779f857 <redacted> + 594
25 IOMobileFramebuffer 0x26e8650b <redacted> + 86
26 IOKit 0x25394759 IODispatchCalloutFromCFMessage + 256
27 CoreFoundation 0x250f237d <redacted> + 132
28 CoreFoundation 0x251065b3 <redacted> + 34
29 CoreFoundation 0x25105cc7 <redacted> + 342
30 CoreFoundation 0x251040d9 <redacted> + 1688
31 CoreFoundation 0x25053229 CFRunLoopRunSpecific + 520
32 CoreFoundation 0x25053015 CFRunLoopRunInMode + 108
33 GraphicsServices 0x26643ac9 GSEventRunModal + 160
34 UIKit 0x29727189 UIApplicationMain + 144
35 Mzito 0x0007b7b7 main + 214
36 libdyld.dylib 0x24cfb873 <redacted> + 2
)
2018-01-07 04:40:24.448 Mzito[6106:1067828] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(0x2514391b 0x248dee17 0x25058d5f 0x7d585d 0x7d54ed 0x7d5e3d 0xa18ef 0xa182b 0xa1705 0xec115 0x6c1cb9 0x7a2113 0x123b815 0xc731b3 0xc6d463 0xb86805 0xb865b3 0xa870f9 0xb73235 0xdb9437 0x8374b 0x83605 0x3a08865 0x2779fa0b 0x2779f857 0x26e8650b 0x25394759 0x250f237d 0x251065b3 0x25105cc7 0x251040d9 0x25053229 0x25053015 0x26643ac9 0x29727189 0x7b7b7 0x24cfb873)
libc++abi.dylib: terminating with uncaught exception of type NSException
Mzito is the name of my app.
After adding an exception breakpoint the crash seems to be coming from line 91 in iOSNativeShare.m
`NSArray *paths = [mfilePath componentsSeparatedByString:@";"];
int i;
for (i = 0; i < [paths count]; i++) {
NSString *path = [paths objectAtIndex:i];
if([path hasPrefix:@"http"])
{
NSURL *url = [NSURL URLWithString:path];
NSError *error = nil;
NSData *dataImage = [NSData dataWithContentsOfURL:url options:0 error:&error];
if (!error) {
UIImage *imageFromUrl = [UIImage imageWithData:dataImage];
**[items addObject:imageFromUrl];**
} else {
[items addObject:url];
}
}`
[items addObject:imageFromUrl];
Am a bit new to developing on IOS but what I understood was the title and path were nil which then threw this exception. Does anyone have a fix for this?
I see this error while sharing on Android 8 devices.
E Unity : AndroidJavaException: android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/com.test.company/files/test.png exposed beyond app through ClipData.Item.getUri() E Unity : at android.os.StrictMode.onFileUriExposed(StrictMode.java:1958) E Unity : at android.net.Uri.checkFileUriExposed(Uri.java:2348) E Unity : at android.content.ClipData.prepareToLeaveProcess(ClipData.java:942) E Unity : at android.content.Intent.prepareToLeaveProcess(Intent.java:9753) E Unity : at android.content.Intent.prepareToLeaveProcess(Intent.java:9759) E Unity : at android.content.Intent.prepareToLeaveProcess(Intent.java:9738) E Unity : at android.app.Instrumentation.execStartActivity(Instrumentation.java:1609) E Unity : at android.app.Activity.startActivityForResult(Activity.java:4472) E Unity : at android.app.Activity.startActivityForResult(Activity.java:4430) Unity : at android.app.Activity.startActivity(Activity.java:4791
Hi, but I don't know why , on android, all is work , but on ios, can't share screenshot on whatsapp , also not working on ios Facebook
?
Trying to grab the package in unity 2019.3.5f1 I had to add .git to your suggested string in order for the package manager to resolve it.
"com.unitynative.sharing": "https://github.com/NicholasSheehan/Unity-Native-Sharing.git#release/v1.0.3"
Is what worked, without the .git it wouldn't resolve.
image is not saving in external storage but the share dialog box open .please help me to solve this issue
Thanks your unity-native-sharing, It's so good.
But I have a problem, on iphone, when I take a shot on first time, it will tell me " no image to find",
But if take a shot again, it will show me the last image...
How can it be done? I really do not want my app to scare away users with the "We want to have access to pictures videos blah blah blah".
I just gave this a try, and it works to bring up the share dialog box, but it does not generate a screenshot and when I try to send the generated text, I get a shared failed error.
Using Unity 5.1 and Android 5.
So I've got a crash on my iPad when I tried to share the image, and an error image not found. For both of those errors I've found a fix on this github but now I have another problem. Whenever I try to share the screenshot on my iPad, it just doesn't show up. It's just a blank square, and when I try to send the image to someone it says "Unable to send this file".
On the iPhone it happens as well, but when I try to re-share the image, the image shows up correctly.
Hi guys.
I made a fork in which I fixed the image sharing (based on @orbitalnine solution - #33 (comment) ).
Maybe someone will be useful.
https://github.com/gmikhail/unity-native-sharing
PS: do not wait for further support. I just fixed the bug and decided to share the solution.
After cloning this project i try to run and when i try to share by clicking share button then showing this error , why ? what can i do , how can it solve ?
EntryPointNotFoundException: showSocialSharing
NativeShare.CallSocialShareAdvanced (System.String defaultTxt, System.String subject, System.String url, System.String img) (at Assets/Plugins/NativeShare.cs:81)
NativeShare.Share (System.String shareText, System.String imagePath, System.String url, System.String subject) (at Assets/Plugins/NativeShare.cs:40)
NativeShare.ShareScreenshotWithText (System.String text) (at Assets/Plugins/NativeShare.cs:17)
UnityEngine.Events.InvokableCall1[System.String].Invoke (System.Object[] args) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:184) UnityEngine.Events.CachedInvokableCall
1[System.String].Invoke (System.Object[] args) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:302)
UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:630)
UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:765)
UnityEngine.Events.UnityEvent.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent_0.cs:53)
UnityEngine.UI.Button.Press () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:35)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:44)
UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:52)
UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler](UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:269)
UnityEngine.EventSystems.EventSystem:Update()
The popover View doesn't work on IPad in my case, makes my app crash.
It seems popoverPresentationController need set a non-nil sourceView.
I add some code in IOSNativeShare.m after line 126. It works fine for me. Hope to help.
after this line:
[rootViewController presentViewController:activity animated:YES completion:Nil ];
add:
UIPopoverPresentationController * popContronller=[activity popoverPresentationController]; popContronller.permittedArrowDirections=UIPopoverArrowDirectionDown; popContronller.sourceView=rootViewController.view;
//change location of popover view if you like popContronller.sourceRect=CGRectMake(512,768/2,10,10);
11-21 12:38:15.530: W/Bundle(14891): Key android.intent.extra.STREAM expected Parcelable but value was a java.util.ArrayList. The default value was returned.
11-21 12:38:15.530: W/Bundle(14891): Attempt to cast generated internal exception:
11-21 12:38:15.530: W/Bundle(14891): java.lang.ClassCastException: java.util.ArrayList cannot be cast to android.os.Parcelable
11-21 12:38:15.530: W/Bundle(14891): at android.os.Bundle.getParcelable(Bundle.java:846)
11-21 12:38:15.530: W/Bundle(14891): at android.content.Intent.getParcelableExtra(Intent.java:6761)
11-21 12:38:15.530: W/Bundle(14891): at android.content.Intent.migrateExtraStreamToClipData(Intent.java:9651)
11-21 12:38:15.530: W/Bundle(14891): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1524)
11-21 12:38:15.530: W/Bundle(14891): at android.app.Activity.startActivityForResult(Activity.java:4403)
11-21 12:38:15.530: W/Bundle(14891): at android.app.Activity.startActivityForResult(Activity.java:4362)
11-21 12:38:15.530: W/Bundle(14891): at android.app.Activity.startActivity(Activity.java:4686)
11-21 12:38:15.530: W/Bundle(14891): at android.app.Activity.startActivity(Activity.java:4654)
11-21 12:38:15.530: W/Bundle(14891): at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
11-21 12:38:15.530: W/Bundle(14891): at com.unity3d.player.UnityPlayer.c(Unknown Source)
11-21 12:38:15.530: W/Bundle(14891): at com.unity3d.player.UnityPlayer$c$1.handleMessage(Unknown Source)
11-21 12:38:15.530: W/Bundle(14891): at android.os.Handler.dispatchMessage(Handler.java:98)
11-21 12:38:15.530: W/Bundle(14891): at android.os.Looper.loop(Looper.java:154)
11-21 12:38:15.530: W/Bundle(14891): at com.unity3d.player.UnityPlayer$c.run(Unknown Source)
Title works fine but it gives me "Unable to share file OK" pop up and wont let me send it to slack. It works fine for facebook, instagram, hangout, gmail. Any ideas? Thank you!
Guys,
On Facebook i can only share image but i can not share text or url.
On Whatsapp i can only share text so, how can i share url too ?
please guys help me.
Any possibility to share GIF? Mainly to Whatsapp?
Thanks
Hi there,
I have no experience with Objective-C and have been working through the night to try and get an in-game highscore image sharing to Facebook again along with the other options. I see the ReadMe has been updated which links to a comment regarding this, but unfortunately this offers no further instructions.
Within initWithText in iOSNativeShare.m I have attempted the following, commenting out the original Activity that has items passed into it.
//Set up the sharing activity and add the items
//UIActivityViewController *activity = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:Nil];
CustomActivityProvider *ActivityProvider = [[CustomActivityProvider alloc] initWithPlaceholderItem:@""];
CustomActivityProvider is subclass made from these instructions and here and here, but these only seems to handle one thing being shared (string, url, image) for different sharing activities, rather than the array of items I want to use (e.g. 2 things for Facebook and 3 things for Twitter).
Can anyone with more Objective-C experience than me help me out with this? Thanks
All I essentially want to do is make an Activity that takes in 4/5 sharable items within an array, and depending on whether or not it is being shared via Facebook or Twitter, certain items are chosen.
How can I catch the event when a player cancels sharing to prevent crashing on Samsung Galaxy Tab 4 and Samsung Galaxy J1 2016. On Samsung Galaxy J7 2016 it works nice.
There is one difference: when there is unhandled exception, the first 2 devices crash, but the third one continues work. So I assume that there appears an exception, so the game crashes.
Hello
Great plugin works really well and it's a simple and great solution. I've got some questions:
I am using the plugin but the version with no multiple shares paths, since I have some problems in Android, it works but the Logcat through an exception. So I decided to use the previous version of the plugin and no problems at all. But I have some questions about Instagram and the plugin in general.
Thanks in advance
Hi,
When I share on iOS, the app crashes with the following message,
Uncaught exception: NSGenericException: Your application has presented a UIActivityViewController (<UIActivityViewController: 0x123f38940>). In its current trait environment, the modalPresentationStyle of a UIActivityViewController with this style is UIModalPresentationPopover. You must provide location information for this popover through the view controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the view controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.
What could be the issue, I dont know objective C at all.
Thanks in advance,
Altaf
Is there any way to find out which app is selected ? for example find out it is Facebook sharing or Twitter sharing. because I want to assign different text to different social media.
Hello Im using your plugin in a IOS app and works fine but the image onli share in facebook, not work on wahtsapp.
How can i fix this?
I faced the problem with iPad.
https://stackoverflow.com/questions/38323154/unity-game-screenshot-share-in-multiple-social-platform-in-ios/38610345#38610345
Post of Sachin Acharya was very helpful. I just replaced last lines in IOSNativeShare.mm with:
UIActivityViewController *activityVc = [[UIActivityViewController alloc]initWithActivityItems:items applicationActivities:nil];
if(mSubject != NULL) {
[activityVc setValue:mSubject forKey:@"subject"];
} else {
[activityVc setValue:@"" forKey:@"subject"];
}
if ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad && [activityVc respondsToSelector:@selector(popoverPresentationController)] ) {
UIPopoverController *popup = [[UIPopoverController alloc] initWithContentViewController:activityVc];
[popup presentPopoverFromRect:
CGRectMake(self.view.frame.size.width/2,
self.view.frame.size.height*4/5,
0, 0)
inView:[UIApplication sharedApplication].keyWindow.rootViewController.view
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
} else {
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:activityVc animated:YES completion:nil];
}
Thanks for nice plugin!
Hello,
Just wanted to point out an error which is occurring in iOS but not on Android.
The secuence of errors is:
So there must be an error in the secuence where the screenshot is saved. I tried an system.IO.Delete previous screenshot but this will render an "ERROR coundnt find image" all the times I try sharing.
I think this error is caused because the share has to wait until the screenshot is created and it isnt doing it at the moment.
I already did it, but I modified the code for my specific project.
Here is the code that works for me, you can take the uwp part and test it on windows machine.
Tested on Unity 2017.2.0f3, windows 10 1709 (creator's fall update)
using UnityEngine;
using System.Collections;
using System.IO;
using System;
using System.Runtime.InteropServices;
#if UNITY_UWP
using Windows.Storage.Streams;
using Windows.ApplicationModel.DataTransfer;
using Windows.Storage;
using System.Threading.Tasks;
#endif
/*
* https://github.com/ChrisMaire/unity-native-sharing
*/
public class NativeShare
{
public const string MIME_IMAGE = "image/png";
public const string MIME_TEXT = "text/plain";
public const string MIME_HTML = "text/html";
public static void Share(string shareText, string imagePath, string url = null, string mimetype = MIME_IMAGE, string subject = "")
{
bool canShare = false;
#if UNITY_ANDROID || UNITY_EDITOR
canShare = true;
ShareAndroid(shareText, subject, url, imagePath, mimetype);
#endif
#if UNITY_IOS || UNITY_EDITOR
canShare = true;
ShareIOS(shareText, imagePath, url, subject);
#endif
#if UNITY_UWP
canShare = true;
UnityEngine.WSA.Application.InvokeOnUIThread(async () => { await ShareUWP(shareText, imagePath, url, subject); }, true);
#endif
if (!canShare)
Debug.Log("No sharing set up for this platform.");
}
#if UNITY_ANDROID || UNITY_EDITOR
private static void ShareAndroid(string body, string subject, string url, string filePath, string mimeType)
{
using (AndroidJavaClass intentClass = new AndroidJavaClass("android.content.Intent"))
using (AndroidJavaObject intentObject = new AndroidJavaObject("android.content.Intent"))
{
using (intentObject.Call<AndroidJavaObject>("setAction", intentClass.GetStatic<string>("ACTION_SEND")))
{ }
using (intentObject.Call<AndroidJavaObject>("setType", mimeType))
{ }
using (intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_SUBJECT"), subject))
{ }
using (intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_TEXT"), body))
{ }
if (!string.IsNullOrEmpty(url))
{
// attach url
using (AndroidJavaClass uriClass = new AndroidJavaClass("android.net.Uri"))
using (AndroidJavaObject uriObject = uriClass.CallStatic<AndroidJavaObject>("parse", url))
using (intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_STREAM"), uriObject))
{ }
}
else if (!string.IsNullOrEmpty(filePath))
{
using (AndroidJavaClass uriClass = new AndroidJavaClass("android.net.Uri"))
using (AndroidJavaObject uriObject = uriClass.CallStatic<AndroidJavaObject>("parse", "file://" + filePath))
using (intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_STREAM"), uriObject))
{ }
}
// finally start application
using (AndroidJavaClass unity = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
using (AndroidJavaObject currentActivity = unity.GetStatic<AndroidJavaObject>("currentActivity"))
{
AndroidJavaObject jChooser = intentClass.CallStatic<AndroidJavaObject>("createChooser", intentObject, string.Empty);
currentActivity.Call("startActivity", jChooser);
}
}
}
#endif
private static void ShareIOS(string shareText, string imagePath, string url, string subject = "")
{
#if UNITY_IOS || UNITY_EDITOR
CallSocialShareAdvanced(shareText, subject, url, imagePath);
#endif
}
#if UNITY_UWP
private static async Task ShareUWP(string shareText, string imagePath, string url, string subject = "")
{
try
{
RandomAccessStreamReference streamRef = null;
if (!string.IsNullOrEmpty(imagePath))
{
imagePath = imagePath.Replace("/", "\\");
StorageFile sFile = await StorageFile.GetFileFromPathAsync(imagePath);
streamRef = RandomAccessStreamReference.CreateFromFile(sFile);
}
DataTransferManager dtm = DataTransferManager.GetForCurrentView();
dtm.DataRequested +=
(sender, args) =>
{
DataRequest dr = args.Request;
DataRequestDeferral def = dr.GetDeferral();
dr.Data.SetText(shareText);
if (streamRef != null)
dr.Data.SetBitmap(streamRef);
else if (!string.IsNullOrEmpty(url))
dr.Data.SetWebLink(new Uri(url));
dr.Data.Properties.Title = string.IsNullOrEmpty(subject) ? "Share" : subject;
dr.Data.Properties.Description = shareText;
def.Complete();
};
DataTransferManager.ShowShareUI();
}
catch (Exception ee)
{
Debug.LogError("ShareUWP error=" + ee.Message);
}
}
#endif
#if UNITY_IOS || UNITY_EDITOR
private struct ConfigStruct
{
public string title;
public string message;
}
[DllImport("__Internal")] private static extern void showAlertMessage(ref ConfigStruct conf);
private struct SocialSharingStruct
{
public string text;
public string subject;
public string filePaths;
}
[DllImport("__Internal")] private static extern void showSocialSharing(ref SocialSharingStruct conf);
private static void CallSocialShare(string title, string message)
{
ConfigStruct conf = new ConfigStruct();
conf.title = title;
conf.message = message;
showAlertMessage(ref conf);
}
private static void CallSocialShareAdvanced(string body, string subject, string url, string filePath)
{
SocialSharingStruct conf = new SocialSharingStruct();
conf.text = body;
string paths = string.Join(";", filePath);
if (string.IsNullOrEmpty(paths))
paths = url;
else if (!string.IsNullOrEmpty(url))
paths += ";" + url;
conf.filePaths = paths;
conf.subject = subject;
showSocialSharing(ref conf);
}
#endif
}
I am able to share Image and URLs. But if I try to share and mp4 video file I get an error pop up saying file format not supported.
I have kept mime type to video/mp4.
Any help will be grateful. Thanks
It seems that this code has a problem where the screenshot isn't attached when sharing through Twitter.
Can you please fix this?
Is the Developer here still active?
Hi dear
[space]
version: unity 5.6
OS: android
target: telegram
device: Samsung galaxy note 5
[comment]
screenshot make but not attached on Telegram . also in Instagram message me that "unable to load image".
please guide me .
Its giving me a "Conflicting types for 'ShowAlertMessage' "
There are actually two ShowAlertMessage in the iOSNativeShare.m but since it works for everyone else could you tell me what might cause this issue? iOSNativeShare.m and .h are both unchanged
The plugin works really good.
The only issue I am having is when I click share, it opens up apps to select from, then I have to click facebook so it shares on Facebook.
How can I make it open Facebook automatically?
Hi, Thanks for this plugin development.
I want to share text for android and iOS games.
So how to do that? I tried this but this not seam easy to me.
Please give some help in this.
If i want to share other file other than images (example: .abc,) how can i do it?
The plugin in android works perfectly but in IOS when a try to share a screentshot appears "Cannot find image" (this occurs the first time when I press Share button). When I try again and again shows me penultimate screenshot never the last.
Thank you
Hi I'm experience this issue
java.lang.RuntimeException: Unable to get provider android.support.v4.content.FileProvider: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.FileProvider"
And I fint in your plugin manifest this field
As I research there is a way to fix it is change it into this
Is this true or am I doing something wrong ?
When I try to save the shared screenshot, the iOS crash.
Any ideas?
I want to show the image captured or screenshot in apop-up screen and after that on confirmation of user, open native share of mobile. help me how to do that?
In's not actualy an issue, just want to ask u. is it possible to share video file via your plagin? Becouse we tried to share video file on android and it works. But in iOS it's always an error. We think that in objectiv-c code there is some class or method witch converts bytes array only to image format
The error I'm getting on the phone is "Image not found" (but everything else, including title, text, and link, are working)
Help me please!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.