Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by aronsommer · Jul 10, 2011 at 04:52 PM · facebookpermissions

Unity game on facebook question

Hello!

I have created a canvas page on facebook with my Unity web content. It looks good: http://apps.facebook.com/supergun/ But is it normal that no Request for Permission appear when my friend open the app from this page: http://www.facebook.com/apps/application.php?id=216020301767130 ?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

6 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by aronsommer · Oct 21, 2011 at 11:14 PM

Hello wolfgang. If you want that your app makes bookmarks in the user favorites and generate stories like "wolfgang is playing app" you have to ask for the basic permissions. change the .html suffix to .php and put following code at the top of the file:

you will find more information on this link: https://developers.facebook.com/docs/authentication/

 <?php 
 
    $app_id = "APP ID";
    $app_secret = "APP SECRET";
    $my_url = "APP URL";
 
    session_start();
    $code = $_REQUEST["code"];
 
    if(empty($code)) {
      $_SESSION['state'] = md5(uniqid(rand(), TRUE)); //CSRF protection
      $dialog_url = "https://www.facebook.com/dialog/oauth?client_id=" 
        . $app_id . "&redirect_uri=" . urlencode($my_url) . "&state="
        . $_SESSION['state'];
 
      echo("<script> top.location.href='" . $dialog_url . "'</script>");
    }
 
    if($_REQUEST['state'] == $_SESSION['state']) {
      $token_url = "https://graph.facebook.com/oauth/access_token?"
        . "client_id=" . $app_id . "&redirect_uri=" . urlencode($my_url)
        . "&client_secret=" . $app_secret . "&code=" . $code;
 
      $response = file_get_contents($token_url);
      $params = null;
      parse_str($response, $params);
 
      $graph_url = "https://graph.facebook.com/me?access_token=" 
        . $params['access_token'];
 
      $user = json_decode(file_get_contents($graph_url));
    }
 
 ?>


Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image wolfgang_almeder · Oct 24, 2011 at 08:28 PM 0
Share

Thanks for the response, but i think that for now i want something very basic, i already enter to your app supergun (cool!) and the first thing that facebook does is asking if i accept the basic permissions and when i accept then i can play your game, THAT is what i want my app do!, currently my app doesnt ask for permissions anyone (even a non facebook logged user) can enter to my app. With the code from above i really be able to do that? where do i put the extended permissions array?

I think is here o im wrong ?

if($_REQUEST['state'] == $_SESSION['state']) { $token_url = "https://graph.facebook.com/oauth/access_token?" . "client_id=" . $app_id . "&redirect_uri=" . urlencode($my_url) . "&client_secret=" . $app_secret . "&code=" . $code;

Thanks again, and sorry for my english...

avatar image
0

Answer by Joshua · Jul 10, 2011 at 05:09 PM

They just open the app, I think permission is for letting the app - for instance - write to your wall, etc.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by wolfgang_almeder · Oct 21, 2011 at 07:34 PM

Hi arar, sorry for asking here, im new in facebook app development, how you managed to ask for permissions when a person enter your app? where do you put the code scope=> ? is in the html that comes when you compile your game for web platform ??

thanks in advance.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Dover8 · Nov 07, 2011 at 04:50 PM

Can I ask how you got your unity game onto facebook? I have my facebook app, and my unity game, but not sure yet on how to put the two together.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image BerggreenDK · Nov 07, 2011 at 06:53 PM 0
Share

I think you need to go to this page and study a little. They have a lot of information about how you intergrate you own website/webpage with Facebook: http://developers.facebook.com/

avatar image
0

Answer by Dover8 · Nov 07, 2011 at 04:50 PM

Can I ask how you got your Unity game onto facebook? I have my unity game and my facebook app, just not sure on how to put the two together. Any help would be appreciated

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image BerggreenDK · Nov 07, 2011 at 06:54 PM 0
Share

I think you need to go to this page and study a little. They have a lot of information about how you intergrate you own website/webpage with Facebook: http://developers.facebook.com/

  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Facebook Unity SDK login permission request pop up for authorized user 0 Answers

Facebook/Gmail/Twitter Connection with Unity3D 1 Answer

Unity Facebook connect Iphone vs Web 0 Answers

Unity Facebook SDK For Android Crashes when Logged in 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges