Access to facebook for messages, etc. Using Graph API C # unity3d

I am using C # in MonoDevelop with the Graph API to interact with facebook user pages.

However, I was completely confused.

Are these steps right?

  • Create a facebook application Here: http://developers.facebook.com/
  • programmatically obtain an access token using the application identifier and the Secret application.

If so, how do I switch from publishing to user walls?

I did a lot of research, but could not find anything particularly useful.

I tried using this ASP.NET post on a Facebook wall , but nothing appears on the wall.

Is there a textbook or something that can lead me to this process glorious and slow?

All recommendations or pointers are welcome.

As indicated, I work with unity 3D, C # in mono and facebook api graphics.

[Edit] I would like it to work on Android.

+3
source share
2 answers

Use the C # Facebook library . There is an example project called facebook-aspnet-sample that shows you the authentication and login. Also, check out this tutorial page on how to connect from Unity3d to Facebook. It’s short here, but downloading a demo project is useful.

There are also plugins for sale that allow Facebook access from Unity3d.

+2
source

, FB , , . - -. , Facebook, , . : FB: https://developers.facebook.com/docs/authentication/, , Android: https://developers.facebook.com/docs/mobile/android/sso/

JavaScript- ( MVC3), https://developers.facebook.com/docs/authentication/client-side/ . .

<div id="fb-root"></div>
<script>
    // Load the SDK Asynchronously
    (function (d) {
        var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
        if (d.getElementById(id)) { return; }
        js = d.createElement('script'); js.id = id; js.async = true;
        js.src = "//connect.facebook.net/en_US/all.js";
        ref.parentNode.insertBefore(js, ref);
    } (document));

    // Init the SDK upon load
    window.fbAsyncInit = function () {
        FB.init({
            appId: '@EventController.FB_APP_ID', // App ID
            channelUrl: '//' + window.location.hostname + '/channel.htm', // Path to your Channel File
            status: false, // check login status
            cookie: false, // enable cookies to allow the server to access the session
            xfbml: false  // parse XFBML
        });

        // listen for and handle auth.statusChange events
        FB.Event.subscribe('auth.statusChange', function (response) {
            if (response.authResponse) {
                // user has auth'd your app and is logged into Facebook
                FB.api('/me', function (me) {
                    // get info about the user, for example
                })
                //document.getElementById('auth-loggedout').style.display = 'none';
            } else {
                // user has not auth'd your app, or is not logged into Facebook
                //document.getElementById('auth-loggedout').style.display = 'block';
            }
        });

        // respond to clicks on the login and logout links
        document.getElementById('auth-loginlink').addEventListener('click', function () {
            FB.login(function (response) {
                // handle the response
                if (response.authResponse != null) {
                    // HERE IS THE TOKEN YOU CAN USE
                    var token = response.authResponse.accessToken;
                } else {

                }
                // AND THESE ARE THE PERMISSIONS YOU WANT YOUR APP TO REQUEST
            }, { scope: 'manage_pages,publish_stream' });
        });
    };
</script>

- FB URL ( http://localhost/) → → URL- -. channel.htm :

<script src="//connect.facebook.net/en_US/all.js">
+1

All Articles