Skip to content

ngrebenshikov/extension-facebook

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 13 commits ahead, 1 commit behind HaxeExtension:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

extension-facebook

Haxe OpenFL extension for Facebook, supports Facebook SDK for Android and iOS. On other platforms uses Facebook REST API and logins using a Webview.

###How to Install

To install this library, you can simply get the library from haxelib like this:

haxelib install extension-facebook

Once this is done, you just need to add this to your project.xml

<setenv name="FACEBOOK_APP_ID" value="7699999960641202" /> <!-- your facebook app ID -->
<setenv name="FACEBOOK_DISPLAY_NAME" value="SuperGame!" /> <!-- your game name -->
<haxelib name="extension-facebook" />

##Usage example

Login the user to Facebook if needed:

import extension.facebook.Facebook;

var facebook:Facebook = Facebook.getInstance();
facebook.init(function(value:Bool){trace("Init Callback");});
if (facebook.accessToken!="") { // Only login if the user is not already logged in
  onLoggedIn();
} else {
  facebook.login(               // Show login dialog
    PermissionsType.Read,
    ["email", "user_likes"],
    onLoggedIn,
    onCancel,
    onError
  );
}

Send app invite:

// See https://developers.facebook.com/docs/applinks
extension.facebook.AppInvite.invite("https://fb.me/1654475341456363");

Share a link on the users timeline:

extension.facebook.Share.link(
  "<a link to something>",
  "<title>",
  "<link to an image>",
  "<description>"
);

Graph API:

facebook.get(
  "/me/permissions",  // Graph API endpoint
  onSuccess,  // Dynamic->Void
  onError     // Dynamic->Void
);

##License

The MIT License (MIT) - LICENSE.md

Copyright © 2012 SempaiGames (http://www.sempaigames.com)

Authors: Daniel Uranga, Joaquín Bengochea & Federico Bricker

About

OpenFL Facebook SDKs integration

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Haxe 68.8%
  • Objective-C++ 16.3%
  • C++ 12.3%
  • Other 2.6%