Facebook SDK 7.4.0 in Unity 5.3 Tutorial – Singletons, Inviting & Sharing
Home Forums Tutorial Support Facebook SDK 7.4.0 in Unity 5.3 Tutorial – Singletons, Inviting & Sharing
Tagged: unity
This topic contains 36 replies, has 28 voices, and was last updated by Jeniffer P 3 years, 10 months ago.
-
AuthorPosts
-
February 11, 2016 at 6:48 pm #656
The latest tutorial covers Sharing, inviting and the singleton pattern. I’m anticipating some of you may have questions regarding the GetAppLink part. Please ask any question about this tutorial in this thread.
Glenn
February 11, 2016 at 8:38 pm #660Hi there I have a problem when trying to share on facebook from my Android device. It loads the facebook dialog that allows me to share, and then it goes back to my unity app. It dosen’t allow me to click post or cancel, it just turns off the facebook app and goes back to my unity app. Any idea why is that happening?
February 11, 2016 at 10:54 pm #661That’s very weird. What permissions do you call on login? Are you running the most recent Unity, Facebook SDK, and your JDK and JRE environments are up-to-date?
February 12, 2016 at 6:18 pm #666Hi,
Nice tutorial, looking forward to seeing the update for scores.
Can you update the download files to reflect the code used in the video please.John
February 12, 2016 at 6:23 pm #667Hi John, welcome to the forums.
The files on the site should be as it was in the tutorial. I zipped them up right after I finished recording. Which part in particular isn’t the same? Is it to do with the GetAppLink part? I may have somehow managed to screw something up! haha
February 12, 2016 at 10:26 pm #668Hi Glenn,
Looks as if it was packaged at the point when it only had the two buttons Login and profile Pic, there are no share, invite buttons or code.
https://www.dropbox.com/s/bqym8t6xetmixpe/Screenshot%202016-02-12%2022.23.49.png?dl=0
John
February 12, 2016 at 10:29 pm #669Hey Glenn!
Thanks for uploading the tutorial! 🙂My question:
What do I need to modify if let’s say my Share, Invite, and Challenge buttons are on a different scene and not on the same scene as the Login?
#SorryImaNoobFebruary 13, 2016 at 10:53 am #673@john Wheeler:
Interesting, not sure what happened but it does appear from your screenshot that that would be the download for the first tutorial. Sorry about that, thanks for mentioning it though. I’ve repackaged it and reuploaded the correct one this time. It’s updated on the tutorial page and I’ll also include it here too for your convenience:
@Patrick CJ Medina:
Hi Patrick, your welcome for the tutorial!
Well the beauty of using the singleton method now is that the share, invite and challenge functionality can be called from any scene in your app.
If you’re on a different scene from the one where your user logs in, then you would need to give that scene an empty game object and attach a new script to it. In that script create a public function that calls the share function from the singleton. for example:
public void Share()
{
FacebookManager.Instance.Share();
}Then in your new scene select your button then attach an onclick event. Drag in the empty gameobject which contains the script with the function which I described above. Then in the dropdown for the button function to trigger on click, select the script and then the share() function. Now when you click on that button it will call the share function from your FacebookManager singleton. Of course you would probably want to show or hide that button based on if the user is logged in or not. So you would create a similar DealWithFBMenus function in your scene script which checks if FB.IsLoggedIn == true, then show the share button. Call DealWithFBMenus on Awake in that scene.
February 13, 2016 at 1:21 pm #674Hi Glen,
Thanks for the updated files.
Check out the new Friends Smash Unity Example, it has been updated SDK 7 and does show the users profile picture running on IOS, although the leaderboard pictures do not show.
It also uses a singleton as the main file.
John
-
This reply was modified 4 years, 11 months ago by
John Wheeler.
-
This reply was modified 4 years, 11 months ago by
John Wheeler.
February 16, 2016 at 10:22 am #677Hi, I am facing a weird bug, everything works fine during Debug but after build I think either GameObject is not loading or script is not running. I am sure its either of these as I have checked through creating a button using GUI and the button is there during Debug but after Build that GUI button is not visible.
Any idea what might have gone wrong?
February 20, 2016 at 9:05 am #682Hey!
Great work on the tutorial Glen! I am stuck on a problem and cant find any solution to it. What i am trying to do is i want to send a gift like a “fuel tank” in a racing game to a friend on facebook through my android app. I am able to send just simple game requests uptil now but unable to send gifts. Moreover, when a gift is sent, i need to check if the other user accepts my gift or not. If he accepts it, i should be able to trace it.
Can you please help me out?
Regards.March 3, 2016 at 2:06 pm #689hi,I did not understand what I have to insert instead of FB.GetAppLink (DealWithAppLink);
you can enter the right code?
March 5, 2016 at 6:04 pm #692Hello Glen,
Really like your videos, they are really helpful!
I created a fully working scores API with the Facebook SDK 7.4.0 with the help of the above code and the other tutorials found on greyzoned.
Though on Android when I login to Facebook or try to upload a new score, the game stops and the user can’t do anything until the action is done, and this icon shows up (working/loading icon)http://puu.sh/nvPVp/35e2c345be.png
The question is: Is there a way to login and upload the scores to Facebook in the background? without interrupting the user.
Elie
March 12, 2016 at 6:04 pm #700Great tutorial, thanks! But i have a question. Is possible to figure out how many friends player invited?
For example, with AppRequest() you can figure out numer of sended requests by some code like this, but sadly you can only request already playing members, what is unuseful for me…public void Request() { FB.AppRequest ( "text!", null, null, null, null, null, null, delegate (IAppRequestResult result) { if (result.Error == null) { object value; if (result.ResultDictionary.TryGetValue("to", out value)) { string omg = value.ToString(); List<string> wtf = omg.Split(',').ToList(); Debug.Log("Number of sended requests: " + wtf.Count()); } } } ); }
Is possible to do something like that with FB.Mobile.AppInvite?
And sorry for my english.March 22, 2016 at 8:26 pm #706kindly can any body tell me how to know that a user have installed the app on our app invite? I want to reward the 100 points on each install through app invite.
-
This reply was modified 4 years, 11 months ago by
-
AuthorPosts
You must be logged in to reply to this topic.