What are the app settings (in Facebook developers I think)f or FacebookConnect to work together with PhoneGap Build?
I followed all the instructions, but the app is still not able to connect with Facebook
I followed all the instructions, but the app is still not able to connect with Facebook
- 11 Posts
- 2 Reply Likes
Posted 7 years ago
- 1206 Posts
- 42 Reply Likes
Hi Ricca,
Have you look into the phonegap build supported plugin with they instructions on how to implement facebookConnect, if yes, kindly let us know the steps you have taken so far. Also do let us know your testing device..
Thanks
Hyginus
Have you look into the phonegap build supported plugin with they instructions on how to implement facebookConnect, if yes, kindly let us know the steps you have taken so far. Also do let us know your testing device..
Thanks
Hyginus
- 11 Posts
- 2 Reply Likes
Hi Hyginus,
and thank you for your fast reply.
Yes, I have followed all the instructions in the "FacebookConnect" part of the link you sent.
Moreover, in index.html I have added:
script src="cdv-plugin-fb-connect.js">
script src="facebook_js_sdk.js">
script src="phonegap.js">
And I also have the script that Initialize the FB SDK (as in Facebook API documentation )
[the syntax is correct, I modified here otherwise it is not shown]
Furthermore, my config.xml looks like:
?xml version="1.0" encoding="UTF-8"?>
widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.example.myapp"
version = "0.1.1">
name>App name/name>
description>
An Amazing app
/description>
feature name="http://api.phonegap.com/1.0/device" />
feature name="http://api.phonegap.com/1.0/network" />
preference name="android-minSdkVersion" value="7" />
preference name="android-installLocation" value="auto" />
preference name="load-url-timeout" value="15000" />
access origin="http://127.0.0.1*"/>
gap:plugin name="FacebookConnect">
param name="APP_ID" value="here I have myFBappID number" />
/gap:plugin>
/widget>
Under FB developers, app section, I have the following setup:
- standard settings under "basic"
- under "advance" I have Native/desktop as App Type. If I change it to Web, my problem persists.
I have hydration on.
Development is under Eclipse and the test device is Samsung Galaxy S Advance with original Android 2.3.6.
When I try to login into FB, I get NameApp "is misconfigured for Facebook login" Press okay to go back etc.. At some point I got that the android_key_not_configured error. So I added key hash into FB app and 'Facebook login' enabled (and the package name and class name). However, under 'Website with Facebook Login' I don't know which url to add, since it is a mobile app. I also tried to have Facebook login off, but nothing changed.
I then get the same error. I also got that my key "......" does not match the allowed keys specified in your application. I then changed the key promted and substituted into facebook app hash key. But still it does not work.
If I run this application from my Eclipse environment, the facebook plugin works.
Thanks a lot for your help!
and thank you for your fast reply.
Yes, I have followed all the instructions in the "FacebookConnect" part of the link you sent.
Moreover, in index.html I have added:
script src="cdv-plugin-fb-connect.js">
script src="facebook_js_sdk.js">
script src="phonegap.js">
And I also have the script that Initialize the FB SDK (as in Facebook API documentation )
[the syntax is correct, I modified here otherwise it is not shown]
Furthermore, my config.xml looks like:
?xml version="1.0" encoding="UTF-8"?>
widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.example.myapp"
version = "0.1.1">
name>App name/name>
description>
An Amazing app
/description>
feature name="http://api.phonegap.com/1.0/device" />
feature name="http://api.phonegap.com/1.0/network" />
preference name="android-minSdkVersion" value="7" />
preference name="android-installLocation" value="auto" />
preference name="load-url-timeout" value="15000" />
access origin="http://127.0.0.1*"/>
gap:plugin name="FacebookConnect">
param name="APP_ID" value="here I have myFBappID number" />
/gap:plugin>
/widget>
Under FB developers, app section, I have the following setup:
- standard settings under "basic"
- under "advance" I have Native/desktop as App Type. If I change it to Web, my problem persists.
I have hydration on.
Development is under Eclipse and the test device is Samsung Galaxy S Advance with original Android 2.3.6.
When I try to login into FB, I get NameApp "is misconfigured for Facebook login" Press okay to go back etc.. At some point I got that the android_key_not_configured error. So I added key hash into FB app and 'Facebook login' enabled (and the package name and class name). However, under 'Website with Facebook Login' I don't know which url to add, since it is a mobile app. I also tried to have Facebook login off, but nothing changed.
I then get the same error. I also got that my key "......" does not match the allowed keys specified in your application. I then changed the key promted and substituted into facebook app hash key. But still it does not work.
If I run this application from my Eclipse environment, the facebook plugin works.
Thanks a lot for your help!
- 11 Posts
- 2 Reply Likes
- 91 Posts
- 1 Reply Like
Look into my profile /search for my posts, there are several issues and hints concerning FB connect. This maybe helpls...
I have also added some link on my blog: http://pjsdev.blogspot.de/2013/02/pho...
I have also added some link on my blog: http://pjsdev.blogspot.de/2013/02/pho...
- 37 Posts
- 5 Reply Likes
Guys, I have the same problem. It did not work for me on desktop Eclipse/Android compilation as well, so I switched to PhoneGap Build. I use hackbook as a base, so that I know the code is not a problem.
- 37 Posts
- 5 Reply Likes
Jens, an excellent collection of relevant links.
What is not clear to me if that solved your login problems or not
What is not clear to me if that solved your login problems or not
- 91 Posts
- 1 Reply Like
It works on Android perfectly also via build service. But not n iOs as there as some issues, see again the blog, I updated some links...
- 37 Posts
- 5 Reply Likes
ricca,
Good news, there is at least one thing wrong with your code fixing which might help.
As per
https://build.phonegap.com/docs/plugi...
facebook_js_sdk.js is a wrong name.
facebook-js-sdk.js is the right name.
I have the same problem. I tried (and failed) to compile on my workstation. The FB SDK comes with facebook_js_sdk.js, as of 3.0.0. The just updated version 3.0.1 has it under facebook-js-sdk.js, so the situation is improving.
The bad news, this change did not help me.
The Simple application that comes with the plugin on github
https://github.com/phonegap/phonegap-...
that I try to compile on PhoneGap build, still fails logging in on my Google Nexus 4, Android 4.2, screen citing an error, while logcat (that I run on my remote debugging rig) is not helpful as to the source of the problem.
I am banging my head against this wall and once the wall gives in, I'll put my code on github somewhere
Good news, there is at least one thing wrong with your code fixing which might help.
As per
https://build.phonegap.com/docs/plugi...
facebook_js_sdk.js is a wrong name.
facebook-js-sdk.js is the right name.
I have the same problem. I tried (and failed) to compile on my workstation. The FB SDK comes with facebook_js_sdk.js, as of 3.0.0. The just updated version 3.0.1 has it under facebook-js-sdk.js, so the situation is improving.
The bad news, this change did not help me.
The Simple application that comes with the plugin on github
https://github.com/phonegap/phonegap-...
that I try to compile on PhoneGap build, still fails logging in on my Google Nexus 4, Android 4.2, screen citing an error, while logcat (that I run on my remote debugging rig) is not helpful as to the source of the problem.
I am banging my head against this wall and once the wall gives in, I'll put my code on github somewhere
- 11 Posts
- 2 Reply Likes
Jens, thank you for the link. I looked into them, but my problem persists.
Michael, thank you for the syntax error, but that seems not to solve anything though...
Any Phonegap employee that can guide in solving this problem to us?
Michael, thank you for the syntax error, but that seems not to solve anything though...
Any Phonegap employee that can guide in solving this problem to us?
- 37 Posts
- 5 Reply Likes
ricca, let me know if you are not done with the thing. You are right there are probalby more than one thing that ails your code and configuration.
By now I guess I stumbled on every trap alone the way so I guess I can help
By now I guess I stumbled on every trap alone the way so I guess I can help
- 37 Posts
- 5 Reply Likes
well, old syntax would result in fb js not being included and inability to login would result in FB object not being recognized by the JS engine. So fixing it does advance us somewhere :)
Antother thing to try:
explicitly mention phonegap version 2.2. I guess the default would be the latest 2.3 and therefore fb connect will not work properly
Antother thing to try:
explicitly mention phonegap version 2.2. I guess the default would be the latest 2.3 and therefore fb connect will not work properly
- 11 Posts
- 2 Reply Likes
- 11 Posts
- 2 Reply Likes
To sum up, now when I try to login into FB, I get NameofMyApp "is misconfigured for Facebook login. Press Okay to go back to the application without connecting it to Facebook".
I press OK, then I get:
Alert
"Cordova Facebook Connect plugin fail on login!Facebook error: invalid_key:Android key mismatch. Your key "AWi...." does not match the allowed keys specified in your application settings"
This key "AWi..." is not mine, the one I generated with keytool and that I later specified in FB app is different. So what is this key? Phonegap Build generate it?
However, if I take the key that the Alert shows me, I put it into FB app settings, it still does not work.
I press OK, then I get:
Alert
"Cordova Facebook Connect plugin fail on login!Facebook error: invalid_key:Android key mismatch. Your key "AWi...." does not match the allowed keys specified in your application settings"
This key "AWi..." is not mine, the one I generated with keytool and that I later specified in FB app is different. So what is this key? Phonegap Build generate it?
However, if I take the key that the Alert shows me, I put it into FB app settings, it still does not work.
- 37 Posts
- 5 Reply Likes
Good catch. I did not know what the reported error was.
Over the lunch I was thinking the same thing. How does PGB server knows my key. It does not. I wonder if we can post-process the resulting APK file , but even if we could, it would defy the purpose of PGB, being an easy universal solution.
I guess they should add the key to confix.xml
What you say about copying PGB key into FB and it not working is troublesome.
What do you think, is this a time to give up and get back to my Android compilation setup?
Over the lunch I was thinking the same thing. How does PGB server knows my key. It does not. I wonder if we can post-process the resulting APK file , but even if we could, it would defy the purpose of PGB, being an easy universal solution.
I guess they should add the key to confix.xml
What you say about copying PGB key into FB and it not working is troublesome.
What do you think, is this a time to give up and get back to my Android compilation setup?
- 37 Posts
- 5 Reply Likes
May be the best way forward at this point is to share a simple project (e.g. mine) that is based on facebook connect plugin example called Simple, and ask PG or plugin team members to fix whatever ails it, and publish as a PGB+FBCP sample.
What do you think?
What do you think?
- 37 Posts
- 5 Reply Likes
ricca, one another question to you, what do you use for the widget id in the config.xml?
How does it correspond to FB app "Package Name" and "Class Name" ?
I asked this question to the forum, but you already figured it out, right?
http://community.phonegap.com/nitobi/...
How does it correspond to FB app "Package Name" and "Class Name" ?
I asked this question to the forum, but you already figured it out, right?
http://community.phonegap.com/nitobi/...
- 37 Posts
- 5 Reply Likes
Jens Peters, can you share your sample app? We are lost.
After baksmali of PG APK I am sure I set the package name and class name that Facebook requests correctly.
I am out of possible options, short of key hash incompatibility, but that was troubleshooted by ricca, in vain.
After baksmali of PG APK I am sure I set the package name and class name that Facebook requests correctly.
I am out of possible options, short of key hash incompatibility, but that was troubleshooted by ricca, in vain.
- 91 Posts
- 1 Reply Like
Yeah for sure, will now write a quick blog entry and link it :-) Giving just a couple of minutes...
- 91 Posts
- 1 Reply Like
Status: currently writing, but with interuption of my little son. But he will go to bed soon and the article will come this evening ;)
- 37 Posts
- 5 Reply Likes
Sweet. I have 2 girls but they were at the Zoo that is how I got good 6 hours to crack the phonegap build thing.
- 37 Posts
- 5 Reply Likes
Status: Tomorrow (It is late evening in my part of the woods) I'll publish on github a sample based on facebook connect Simple app, adapted to PhoneGap Build. I shall create a dummy facebook app, and share the screenshot of its settings.
With God's and Jens Peters help resolving all the build issues, this sample will save people lots of near-suicidal frustration I experienced today.
With God's and Jens Peters help resolving all the build issues, this sample will save people lots of near-suicidal frustration I experienced today.
- 91 Posts
- 1 Reply Like
Thank you for tip of the head! But I am only try to pass back something because of many other blog authors and board activists helped me in the past, too!
- 11 Posts
- 2 Reply Likes
Thanks Michael and Jens, that's great idea.
Jens, package name and class name are setup in the facebook app section. in package name I have com.example.myapp (as in the config.xml above) and class name I have com.example.myapp.MainActivity
Jens, package name and class name are setup in the facebook app section. in package name I have com.example.myapp (as in the config.xml above) and class name I have com.example.myapp.MainActivity
- 91 Posts
- 1 Reply Like
Seams to be correct for my. I do not know if the prefix "Main" may cause problems. But mybe my blog helps.
- 37 Posts
- 5 Reply Likes
Guys, I have downloaded, disassembled PhoneGap Build's created APK.
If you need instructions on how to do it, LMK.
Here goes.
Facebook's Class Name is **exactly** what you put in the tag in config.xml
Facebook's Package name is what you put in the widget id attribute as com.companyname.productname.
If you need instructions on how to do it, LMK.
Here goes.
Facebook's Class Name is **exactly** what you put in the tag in config.xml
Facebook's Package name is what you put in the widget id attribute as com.companyname.productname.
- 37 Posts
- 5 Reply Likes
One more thing, I dont know what would happen if what you put in name has white space in it. I would guess Build would merely remove whitespace, and it is easy to check, but I don't have time for it. Unless either of you thinks it is critical
- 91 Posts
- 1 Reply Like
Sorry for being late, saturday means family day:
http://pjsdev.blogspot.de/2013/03/pho...
Maybe this helps someone, if yes a comment or like, on my very young blog would be very very nice.
Or even nicer if someone can help me getPicture and FileTransfer working again on iOs: http://community.phonegap.com/nitobi/...
http://pjsdev.blogspot.de/2013/03/pho...
Maybe this helps someone, if yes a comment or like, on my very young blog would be very very nice.
Or even nicer if someone can help me getPicture and FileTransfer working again on iOs: http://community.phonegap.com/nitobi/...
- 37 Posts
- 5 Reply Likes
Well, someone is doing us all a favor and says sorry for being late doing so... oh my.
Going through your blog.
Will report results later.
If you don't mind, one observation, regarding capitalization in names.
PhoneGap, not Phonegap.
jQuery, not JQuery
I myself don't like companies making capitalization part of the brand, but since they do, and readers expect that, I don't see much choice :)
Going through your blog.
Will report results later.
If you don't mind, one observation, regarding capitalization in names.
PhoneGap, not Phonegap.
jQuery, not JQuery
I myself don't like companies making capitalization part of the brand, but since they do, and readers expect that, I don't see much choice :)
- 37 Posts
- 5 Reply Likes
Ok, I am finally done.
The last problem was certificates.
What an adventure that was.
If you don't use key hash, PGB generates their own debug process key, but you don't know what it is unless you, like Jens describes in his blog, stumble upon error that quotes their key hash, and then you put it into your FB app.
That is definitely not the way to do it.
If you upload your own debug keystore, it does not help, because the fact of uploading something triggers their release built. And release bulid does not recognize debug keystore, so you end up with an invalid APK
The only way to go is to create your own release certificate, upload it to FGB, make a release APK, and use it. Not to forget putting release key hash into your FB app profile.
The problem with that is that the release APK seems not to be debuggable. If you were compiling it on your own ADT rig, you'd use in the AndroidManifest.xml the debuggable attribue of the application tag. But FGB hides that from you, for good or bad, and you have no say in this matter
I thought of triggering an error and learn FGB's key hash, but I afraid that they would end up having more than one server each with its own debug.keystore. The whole thing is a house of cards enough to want to add up a hack like that on top of it.
Ideally, either FGB would publish their own key hash, or recognize uplaoded debug.keystore by a known alias.
This seems to be the situation. Take me with a grain of salt because I was so tired over the whole thing that I could have missed a detail or two. I would be grateful to any independent verification of what I wrote here.
The last problem was certificates.
What an adventure that was.
If you don't use key hash, PGB generates their own debug process key, but you don't know what it is unless you, like Jens describes in his blog, stumble upon error that quotes their key hash, and then you put it into your FB app.
That is definitely not the way to do it.
If you upload your own debug keystore, it does not help, because the fact of uploading something triggers their release built. And release bulid does not recognize debug keystore, so you end up with an invalid APK
The only way to go is to create your own release certificate, upload it to FGB, make a release APK, and use it. Not to forget putting release key hash into your FB app profile.
The problem with that is that the release APK seems not to be debuggable. If you were compiling it on your own ADT rig, you'd use in the AndroidManifest.xml the debuggable attribue of the application tag. But FGB hides that from you, for good or bad, and you have no say in this matter
I thought of triggering an error and learn FGB's key hash, but I afraid that they would end up having more than one server each with its own debug.keystore. The whole thing is a house of cards enough to want to add up a hack like that on top of it.
Ideally, either FGB would publish their own key hash, or recognize uplaoded debug.keystore by a known alias.
This seems to be the situation. Take me with a grain of salt because I was so tired over the whole thing that I could have missed a detail or two. I would be grateful to any independent verification of what I wrote here.
- 11 Posts
- 2 Reply Likes
Thanks! finally something seems to work. I will follow your steps with the keystore and let you know!
- 37 Posts
- 5 Reply Likes
Ah, another interesting tidbit, that even my friend Jens probably does not know about is that APK contains not one but 3 !!!! phonegap js files
cordova.js
cordova-2.2.js
phonegap.js
All are identical :)
That is because they don't trust you follow their written instructions and put phonegap.js inclusion in your HTML file :)
I am actually happy for them to try being fool proof.
Now I hope this attitude expand to other areas such as recognizing debug keystore upload
I would also love seing online documentation updated. The screens for keystore upload are different from the current functionality (where you dont put passwords but use them to unlock uploaded keystore). Functionality advanced (great) but documentation lags behind (not great)
cordova.js
cordova-2.2.js
phonegap.js
All are identical :)
That is because they don't trust you follow their written instructions and put phonegap.js inclusion in your HTML file :)
I am actually happy for them to try being fool proof.
Now I hope this attitude expand to other areas such as recognizing debug keystore upload
I would also love seing online documentation updated. The screens for keystore upload are different from the current functionality (where you dont put passwords but use them to unlock uploaded keystore). Functionality advanced (great) but documentation lags behind (not great)
- 91 Posts
- 1 Reply Like
Hey very cool information that explains why in the past my "wrong" uploaded code worked ;) containing cordova,js instead of phonegap.js ;)
But even nicer to me are the detailed remarks you added concerning androids hask keys :-)
But even nicer to me are the detailed remarks you added concerning androids hask keys :-)
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers





