[Released] iOS native social networking

Provides a super easy interface to the iOS UIActivity sharing mechanism. Allows you to share text, URLs, and files. The menu is automatically generated based on what you provide.

Compatible with iOS 6 and higher. Requires Xcode 6 to build.

Gives you access to:

Diffusion supports iOS 8 Extensions and will automatically include any extensions the user has installed on their device. There is also a simple interface for adding your own custom UIActivities for whatever platforms you may want to support!

Setup and configuration are super easy. You can set which platforms you want to allow through the inspector, as well as set up your default messages. After that, it’s just a single line of code (or a SendMessage) to start sharing your content.

Documentation is available online: http://scarlet.io/docs/diffusion.html

[ Get it on the Asset Store! ]
– Screenshots –

1364753--115104--1 - editor.png

– Release Notes –

2.1.0

  • Supports iOS 8 and Extensions
  • Added PostToFacebook() and PostToTwitter() methods

2.0.2

  • Made the post-processor a little more robust
  • Fixed AirPlay never hiding

2.0.1

  • Fixed a bug in the post-processor

2.0.0

  • Fixed the Twitter availability check
  • Fixed custom platforms being added multiple times when entering a scene repeatedly
  • Moved to a new post-processor. See the upgrade notes.

1.5.1

  • Added methods to check if Twitter/Facebook are logged in
  • Added support for arbitrary UIActivities

1.5.1

Added two new methods:
isFacebookConnected() - Checks if the user is logged into Facebook
isTwitterConnected() - Same, but for Twitter

Added a new system for adding custom UIActivities to the menu. The process to add it to the menu is very easy:

  • Find/write your UIActivity and put all the related files in Plugins/iOS/
  • Write a small Objective-C category file to make the headers available (there’s a template for this included you just need to fill in the blanks!)
  • Add the name of your UIActivity class into a slot in the inspector!

I’ll be releasing pre-made UIActivities for different things soon, and as free extensions. Instagram is coming soon, but in the mean time DMActivityInstagram works perfectly fine!

Apparently when I got the email saying my update had been approved for the Asset Store, it completely lied to me. The update never actually went live. I contacted the Asset Store team twice about it, but have heard nothing. I’ve resubmitted my update, and it’s now pending approval, again.

My apologies to anyone who has been looking for these new features. I’ll update this again if I hear anything new.

Just going to bump this again because the latest version is now actually available. I didn’t get any notice about it, so I’m not sure how long it’s been live, but it’s there now!

Also, I’ve uploaded a free/open source extension to add Instagram support. I’ll be adding more networks soon!

Download it here: https://github.com/scarlet/Diffusion-Instagram/releases

Hey there,

So I found the tiniest bug in your plugin.
On iOS when you turn Guided Access on and off you loose
[UIApplication sharedApplication].keyWindow becomes nil so it doesn’t bring up the sharing Menu anymore.

Here is my quick fix (in Diffusion.mm ) before displaying the viewController
At the end of : -(void)share:(NSString*)message withURL:(NSString*)url andFile:(NSString*)file

UIWindow *window = [UIApplication sharedApplication].keyWindow;
if( window == nil ){
        NSArray *windows = [[UIApplication sharedApplication] windows];
        if ([windows count]) {
            window = windows[0];
        }
        else return ;
    }
[window.rootViewController presentViewController:activityVC animated:YES completion:nil];

If you think of a better way to get the window, let me know :wink:

We released version 2.0.0 last night! It contains several bug fixes, and new, more simple post-processor.

Please be sure to read the upgrade notes if you’re upgrading from 1.x.

Also, this version was in the queue before we saw Electrik_Sheep’s bug posted above. We’ll include that fix soon! (And thanks, by the way!)

Okay, so I was wondering,

Since iOS7 doesn’t let you share on Facebook if you are logged in the iOS settings,
Is there a way we could still share via the Facebook App (of course if it is present on the device),and add it to share menu like you did for the Instagram app ?

Cheers

It’s possible, but you’d need to also include the Facebook SDK, as I don’t see a way to post through their URL schemes. You’d need to go through the standard Facebook authentication process before being able to post. Not too big of a deal with single sign on, but still a consideration.

So, I really REALLY don’t like the fact that facebook doesn’t show if you are not signed in.

What I did was to create 2 new Custom activities that use the iOS SLComposeViewController, the main difference from the UIActivity is that when you try to use it, it will tell you that you can’t and guide you to your iOS settings.

If facebook and/or twitter are not setup, they will appear in the bottom line of the UIActivity like the Instagram icon. And if they are properly setup they will remain hidden.

I zipped the classes I created, feel free to add them to Diffusion, I feel like I wouldn’t be the only one that could profit from it.

1541008–89675–$Plugins.zip (22.9 KB)

We fixed a bug in the new post-process script, and have submitted an update. If you don’t want to wait for that though, you can grab the new version here: https://github.com/scarlet/ScarletPostProcessor/blob/master/ScarletPostProcessor.cs

The latest version 2.0.1 is now live! http://u3d.as/5te

We’ve added two new free extensions for Tumblr, and Pinterest! You can get them (and our older Instagram extension) here:

thx Electrik_Sheep for your zip. I think that this zip should be add to Diffusion!

No worries, I am glad it was useful to someone else.

Hi cbaltzer,
I’ve just installed the package but I can only see the Twitter icon in the sharing menu I’m currently logged in Facebook and Instagram, there is something else I should do to see the fb and Instagram icon?

Thanks!

1645502--102296--$Screen Shot 2014-05-29 at 17.20.26.png

For Instagram, you’ll need to install the Diffusion-Instagram package, and add ‘DInstagram’ to the list of custom platforms.

For Facebook you unfortunately need to be logged in through the Settings app, not just the Facebook app. See Electrik_Sheep’s solution above for a slight workaround to this.

Hi Again,
thanks for that, it works now.
Now I’m trying to make the ScarletPostProcessor works but it doesn’t seems to do what I expected, the code is being executed but the value in the of “Enable Modules (C and Objective-C)” in the xcode project is still “NO”, Im using Unity 4.01 (cant switch over to 4.3 at the moment) and everything is working fine, there is something else I should do to have the Enable Modules (C and Objective-C) activated?
Thanks Again!

Hmm… that’s strange. What version of Xcode are you using? Are you seeing the log message from the PostProcessor get printed out in Unity? Make sure you’re using the latest version of the PostProcessor, from here: https://github.com/scarlet/ScarletPostProcessor

You can always set Enabled Modules to YES in Xcode itself. It sucks to do manually, but, the setting should stick as long as you append your builds.

Edit:

[PostProcessBuild(1500)]

Also, consider trying to change the line above, in ScarletPostProcessor.cs. That number indicates the order of PostProcessBuild scripts, so if you have another plugin, it could be overwriting the changes made by ScarletPostProcessor. Changing that number to something higher will cause it to run later, and hopefully after whatever other plugin is interfering.

Thanks for the answer,
I’m using xcode version 5.1.1

I m seeing the log message and I change the value of the postprocessbuild but no luck :frowning:

Hi,
Is there a way to share a custom message via script.
I mean only a text , composed by blabla +score, and a link?