Hey guys!
So I had made this simple little plugin to use in a few of our games and wanted to see if it’s as useful as I think it is.
Basically it allows you take different types of screenshots (or even straight image paths) and let’s you pick any supported sharing app on your phone to share the picture. It uses the native share UI.
It’s just one simple script. Move it into your plugins folder and add write permissions to your AndroidManifest.xml and you’re ready to go. One line of code can take a screenshot of your game and open the share UI for players to pick what they want. You can even pre-fill the header and body for apps that allow it.
Source code is there and it’s pretty straight forward. But might save someone a bit of time. I’ll try to add more sharing functionality as I go. Go ahead and make requests (within reason, of course haha) and I’ll see what I can do.
Why this plugin adds Assembly-Csharp files on assets folder?
And, is possible to get anything like ahref when sharing an image to get able to launh and url if anyone does click on image shared?
Thank you.
I don’t recall adding those in the plugin myself. When you import the plugin, are those files actually included in the pop-up that appears where you choose specific files in the plugin or does Unity happen to add those files after the import completes?
I’ve noticed some other plugins do that to my projects as well. I’ve kinda just taken it as part of Unity, haha. It could have something to do with this:
Is this the first plugin in your project?
And I’m not sure what you mean. Do you want to manually enter a URL that opens when an image is clicked? That would only work depending on which app the user selects. For example, if the user picks Gmail, the image is an attachment, so you can’t make it an ahref. Same applies to most apps that I’m aware of.
Can you give me a specific use-case?
I have another plugins on my project, and only when i click on import, then appears on the windows showing what become imported to my folder, all of your asset files and also this two csharp firstpass.
And about to open a url, yes, i want to people come to my url app and get more install if click on image share. I have analytics and the most case of use for share it is twitter, facebook, or gmail.
I know for facebook is required an specific sdk, and i got it working on other projects… but, its possible to do it for anything like twitter or g+?
Sorry was gone for the holidays and forgot to respond.
I have a new update that I want to push out, but have been too busy to clean up. When I do that, I’ll clean up those assembly files, although I’m pretty sure I didn’t select them when I made the package. Thanks for the warning on that!
And I’ll look into it, but I’m not entirely sure when that will make it into the plugin, if at all. Sorry about that :\
Oh I forgot to post here. But I believe I fixed the assembly file issue. Hopefully, haha.
I also added a few new features to check and ask for permissions on Android 6.0 (Marshmallow) or higher. That might come in handy even if you don’t need the sharing features.
I still have not gotten to your feature request, MrPacoGP. Sorry about that. Not a lot of downtime when trying to complete a game, lol. It’s on my list, though.
Do you know why using the method SPAndroidShare.ShareScreenBytes on Facebook, doesn’t insert the subject and body text? is this a bug? I can only see the screenshot.
But in iOS share(another plug in) I can insert a link and the Facebook mobile post detects the link, why in android your plug in can’t insert the link? it’s facebok policy again or there is a way around with your plug in?
So you want the user to go to the link when clicking the picture? Or do you mean putting a link into the body/subject?
Because I am fairly positive you can not pre-fill the text, but making a clickable link out of the picture might be
I’ll keep looking into it, but I’m not entirely sure. Some people were saying to put only a URL in the “body” (aka EXTRA_TEXT) field. And Facebook will strip everything but the URL. That doesn’t seem to be working with my tests though.
Some other people said that trick works on iOS but not Android
Can you send me a screenshot of what the post looks like when you use the iOS share? It might involve using a different intent type.