Michael Kariv
Ricca's problem was, as of 5 hours ago, reportedly resolved. He was aided by Jens and I. We both learned a lot through some experimentation, reading a lot of other people blogs and StackOverflow articles.
I am glad to conclude that this community supported one of its members in this case. I am new to this community, and happy to find it supportive, and take part in providing the mutual support.
I however feel far from wanting to uncork a champagne. I am burdened with a concern that I want to share with you, and with the community.
In the past 12 days I observed zero participation from either you or other employees of PhoneGap Build. You response to the problem looks like a boilerplate text. Ricca immediately replied to your questions. Since then there was a perfectly maintained radio-silence from the PhoneGap team.The white-green slogan above saying "PhoneGap Build employees are here to help" in at least this single instance appears to be, well, just a slogan without substance.
PhoneGap is a good technology. PhoneGap Build is, in my view, a step in the right direction. For both I am sincerely grateful. I understand your team might be small, and with the fast pace of the technological development, you support efforts might be spread thin.
So all it takes is to be frank about what you can and can not do to help. If PhoneGap support team was upfront about it, I would not begrudge what is going on. It is harmful promising help and not delivering any. It erodes the goodwill.
As I said, I am new here. I might be jumping to conclusions. I might be rush in my judgement. I am looking for every possible excuse in your/your team favor. Please tell me my concern is baseless, that I am wrong. But do tell me why I am wrong.