Social features for iOS?

Hello, What would I do first if I want to have email, facebook and twitter integration (having pre-set messages/posts that the player can send from within the game) in my unity iOS game(anyone know of any good tutorials)?

There is no direct method in unity to do that. As, its native feature and Unity being cross-platform engine.

If you want to do that you need to use

  • Share sheet on iOS.
  • Intent Chooser with required types.

For this reason we developed Cross Platform Native Plugins for both iOS and Android with a unified API.
It has sharing features along with other mostly used features (Notifications, Billing & many more).

Sharing feature is completely available for FREE in Lite version . Grab it and source code is included to have a look.

Sharing feature contains following functionalities

  • Share image, text,url via SMS
  • Share image, text,url via E-Mail
  • Share image, text,url via Whats-app
  • Share image, text,url on Social Network (Facebook, Twitter)

Adding to it we added separate Twitter SDK feature in full version.

Most iOS plugins are designed to work very similarly. Here is the general path.

  1. Bring the facebook/twitter plugin into xCode.

  2. You have to create a wrapper class. This isn't that hard. This class allocates an object for managing for your messaging. This just encapsulates your direct message handlers. There is a very high chance this code will be written in Objective-C.

  3. Create a collection of static methods outside your class wrapped in `extern "C" {}` This code will probably be in Objective-C++ (method declarations will have C syntax). This is the most flexible part of the implementation. Some how you will create an instance of your class from the previous step. Then you will call its methods `[myInstance sendMessageToFeed:(Facebook*)fbPointer message:(NSString*)messageToPost];` Assuming that your class will respond to those messages.

  4. In Unity, create a plugin manager that acts as yet another wrapper. Use `[DllImport("_Internal")];` to link to your plugin.

  5. Call your plugins through Unity functions and it will pass the function to unmanaged code.

The Bonjour client tutorial demonstrates the process fairly well. See Twitter and Facebook's developer documentation for their specific process of setting up your pointers and sending messages.