I am having a issue with facebook login. I am using facebook sdk 4.3.6 and unity3d 4.3.0/4.3.1.
when I hit login button Facebook permission windows open and after pressing ok nothing happens and following message is printed in logs
" sending to Unity OnLoginComplete({"cancelled":true,"key_hash":"asdasd"}) "
FB.Login("email,publish_actions", LoginCallback);
and in
void LoginCallback(FBResult result)
{
login = result.Text; // output login=false, userid="", access_Token=""
}
Not sure what the above answer is...Why does JSON have to do with anything?
I am having the same problem...was using Facebook SDK 4.3.4 and was having the same problem.
I saw there was a new one up 4.3.6 and tried it...same problem.
I check LOGCAT and saw the same line:
sending to Unity OnLoginComplete({"cancelled":true,"key_hash":"4EbLC........0uFU1A="})
Which is NOT my has from my UNITY Facebook settings...I have no idea where it is getting this HASH from.
I am wondering if the "cancelled":true result is a result from the Facebook Dialog to allow permissions ..although I did not click CANCEL
I am going to try the only thing I haven't tried yet and that was a post from someone to get the latest OPENSLL and regen the keys...
SOLVED: OK Here is what I did to get it working....
I added that Hash that I got from the LOGCAT to the Facebook Develop App Settings on
develop.facebook.com/apps
Now it logs in me in...
I just don't know where that Hash is coming from...I also have the hash that was generated from Unity in there as well.
Ryan
Related
I am developing a facebook game in Unity3d using facebook's new facebook sdk, running the app as a web app inside facebook in sandbox mode.
Today I started implementing a shop in the game for microtransactions using their canvas pay model. I read their documentation and javascript tutorial for payments (they don't have one yet for unity) and created a simple button that when you click you are able to buy some ingame currency(coins).
Now my open graph og:product is tested and looks accurate and my c# code in unity is this:
public void onCoinsClicked()
{
FB.Canvas.Pay(
product: "my_url/products/coin.html",
action: "purchaseitem",
quantity: 1,
testCurrency:"EUR",
callback: delegate(FBResult response) {
FbDebug.Log("The result of the purchase is: " + response.Text);
});
FbDebug.Log("onCoinsClicked: ");
}
When i test it using a payments tester user that i have, it throws the following error when displaying the payment popup:
An error occurred. Please try again later.
API Error Code: 1383008
API Error Description: The app you're using isn't responding. Please try again. If you keep seeing this error, try again in a few hours.
If some of you kind people have experienced this before please enlighten me :)
Thank you.
Have you run your product's URL through the Open Graph Debugger (https://developers.facebook.com/tools/debug)? It's possible that a crawler error is causing the issue, and it would be good to make sure that the problem isn't at the data level.
hi i have unity3d and the latest facebook sdk
i've downloaded the sample project but i got a problem, when i start the project and click login, unity immediately show this images:
which i expecting i've got an error from this part of code in mainmenu.cs
if (FB.IsLoggedIn)
{
string panelText = "Welcome ";
if (GameStateManager.Username != null) panelText += GameStateManager.Username + "!";
else panelText += "Smasher!"; //I GOT THIS ELSE BLOCK !
if (GameStateManager.UserTexture != null)
GUI.DrawTexture( (new Rect(8,10, 150, 150)), GameStateManager.UserTexture);
GUI.Label( (new Rect(179 , 11, 287, 160)), panelText, MenuSkin.GetStyle("text_only"));
}
which is my gamestatemanager.username is null... i just want to know why my gamestatemanager.username is null, how to get some data to fill that.. i've followed step to fill gamestatemanager.username in this link where's my error btw ? anyone can help ?
Please see this question. Unity Facebook SDK Login Always Returns User 0 Access Token abc...z We don't support the editor or desktop yet. You will have to run on an ios or android device, or publish your app to facebook canvas.
I think you are having the same problem I am...
It seems it has logged you in but returns USerID:0 and Access Token: abcdefghijklmnopqrstuvwxyz
I think this is a TEST User that is automatically logs in but I can't seem to find out how to turn that off and to actually have it log ME on.
Is your APP in Sandbox mode? I tried turning my sandbox mode in the facebook app settings off but it didn't seem to effect it...
Waiting for an answer on this and my related question...
Unity Facebook SDK Login Always Returns User 0 Access Token abc...z
If you are running this from the EDITOR then the reason is the EDITOR does not actually log you in.
If you are running from the device...I am still working on that one (also getting the same result you are)
I'm following this tutorial "Facebook Login Flow for Android" (https://developers.facebook.com/docs/howtos/androidsdk/3.0/login-with-facebook/) to create a simple app containing only one facebook login button to test facebook login.
However, I've been having trouble logging in facebook with this button.... I've been following every step in this tutorial and I've double checked everything -- it is exactly the same as in this tutorial. I see other people who have similar problems are always because of incorrect debug hash code. But I've checked like a million times that I got the correct debug hash code. Some people say that if you wanna release an app, you need a release code. However, I'm not releasing my app -- I'm just testing it on an android device, so I guess I dont really need a release code to do that?
Also, I've checked that I've included my facebook application id for this app in the Android Manifest. So basically, everything I did was strictly following the tutorials on Facebook Developers.
I've seen some people suggesting to use the "keytool" in JDK 6 in stead of JDK 7. And I've checked that I actually did generate my debug hash code with the "keytool" in JDK 6.
So I've tried everything, but the problem still exists!
In that Android Tutorial, it suggests putting this in your code so that you can monitor your LogCat to see if your current state is logged in or logged out:
private void onSessionStateChange(Session session, SessionState state, Exception exception) {
if (state.isOpened()) {
Log.i(TAG, "Logged in...");
} else if (state.isClosed()) {
Log.i(TAG, "Logged out...");
}
}
In my case, no matter how many times I clicked Facebook Login Button, I always got "Logged out..." in my LogCat.
Also, the funny thing is, I can't even log in facebook using those sample apps coming with Facebook Android SDK 3.0.1 (eg. SessonLoginSample)!!!!! When I click the login button in those sample apps, nothing happens -- which means I'm not successfully logged in.
I really hope you guys out there can help me with this problem. It's weird I don't see other people with the exact same problem (as I said, those with similar problems are always because of incorrect debug code, but I've checked mine, it is 100% correct). THANK YOU SO MUCH!
It happened to me once. You might have added the export key hash in facebook developer setting.
Add these lines to your code to get your debugging key hash and then add to facebook.
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
I am trying to use the Grails Facebook Authentication plugin but am running into problem. I have (I believe) successfully installed the plugin, put a facebook connect control on a page, and ran the installation script.
When I click on the Facebook Connect button I am correctly brought to Facebook, where I login correctly. At this point the popup closes and nothing happens. I have a custom FacebookAuthService but no breakpoints inside ever get called. I believe I have either 1) hooked up the Service incorrectly or 2) hosed up my Facebook settings so that I am not getting the information back, but I am not sure how to diagnose the problem.
When I run the app locally, it runs on http://localhost:8080/TestApp
In my Facebook App Settings I have tried using "http://localhost", "http://localhost:8080", and "http://localhost:8080/TestApp" as the Site URL and I have "localhost" as the App Domain. What am I missing?
Here is a link to the GitHub Project (I've changed the fb private key).
Any ideas? Thanks.
Button authorize you only on client side, because of Facebook Javascript SDK. Please reload page after susseccful authization, like:
FB.getLoginStatus(function(response) {
if (typeof(response) == 'undefined') {
return
}
if (response.status == 'connected') {
window.location.reload();
}
})
The JS SDK does not currently have support for non-standard ports in this scenario, but come Tuesday, this will be corrected, and it will once again support it.
I know this might sound a very basic question but I am having an issue in using Facebook SDK for Blackberry. I have downloaded the latest one 0.8.25. I have imported them in my eclipse and they are present in the referenced libraries. I have a game app where I want the users to login using their facebook account. Which class contains the code for logging in? Are the jar files implementable or they are just for reference? I have read forums posts where users say that they executed Strawberry program but I can no where find any executable source code. Kindly please let me know how do I create a login page for BlackBerry using its SDK. I did go through another link of Sample Code here!
Let me know which class has login code or how do i use the SDK
At the very basic least, you need to get an instance of the Facebook object and call getCurrentUser(). So, for example:
String[] permissions = new String[] { Facebook.Permissions.ALL_PERMISSIONS };
Facebook fb = Facebook.getInstance(new ApplicationSettings(myNextUrl, myAppId, myAppSecret, permissions));
User fbUser = fb.getCurrentUser();
The code in the library will handle all of the details like getting the user to login to facebook account and accept the requested permissions and so on. You'll want to wrap that all in a try/except to catch FacebookException for error conditions (e.g. user refuses your request).