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
- 4 Posts
- 0 Reply Likes
Hi everybody,
I too am struggling with this plugin - it seems so close, but the iOS version is obviously buggy.. I am under pressure now to fix it since Facebook changed something again and broke our other (http) method for doing this.
I followed everything here, and testing on real devices, but there got to be something more to discover - I am hopeful that together we can figure this out :-)
I was able to compile my app using Phonegap Build with the FacebookConnect plugin.
The android app works great with FacebookConnect.
On iOS, it seemed to work fine at first, I was able to login using facebook in my app by both getting the login dialog and when i'm already logged in to facebook on the phone.
Now we realized (without changing the code), that the iOs plugin does give the famous error sometimes - "the operation couldn't be completed. (com.facebook.sdk error 2.)". And some other times not!! (maybe issues with delays, race conditions??)
Also, trying with different facebook accounts, it seems that some users get different errors depending if they are set as *admin* in the Facebook app control panel.
One problem we we get sometimes is only when you are logging by entering your password in the dialog in the plugin. It says "Logging in..,." and just hands there to infinity!!!!
This should be something that can be debugged somehow by the makers of the plugin.. Is there any way for us to debug this?
This is for an app that does have the FacebookConnect working when I login using my actual Facebook app on the phone, then click to login in my app using the plugin. Then the login happens without the dialog, and it goes back to my app, and it works fine! So I don't know what is different when we see the dialog.
Hope this can help shed some more light, and thanks for everybody working on this,
eyal
I too am struggling with this plugin - it seems so close, but the iOS version is obviously buggy.. I am under pressure now to fix it since Facebook changed something again and broke our other (http) method for doing this.
I followed everything here, and testing on real devices, but there got to be something more to discover - I am hopeful that together we can figure this out :-)
I was able to compile my app using Phonegap Build with the FacebookConnect plugin.
The android app works great with FacebookConnect.
On iOS, it seemed to work fine at first, I was able to login using facebook in my app by both getting the login dialog and when i'm already logged in to facebook on the phone.
Now we realized (without changing the code), that the iOs plugin does give the famous error sometimes - "the operation couldn't be completed. (com.facebook.sdk error 2.)". And some other times not!! (maybe issues with delays, race conditions??)
Also, trying with different facebook accounts, it seems that some users get different errors depending if they are set as *admin* in the Facebook app control panel.
One problem we we get sometimes is only when you are logging by entering your password in the dialog in the plugin. It says "Logging in..,." and just hands there to infinity!!!!
This should be something that can be debugged somehow by the makers of the plugin.. Is there any way for us to debug this?
This is for an app that does have the FacebookConnect working when I login using my actual Facebook app on the phone, then click to login in my app using the plugin. Then the login happens without the dialog, and it goes back to my app, and it works fine! So I don't know what is different when we see the dialog.
Hope this can help shed some more light, and thanks for everybody working on this,
eyal
- 37 Posts
- 5 Reply Likes
Eyal,
I am focused on Android as of this moment.
I shall turn my attention to iPhone in about a week. My primary motivation will be to help Jens who enormously helped me figuring out android.
If you can wait that long, great. If you can't, one of the things I would try is making sure you use 2.2.0 and not the default 2.3 of the PGB.
Another question, don't knwo about PhoneGap but web apps when run in mobile safari are remotely debuggable over USB from Mountain Lion Safari 6.
If you have the setup, research how to remote debug your PGB built. If you can do that, it is more than half of the way to the victory
I am focused on Android as of this moment.
I shall turn my attention to iPhone in about a week. My primary motivation will be to help Jens who enormously helped me figuring out android.
If you can wait that long, great. If you can't, one of the things I would try is making sure you use 2.2.0 and not the default 2.3 of the PGB.
Another question, don't knwo about PhoneGap but web apps when run in mobile safari are remotely debuggable over USB from Mountain Lion Safari 6.
If you have the setup, research how to remote debug your PGB built. If you can do that, it is more than half of the way to the victory
- 37 Posts
- 5 Reply Likes
One another thing, if it looks like race, and Android is any indication, make sure your phonegap loads before your fb does.
I had this race for a while in my android.
The way I solved it was to use jQuery deferred.
I find jQuery deferred to be a very useful tool.
So I release release an appropriate deferred from handlers indicating loads of different libraries.
for FB the handler is defined by the FB, you have no say how it is called:
function fbAsyncInit() {...}
for PG it is your own defined handler, e.g.
document.addEventListener('deviceready', MK.Init.phoneGapDeviceReady);
where MK is my own global namespace, and MK.Init is my singleton for all initializations.
MK.Init.phoneGapDeviceReady = function () {
console.info("MK.Init.phoneGapDeviceReady:");
SL.Init.deferredModules.pg_device.resolve();
};
Notice that I have an hash (aka js object) that holds all my deferreds.
I am behind on my promise to release a sample app, and that app will not have this code, because it is based on Facebook plugin own "Sample" app. But may be I'll hack another sample to address different modules loading sequences.
I had this race for a while in my android.
The way I solved it was to use jQuery deferred.
I find jQuery deferred to be a very useful tool.
So I release release an appropriate deferred from handlers indicating loads of different libraries.
for FB the handler is defined by the FB, you have no say how it is called:
function fbAsyncInit() {...}
for PG it is your own defined handler, e.g.
document.addEventListener('deviceready', MK.Init.phoneGapDeviceReady);
where MK is my own global namespace, and MK.Init is my singleton for all initializations.
MK.Init.phoneGapDeviceReady = function () {
console.info("MK.Init.phoneGapDeviceReady:");
SL.Init.deferredModules.pg_device.resolve();
};
Notice that I have an hash (aka js object) that holds all my deferreds.
I am behind on my promise to release a sample app, and that app will not have this code, because it is based on Facebook plugin own "Sample" app. But may be I'll hack another sample to address different modules loading sequences.
- 11 Posts
- 2 Reply Likes
Hi, could you describe in more details how you deferred the FB login after the phonegap? And moreover, how do I know when the FB is loaded? (and therefore I can fire my functions) Thanks!
- 91 Posts
- 1 Reply Like
Did you check my blog? Otherwise if not using jQueryMobile you can use http://docs.phonegap.com/en/2.3.0/cor.... I do not know if the FB is send and event after fully loaded. But it do write to the console, this may a point to start investigation...
- 37 Posts
- 5 Reply Likes
ricca, deferreds are a features of jQuery. It is a very useful concept, and a good implementation. It was introduced long enough to be quite robust. It would be presumptious of me to try to explain it in the space allowed for simple comments. You need to go to the source and read jQuery docs.
regarding of how you know if Facebook loaded, it is simple. There is a function you must define.
function fbAsyncInit() {...}
You must use this exact name.
So once Facebook is loaded, it will call this function.
regarding of how you know if Facebook loaded, it is simple. There is a function you must define.
function fbAsyncInit() {...}
You must use this exact name.
So once Facebook is loaded, it will call this function.
- 4 Posts
- 0 Reply Likes
Thanks Michael,
Still trying to get this plugin to work, but meanwhile I'll have to switch back to the http method. The problem is that Facebook changed things and broke my code there too, that used to work just few weeks ago..
I wonder if the plugin can be switched to use http dialogs? it says in the phonegap docs that it can do that.
This plugin is supposed to be the official Facebook plugin for PhoneGap Build, so hopefully it will get more robust soon..
It's probably just a matter of discovering+documenting all the scenarios.
This will make the whole phonegap platform more valuable for everybody,
eyal
Still trying to get this plugin to work, but meanwhile I'll have to switch back to the http method. The problem is that Facebook changed things and broke my code there too, that used to work just few weeks ago..
I wonder if the plugin can be switched to use http dialogs? it says in the phonegap docs that it can do that.
This plugin is supposed to be the official Facebook plugin for PhoneGap Build, so hopefully it will get more robust soon..
It's probably just a matter of discovering+documenting all the scenarios.
This will make the whole phonegap platform more valuable for everybody,
eyal
- 37 Posts
- 5 Reply Likes
Eyal, not clear what you mean by switching to http. Regardless, I agree FB changes things often, sometimes breaking things in the process and sometimes without advertising the chagnes much. I am wresting with their SPDY implementation right now.
Can you please explain what is "http dialog". I am not sure about the concept. http is a protocol, how can it have dialogs? I am sure it is a alias for something, just dont know what exactly.
You are in error claiming the plugin being Facebook's official. For one, it does not come from Facebook. So at least in this, Facebook is in the clear. That point aside, I agree the documentation has some room for improvement.
Being in a startup mode myself, I can sympathize when startup has gaps in documentation, given their lack of resources. Not sure about a large company like Adobe. The explaination I have for myself is that PhoneGap is a side project for them, not that important. I might be wrong, of cause.
On the brighter side, they maintain this forum, where we can collectively add the missing parts.
I would rather have this conversation on StackOverflow, like Facebook themselves encourage us to, but hey better here than nowhere.
Can you please explain what is "http dialog". I am not sure about the concept. http is a protocol, how can it have dialogs? I am sure it is a alias for something, just dont know what exactly.
You are in error claiming the plugin being Facebook's official. For one, it does not come from Facebook. So at least in this, Facebook is in the clear. That point aside, I agree the documentation has some room for improvement.
Being in a startup mode myself, I can sympathize when startup has gaps in documentation, given their lack of resources. Not sure about a large company like Adobe. The explaination I have for myself is that PhoneGap is a side project for them, not that important. I might be wrong, of cause.
On the brighter side, they maintain this forum, where we can collectively add the missing parts.
I would rather have this conversation on StackOverflow, like Facebook themselves encourage us to, but hey better here than nowhere.
- 37 Posts
- 5 Reply Likes
By the way, for another consulting project I am looking into ebooks solutions right now. And I am excited. It is so easy to write a markdown text on a topic, one two three it is an iPad and Kindle book.
I seriously consider writing a short book (long article may be, but they don't distinguish between the two) in the spirit of this thread. That is if Jens agrees to co-author :)
I seriously consider writing a short book (long article may be, but they don't distinguish between the two) in the spirit of this thread. That is if Jens agrees to co-author :)
- 11 Posts
- 2 Reply Likes
- 37 Posts
- 5 Reply Likes
ricca, others
Inspired by the dire state of affairs in the PhoneGap Build and Facebook Connect, I am writing an ebook on the subject. It will be short,and practical. Jens agreed to join in as a co-author.
Will you want/be able to proofread it once we have it done?
Inspired by the dire state of affairs in the PhoneGap Build and Facebook Connect, I am writing an ebook on the subject. It will be short,and practical. Jens agreed to join in as a co-author.
Will you want/be able to proofread it once we have it done?
- 11 Posts
- 2 Reply Likes
- 37 Posts
- 5 Reply Likes
ricca, can you please contact me via email? it is phonegap [at] tapuzine dot com
Jens and I are almost ready, we want to send you a draft
Jens and I are almost ready, we want to send you a draft
- 2 Posts
- 0 Reply Likes
I have the problem with Android Hash key invalid
The facebook say like this
http://www.here-i-am.tv/on-android-ap...
but I already added that key to my facebook
http://www.here-i-am.tv/on-fb-app.jpg
It still say error the same . I had check many time with this problem
The facebook say like this
http://www.here-i-am.tv/on-android-ap...
but I already added that key to my facebook
http://www.here-i-am.tv/on-fb-app.jpg
It still say error the same . I had check many time with this problem
- 37 Posts
- 5 Reply Likes
Halo, you seem to add the key twice :)
Did you create a keystore and key in it, and upload the keystore to PGB? Is alias right? You see, you must have uploaded it to compile in release mode
That is the only way if you wnat to use PGB and facebook connect together.
Did you create a keystore and key in it, and upload the keystore to PGB? Is alias right? You see, you must have uploaded it to compile in release mode
That is the only way if you wnat to use PGB and facebook connect together.
- 37 Posts
- 5 Reply Likes
All, Jens and I are finishing the ebook (small one) on the subject. We need proofreaders. Volunteers please email me
phonegap.ebook at gmail.com
phonegap.ebook at gmail.com
- 21 Posts
- 0 Reply Likes
Waking up this old thread...
I'm trying to figure out what key to provide to facebook for PGB debug APK.
Is there any way (other than stumbling on the error) to get that key?
If not, can I upload my own key and build debug APK's with it?
Thanks
Yaron
I'm trying to figure out what key to provide to facebook for PGB debug APK.
Is there any way (other than stumbling on the error) to get that key?
If not, can I upload my own key and build debug APK's with it?
Thanks
Yaron
- 4116 Posts
- 192 Reply Likes
Hi Yaron,
Feel free to ask if you don't understand anything.
- You will need to go to Facebook Developer Page to register the app first.
- That gives you the app id you need.
- Now add the app id to your config.xml for the plugin.
Feel free to ask if you don't understand anything.
- 21 Posts
- 0 Reply Likes
This really doesn't answer my question in an way.
I know I need an FB app ID. I (yand this thread in general) was asking about the android key which is something different.
Specifically about the key that Phonegap Build uses to sign Android APKs in debug mode. Is there anywhere we can get the debug key to provide to FB (again, this key is NOT the FB app id you put in the xml).
I know I need an FB app ID. I (yand this thread in general) was asking about the android key which is something different.
Specifically about the key that Phonegap Build uses to sign Android APKs in debug mode. Is there anywhere we can get the debug key to provide to FB (again, this key is NOT the FB app id you put in the xml).
- 4116 Posts
- 192 Reply Likes
Hi Yaron,
There is no Debug Key when building android(either locally or using PhoneGap Build).
You only need a key when you creating a release version.
Can you explain what doesn't work?
There is no Debug Key when building android(either locally or using PhoneGap Build).
You only need a key when you creating a release version.
Can you explain what doesn't work?
- 21 Posts
- 0 Reply Likes
There actually IS a debug key.
An android device will only install signed a APK. When building locally the SDK uses a debug key (usually found in ~/.android.keystore).
Facebook requires you to provide the the key hash for the key that signed the APK in order for the app to be able to use FB.
An android device will only install signed a APK. When building locally the SDK uses a debug key (usually found in ~/.android.keystore).
Facebook requires you to provide the the key hash for the key that signed the APK in order for the app to be able to use FB.
- 21 Posts
- 0 Reply Likes
Any update on this?
It would be great to be able to download the hash key of the key used to sign debug APKs.
Alternatively, I could provide my own key, but I think PGB turns off the debug feature in this case.
It would be great to be able to download the hash key of the key used to sign debug APKs.
Alternatively, I could provide my own key, but I think PGB turns off the debug feature in this case.
- 37 Posts
- 5 Reply Likes
Humbly suggesting starting the new thread. The problem of FB and PGB was temporary and has long since been fixed
- 37 Posts
- 5 Reply Likes
Humbly suggesting starting the new thread. The problem of FB and PGB was temporary and has long since been fixed
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers





