The Facebook SDK for Unity

28
The Facebook SDK for Unity Michael Herring Unity Technologies Japan Unite Japan 2014

Transcript of The Facebook SDK for Unity

Page 1: The Facebook SDK for Unity

The Facebook SDK for Unity Michael Herring

Unity Technologies Japan

Unite Japan 2014

Page 2: The Facebook SDK for Unity

Cool Facebook Game

Cool Mobile Game

Unity

Facebook SDK Facebook SDK For

Unity

Page 3: The Facebook SDK for Unity

Why Facebook?

Page 4: The Facebook SDK for Unity

A Huge Audience

Over 1 billion users

375 million playing games

735 million referrals…daily!

Page 5: The Facebook SDK for Unity

The Facebook Canvas

Page 6: The Facebook SDK for Unity

Games On Facebook

Dedicated games/apps sections

Page 7: The Facebook SDK for Unity

Games On Facebook

Game posts are normal Facebook posts, like shares or pictures

Page 8: The Facebook SDK for Unity

Support For Unity Games

Unity-specific Install Pages

Page 9: The Facebook SDK for Unity

Support For Unity Games

Unity-specific Install Pages

Page 10: The Facebook SDK for Unity

Payments Integration

• Works on Facebook Canvas

• Simple API

• Facebook handles the details

Page 11: The Facebook SDK for Unity

Integrating Your Game Configure and Login

Perform API Requests

Post Game Activity

Page 12: The Facebook SDK for Unity

Configure Your Game

Page 13: The Facebook SDK for Unity

Configure Your Game

Page 14: The Facebook SDK for Unity

Delegate-Focused API

Page 15: The Facebook SDK for Unity

Delegate Types

public delegate void InitDelegate() public delegate void HideUnityDelegate(bool isUnityShown) public delegate void FacebookDelegate(FBResult result)

Page 16: The Facebook SDK for Unity

One Universal Parameter Type class FBResult : IDisposable { // exposes three relevant properties: public Texture2D Texture, public string Text, public string Error }

Page 17: The Facebook SDK for Unity

Login With Facebook

• Low-friction

• No need for another account

FB.Init

FB.Login

FB.Logout

Page 18: The Facebook SDK for Unity

Use Facebook’s Normal API Calls

• FB.API

• Convert data types where appropriate

https://developers.facebook.com/docs/graph-api

Page 19: The Facebook SDK for Unity

Deep Linking

Page 20: The Facebook SDK for Unity

Use Facebook’s Normal API Documentation

• FB.GetDeepLink

• Configure your app within Unity, and on Facebook Dev Portal

Page 21: The Facebook SDK for Unity

Fullscreen Dialogs

Page 22: The Facebook SDK for Unity

Limited Now, Expanding Fast

• Currently only for Canvas-deployed apps

• Only for “Feed” and “Request” dialogs

Page 23: The Facebook SDK for Unity

Facebook SDK 5.xβ

Page 24: The Facebook SDK for Unity

Coming Soon!

• iOS “Cold Starts”

• Better Android login

• Access graph data from within the editor!

• Smaller SDK file size

• Updated underlying SDKs

Page 25: The Facebook SDK for Unity

Let’s Get Started!

Page 26: The Facebook SDK for Unity
Page 28: The Facebook SDK for Unity