Giter VIP home page Giter VIP logo

phonegap-facebook-plugin's Introduction

Apache Cordova Facebook Plugin

This is the official plugin for Facebook in Apache Cordova/PhoneGap!

The Facebook plugin for Apache Cordova allows you to use the same JavaScript code in your Cordova application as you use in your web application. However, unlike in the browser, the Cordova application will use the native Facebook app to perform Single Sign On for the user. If this is not possible then the sign on will degrade gracefully using the standard dialog based authentication.

<< --- Cordova Registry Warning [iOS]

Installing this plugin directly from Cordova Registry results in Xcode using a broken FacebookSDK.framework, this is because the current publish procedure to NPM breaks symlinks CB-6092. Please install the plugin through a locally cloned copy or re-add the FacebookSDK.framework to Xcode after installation.

------------------------------------------ >>


Facebook Requirements and Set-Up

To use this plugin you will need to make sure you've registered your Facebook app with Facebook and have an APP_ID https://developers.facebook.com/apps.

Install Guides

Example Apps

platforms/android and platforms/ios contain example projects and all the native code for the plugin for both Android and iOS platforms. They also include versions of the Android and iOS Facebook SDKs. These are used during automatic installation.

API

Login

facebookConnectPlugin.login(Array strings of permissions, Function success, Function failure)

NOTE : Developers should call facebookConnectPlugin.browserInit(<appId>) before login - Web App ONLY (see Web App Guide)

Success function returns an Object like:

{
	status: "connected",
	authResponse: {
		session_key: true,
		accessToken: "<long string>",
		expiresIn: 5183979,
		sig: "...",
		secret: "...",
		userID: "634565435"
	}
}

Failure function returns an error String.

Logout

facebookConnectPlugin.logout(Function success, Function failure)

Get Status

facebookConnectPlugin.getLoginStatus(Function success, Function failure)

Success function returns an Object like:

{
	authResponse: {
		userID: "12345678912345",
		accessToken: "kgkh3g42kh4g23kh4g2kh34g2kg4k2h4gkh3g4k2h4gk23h4gk2h34gk234gk2h34AndSoOn",
		session_Key: true,
		expiresIn: "5183738",
		sig: "..."
	},
	status: "connected"
}

For more information see: Facebook Documentation

Show a Dialog

facebookConnectPlugin.showDialog(Object options, Function success, Function failure)

Example options - Feed Dialog:

{
	method: "feed",
	link: "http://example.com",
	caption: "Such caption, very feed."
}

App request:

{
	method: "apprequests",
	message: "Come on man, check out my application."
}

For options information see: Facebook feed dialog documentation, Facebook share dialog documentation

Success function returns an Object with postId as String or from and to information when doing apprequest. Failure function returns an error String.

The Graph API

facebookConnectPlugin.api(String requestPath, Array permissions, Function success, Function failure)

Allows access to the Facebook Graph API. This API allows for additional permission because, unlike login, the Graph API can accept multiple permissions.

Example permissions:

["public_profile", "user_birthday"]

Success function returns an Object.

Failure function returns an error String.

Note: "In order to make calls to the Graph API on behalf of a user, the user has to be logged into your app using Facebook login."

For more information see:

Events

App events allow you to understand the makeup of users engaging with your app, measure the performance of your Facebook mobile app ads, and reach specific sets of your users with Facebook mobile app ads.

Activation events are automatically tracked for you in the plugin.

Events are listed on the insights page

Log an Event

logEvent(String name, Object params, Number valueToSum, Function success, Function failure)

  • name, name of the event
  • params, extra data to log with the event (is optional)
  • valueToSum, a property which is an arbitrary number that can represent any value (e.g., a price or a quantity). When reported, all of the valueToSum properties will be summed together. For example, if 10 people each purchased one item that cost $10 (and passed in valueToSum) then they would be summed to report a number of $100. (is optional)

Log a Purchase

logPurchase(Number value, String currency, Function success, Function failure)

NOTE: Both parameters are required. The currency specification is expected to be an ISO 4217 currency code

Sample Code

Login

In your onDeviceReady event add the following

var fbLoginSuccess = function (userData) {
	alert("UserInfo: " + JSON.stringify(userData));
}

facebookConnectPlugin.login(["public_profile"],
    fbLoginSuccess,
    function (error) { alert("" + error) }
);

Get Access Token

If you need the Facebook access token (for example, for validating the login on server side), do:

var fbLoginSuccess = function (userData) {
	alert("UserInfo: " + JSON.stringify(userData));
	facebookConnectPlugin.getAccessToken(function(token) {
		alert("Token: " + token);
	}, function(err) {
		alert("Could not get access token: " + err);
	});
}

facebookConnectPlugin.login(["public_profile"],
    fbLoginSuccess,
    function (error) { alert("" + error) }
);

Get Status and Post-to-wall

For a more instructive example change the above fbLoginSuccess to;

var fbLoginSuccess = function (userData) {
	alert("UserInfo: " + JSON.stringify(userData));
	facebookConnectPlugin.getLoginStatus(
		function (status) {
			alert("current status: " + JSON.stringify(status));

			var options = { method:"feed" };
			facebookConnectPlugin.showDialog(options,
				function (result) {
    				alert("Posted. " + JSON.stringify(result));				},
    		function (e) {
				alert("Failed: " + e);
			});
		}
	);
};

Getting a User's Birthday

Using the graph api this is a very simple task:

facebookConnectPlugin.api("<user-id>/?fields=id,email", ["user_birthday"],
	function (result) {
		alert("Result: " + JSON.stringify(result));
		/* alerts:
			{
				"id": "000000123456789",
				"email": "[email protected]"
			}
		*/
	},
	function (error) {
		alert("Failed: " + error);
	});

Publish a Photo

Send a photo to a user's feed

facebookConnectPlugin.showDialog( 
    {
        method: "feed",
        picture:'https://www.google.co.jp/logos/doodles/2014/doodle-4-google-2014-japan-winner-5109465267306496.2-hp.png',
        name:'Test Post',
        message:'First photo post',    
        caption: 'Testing using phonegap plugin',
        description: 'Posting photo using phonegap facebook plugin'
    }, 
    function (response) { alert(JSON.stringify(response)) },
    function (response) { alert(JSON.stringify(response)) });

phonegap-facebook-plugin's People

Contributors

aogilvie avatar axacheng avatar blaind avatar bperin avatar damrbaby avatar dokterbob avatar gkorland avatar gordalina avatar goya avatar jakecraige avatar jcvalerio avatar josemedaglia avatar jrouault avatar keab42 avatar levsa avatar lukemelia avatar matiasleidemer avatar matiassingers avatar mikehayesuk avatar mixtmeta avatar pamelafox avatar robert4os avatar rosshadden avatar sebastianzillessen avatar severedsea avatar shazron avatar sneko avatar stevengill avatar vergnesol avatar webmat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phonegap-facebook-plugin's Issues

fb.api fail to post

hello,

I got the plugin working so the app was able to allow users to post to their wall. I was able to post the user message as well as other parameters like description, etc.
The last time I tested this successfully was back in 10-2.
I just tested again today and only the user message will post successfully. All other parameters like "description" will not go through. I did not change any configuration on my side. I added the external host "graph.facebook.com" in phonegap.plist but still the same problem.
Did facebook change their api methods?
Any help would be greatly appreciated.
I'm using phonegap 1.0, xcode 4.0.2

Here's my code for the fb.api call:

/////
var publish = {
method: 'stream.publish',
message: 'hi',
picture : '',
link : 'http://www.google.com',
name: 'name',
caption: 'caption',
description: 'testing description',
};

         FB.api('/me/feed', 'post', publish, function(response) {


                   if (!response || response.error) {
                  alert('Error occured');
                   } else {
                   alert('Post ID: ' + response.id);
                   }
                   });

Facebook login for iOS 4.2.1 broken

On iOS 4.2.1 (iPhone 3GS), the Facebook API shows an in-app dialog for login.

However, the results of this do not seem to be handled properly. While logins that use a URL-scheme callback seem to be handled fine, the login data for old platforms seem to go nowhere.

Looking at old commits seems to suggest this bug popped up around cf2a115, but (partly) reverting this commit did not solve the problem for me.

FB.init launches empty childbrowser in IOS

With PhoneGap 1.2 IOS, when BOTH Facebook Connect and ChildBrowser plugins are installed, when initializing FB plugin by calling FB.init, an empty childbrowser window is launched. It can be closed manually and then everything works are expected. Note that the ChildBrowser plugin has not been initialized at this point.

I'm not seeing this issue with Android.

Problem with installation

Followed your instructions but keep getting compilation errors:

FBRequest.m:183: error: 'SBJSON' undeclared (first use in this function)

JBSON.h & JBSON.m are located in the Facebook-ios-sdk/FBConnect/JSON sub-folder.

Any advice

Need help in connecting

Hello all,

I am trying to connect to facebook through html, css made android application. I used this plugin (https://github.com/davejohnson/phonegap-plugin-facebook-connect) for this . I followed all instruction give in read me and used the same example what is given in git folder without making any changes. Then when i run it on android phonegap emulator, buttons are not responding. When i tried this on web-browser, it is showing the error FB.login() called before calling FB.init().". I dont know why this is coming. My main task is to post on wall from my web-based android application.

Please kindly help me to implement this.

Thank you in advance.

file:///android_asset/www/pg-plugin-fb-connect.js: Line 18 : Uncaught illegal access

I had this issue after updating to the last version of the plugin. Found the solution here :

http://groups.google.com/group/phonegap/browse_thread/thread/2686cd816bc81204/6508b2320c961581?lnk=raot

if ((session = JSON.parse(localStorage.getItem(key))) &&
session.expires > new Date().valueOf()) {
becomes
if (localStorage.getItem(key) != null && (session =
JSON.parse(localStorage.getItem(key))) && session.expires > new
Date().valueOf()) {

thanks!

PhoneGap 1.1.0 and Facebook Connect Plugin

Hello guys,

I was able to build an app using android and this plugin with phoneGap1.1.0, but on iOS after solving the SBJson Issue with the apropriated code the plugin doesn't work, i have tried with the sample provided with the plugin package.

In iOS also, the phonegap deviceready event, is not dispatched as in android.

com.facebook.android.* in this plugin?

From the readme:
"The working version of the Facebook Android SDK is distributed with the plugin ..."

Does "the plugin" above mean this plugin? This plugin's source doesn't have
native/android/src/com/facebook/android/. Do you mean to get it from Facebook?

Cheers,
Libby

"Page you requested was not found"

I have this plugin installed and working for iOS 4.3 in the simulator (sans facebook app,), but when published to a phone with Facebook app installed, authorization switches to a Facebook page displaying "The page you requested was not found".

I'm digging into this now but thought I'd post in case anyone had run into the same issue.

facebook and phonegap 1.0.0 1.1.0

Hi Dave,

I'm trying to integrate your facebook plugin. However, I am getting the same error as was mentioned in issue #51

When I click login, everything looks alright, no errors. However, when I try to click me, I get:

"{"message":"An active access token must be used to query information about the current user.","type":"OAuthException"}"

I have tried to deploy with phonegap 1.1.0 and 1.0.0 too.

Do you know what could be a problem?

Thank you for your help.

Regards
Lubo

Windows tip about Android key hash

Hi guys,

Windows users have to be careful about openssl-for-windows (http://code.google.com/p/openssl-for-windows/downloads/list), the latest version, at least on plataform 64bits, don't generate the correct hash that Facebook need it for android apps.

When we are using this plugin we need provide a security hash to the facebook, in our aplication page (https://developers.facebook.com/apps), if what i'm saying don't make sense for you I recomend you read these materials:
http://developers.facebook.com/docs/mobile/android/build/#sig
http://developer.android.com/guide/publishing/app-signing.html

If you've read these materials and already know how works and how you will have to do to generate your security hash to use this plugin, remember of this tip:

Use one of this versions: openssl-0.9.8e_X64.zip or openssl-0.9.8d_X64.rar

You should not use the openssl-0.9.8k_X64.zip.

I hope this tip be useful. I lost a lot of time, testing ways to generate the correct hash and in the end the problem was with the latest version of openssl.

iOS - Connect through native FB app

I can connect through the browser in the simulator perfectly fine, but i can't connect on the device using the native FB app. Attempting to login opens up the native app, but my app is reactivated before asking for permissions. Any help?

login status not working (Android)

I just added the plugin to my Android app. When i press on my "Login" button then i'm redirected to the Facebook login page.
In there i login with my Facebook account, hit the Login button and it then redirects me back to my app. So far so good...

But when i press on the button "Get Status" (which calls getLoginStatus()), then i get "Not logged in" back...

When i open the real facebook app then it knows that i'm logged in So my session must be stored somewhere.

Any idea why my Android app can't tell if i'm logged in??

Unable to get this to work with PhoneGap 1.1.0 and facebook-ios-sdk (91f256424)

As others have posted elsewhere, could only get this to work by downgrading to PhoneGap 1.0.0 (can find and install from github tag). With 1.1.0 could get it to compile, but then it wouldn't link properly, failing with:

Undefined symbols for architecture i386:
"OBJC_CLASS$_Facebook", referenced from:
objc-class-ref in FacebookConnectPlugin-375760CB59A4DB21.o
(maybe you meant: OBJC_CLASS$_FacebookConnectPlugin)
ld: symbol(s) not found for architecture i386

even though using lipo command line tool showed the .a file was i386 and nm command showed that symbol, and had several more experienced iOS developers look at it to verify was building and linking properly.

Ignoring gap command with incorrect sessionKey error

Hello Dave,
Thanks so much for putting this up here. I'm having a problem and if you can point me in the right direction, I'll jump in and see if I can help fix it. When running the provided example, I'm getting the following error:

2011-08-16 08:34:09.176 PhoneGapFacebookConnect[3763:307] PhoneGapDelegate::shouldStartLoadWithRequest: Received Unhandled URL about:blank
2011-08-16 08:34:09.194 PhoneGapFacebookConnect[3763:307] Ignoring gap command with incorrect sessionKey; expecting: 1495906917 received: (null)
2011-08-16 08:34:09.197 PhoneGapFacebookConnect[3763:307] Complete call: gap://com.phonegap.facebook.Connect.init/com.phonegap.facebook.Connect.init0/188240441228254

Is there some setting that needs to be adjusted on the example app?
Thanks in advance.

Authentication problem on device without FB app

I have implemented step by step the PG FB plugin, when I run it on android device with the facebook app installed on it there are no problems. When the login button is tapped it switches to FB app and everything is working as expected. However if I try to use it without the FB app installed on the device when the login button is tapped nothing happens. There is nothing in the error log.

As far as I searched the property
nativeInterface: PG.FB in the FB.init({ appId: "xxx", nativeInterface: PG.FB });
is responsible for the call to the native FB app. I tried removing it ( like FB.init({ appId: "xxx" }); ) and expected to be redirected to the touch FB site or something like this.

The result was that it opens an error facebook page with the following information:

An error occured with ..... Please try again later.
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.

I'll appreciate any help :)
Thank you


forgot to mention:
PhoneGap: 1.2.0
Testing device: Android 2.3.3

What happens when user chooses "Don't Allow"

Hey,

I'm going back and forth between this and the solution offered by childBrowser/FBConnect. I just got the latter working earlier today, thanks to shazron.

In both cases though, if I choose "Don't Allow" for the facebook app, I'm returned to a blank screen in the phonegap app. I'm kind of at loss for what to do. Any idea?

Android Facebook App not installed or old version

When using this with current versions of the Facebook app on Android, everything is peachy. If the user doesn't have Facebook installed or has an old version installed (1.1.3) it does not work. It silently fails and returns nothing back to the PhoneGap JS application. No Exceptions are raised, no errors generated, nothing happens.

Any suggestions?

The this.facebook.authorize seems to be the culprit. It fails without error and the plugin seems to basically stop.

App Secret should not be distributed

I'm sorry to be this negative, but the facebook app secret "should not be shared with anyone or embedded in any code that you will distribute" (http://developers.facebook.com/docs/authentication/).

If I put it in my AndroidManifest.xml (as it is required by this plugin), it's not a big deal to recover it:
http://stackoverflow.com/questions/2097813/how-to-parse-the-androidmanifest-xml-file-inside-an-apk-package

Any plan on improving this ? I'm hesitating to use the plugin because of this.

phonegap-plugin-facebook-connect

iam getting this error when i try to connect to facebok.
/Users/bridge/Desktop/ProjectIPhone/myTesting/myTesting/src/FBRequest.m:183: error: 'SBJSON' undeclared (first use in this function)

/Users/bridge/Desktop/ProjectIPhone/myTesting/myTesting/src/FBRequest.m:183: error: 'jsonParser' undeclared (first use in this function)

can any one give me a demo xcode project for phonegap-plugin-facebook-connect ?

phonegap1.1.0 for android

Login button does not works. I am not receiving any js errors.
I have tried. to alert the values in phonegap-1.1.0.js

PhoneGap.exec = function(success, fail, service, action, args) {

alert(action);

try {
    var callbackId = service + PhoneGap.callbackId++;
    if (success || fail) {
        PhoneGap.callbacks[callbackId] = {success:success, fail:fail};
    }

    var r = prompt(PhoneGap.stringify(args), "gap:"+PhoneGap.stringify([service, action, callbackId, true]));

alert(r);

for action:getconnectioninfo I am getting the value for r as empty. as well as for init action.

Is this plugin working for iphone?

I see several issues reported and i would like to know if somebody has this plugin running 100% with the lastest version of FB SDK and Phonegap.

I think this is the only plugin in the market to connect Phonegap and FB. Please let me know if somebody know any other solution.

Login button doest work

I have implemented the steps..I can able to view the buttons in simulator but can't able to login to facebook .when I click on Login button it doesnt seems to initialize Fb.login ..

Facebook API returning "..." for uid and sig

I'm not sure if this is an issue with the plugin, the facebook SDK, or the facebook API. When I do login I get back a response with a session that has an access key and a secret, but "..." for the uid value.

Screenshot: http://dl.dropbox.com/u/10998095/Screenshots/7m.png

The code:

FB.login(function(response) {
  if (response.session) {
     alert(JSON.stringify(response.session));
     alert(JSON.stringify(FB.getSession()));
  } else {
    alert('No session found?');
  }
}, {perms: 'user_birthday,email,user_location'});

I've tried with multiple facebook accounts, and tried on both the emulator and phone, and tried with both the facebook app and the m.facebook.com login. I would like to print out the returned JSON to ensure it's not a deserialization problem, but I'm not familiar enough with Objective C to do that.

Thanks!

Android FB.Login called before FB.Init

Hello there,
I'm trying to get the Android sample working on an emulator with version 2.1 and on an actual device with 2.3.3.
I've done the setup and library arrangement as it was written in the guide.
When i click the buttons i'm getting problems on both of them and get session returns null.

The error which i'm getting at the emulator is .
facebook_sdk_js : Line 70 : FB Login () called before FB Init()

The error at the real device is quite different which is.
Failed to find provider info for com.facebook.katana.provider.FriendsProvider

I'm struggling to work this out hope someone can lend a hand soon.
Thanks

Uploading photo via byte array/data url from canvas (iOS 5)

I'm attempting to export the data from an HTML5 canvas (either as a data URL or a blob) and post it to facebook.

var bytes;
canvas.toBlob(function(blob){ bytes = blob; });
var body = 'Test';
FB.api('/me/photos', 'post', { name: body, picture:bytes }, function(response) {
                            if (!response || response.error) {
                            alert(response.error);
                            } else {
                            alert('Post ID: ' + response.id);
                            }
                            });

                     } else {
                     alert('not logged in');
                     }
                     },
                     { perms: "email, publish_stream" }
                     );

I'm receiving an error: 'com.phonegap.facebook.Connect2 = TypeError: 'undefined' is not an object'

Unfortunately the graph API seems to be horribly documented....so I'm not sure where to go. I'm able to upload a photo by simply passing a URL, but using a data url or a blob results in this error. Any ideas?

Issues with setting up the sample

Platform: Android
I am new to mobile development. This issue might seem very basic but any help would be great.

I followed all the steps mentioned in the readme file to create the sample app. On executing the app, none of the buttons work or they say i am not logged in.

I also receive this message "{"message":"An active access token must be used to query information about the current user.","type":"OAuthException"}" on selecting "Me" button.

BTW, i am not getting any errors

Is there any way to stay loged in when restarting the app

First, this plugin rocks! it was super easy to integrate with my existing app and saved me a ton of time.
So Thank you!

Anyways, It seems like every time I completely close the app (using ios taskbar) and restart, I have to login into fb again.
Is there a way to keep the app loged in?

IOS - after updating to pg 1.2.0 the plugin is crashing after connecting

It can be from using JSONKit

Here are some logs:

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSConcreteMutableData 0x656f970> valueForUndefinedKey:]: this class is not key value coding-compliant for the key id.'

NSDictionary* session = [NSDictionary
dictionaryWithObjects:[NSArray arrayWithObjects:self.facebook.accessToken, [self.facebook.expirationDate description], APP_SECRET, [NSNumber numberWithBool:YES], @"...", [result valueForKey:@"id"], nil]
forKeys:[NSArray arrayWithObjects:@"access_token", @"expires", @"secret", @"session_key", @"sig", @"uid", nil]];
NSDictionary* status = [NSDictionary
dictionaryWithObjects:[NSArray arrayWithObjects:@"connected", session, nil]
forKeys:[NSArray arrayWithObjects:@"status", @"session", nil]];

Seems no response using the examples

Hi Dave,

Just found out phonegap official FB plugin days ago, was trying out the sample index.html. I tried it on my phone( android 2.3.3) and also the virtual device on eclipse (phonegap version 0.9.5). Problem is when i clicked on either of the button "Login" "Me" "Get Session" "Get Login" "Logout" seems like there arent any response, seems like there is nothing going on back there. Apart from that, the ConnectPlugin.java file is having this error - "The method setActivityResultCallback(ConnectPlugin) is undefined for the type PhonegapActivity", You mentioned the dialog feature wasnt support in this version of the plugin, were u referring to this error? Please advise, many thanks

Lawrence

Plugin not working with phonegap 1.1 IOS

After migrating to 1.1 the plugin stopped working due to SBJSON error.
I tried to use PG_SBJSON instead with no luck, however other plugin worked with PG_SBJSON.
It seems the facebook sdk is dependent on SBJSON.
Not deleting the JSON reference from the plugin directory didn't help as well, it will cause duplicate errors while building, i am not sure what is the right solution for this.

Sorry, something went wrong

Hello,

I followed all the instructions of how to use this plugin, i got my android hash key from my keystore and added it on facebook and installed my app's apk. Once i call FB.login i am redirected to a page on facebook where it says:

"Sorry, something went wrong."
"We're working on getting this fixed as soon as we can."

What am i doing wrong here?

allow support for childBrowser

Maybe my understanding of Objective C is just terrible, but is there a simple way to force this pluggin to use the ChildBrowser plugin and not the native browser app for authentication? I'm trying to keep from switching apps as much as possible.

If this already exists, my apologies, I was just unable to figure it out by reading the src and examples.

Correct PhoneGap / Xcode Versions

I have not been able to successfully build a project using PhoneGap 1.1.0 or 1.0.0 in Xcode 4.2. Has anyone had any luck with PG 1.1.0 and Xcode 4.2? Also, it is not clear if this plugin works beyond PG 1.0.0.

I'll update this issue with more specific errors later. If anyone has remarks in the meantime, please share.

Best,
J.Schwartz

Facebook API Change causing plugin to fail??

My App has been working happily on iOS for weeks now but as of today when trying to log in i get the following error on the permissions screen:

API Error Code: 100 
API Error Description: Invalid parameter 
Error Message: Requires valid redirect URI 

Is anybody else having the same issue?

Thanks

Some suggestions for the iOS readme

Some suggestions based on my experience of following the readme:

I couldn't build at Step 7 due to not having the Facebook SDK, so I went on to next step. Not sure what Step 7 was meant to do.

For step 8, URL scheme, I think you only need URLSchemes, not URLName (I looked at FB docs and thats what they did).

For Step 9, for getting the SDK at the suggested hash, these are the git commands I used:
git clone git://github.com/facebook/facebook-ios-sdk.git facebook-ios-sdk
cd facebook-ios-sdk/
git reset --hard 91f256424531030a454548693c3a6ca49ca3f35a

For steps 10-18 I ended up getting the FB SDK in a different way, as there seemed to be issues with the suggested way of doing it in the xCode I was using (http://stackoverflow.com/questions/7489597/why-cant-i-drag-the-facebook-sdk-into-a-new-project). I had to just manually add the FB SDK files to Classes.

After getting it running and seeing whitelist rejection warnings, I added facebooks URLs to the ExternalHosts in the plist-
graph.facebook.com*
api.facebook.com*

Logging out doesn't clear the saved FB session

When logging out, the key pg_fb_session isn't cleared from local storage. This means that if a user logs out, closes the app, then re-opens it, he's still logged in.

It's minor, but unexpected.

Sample code does not work in PhoneGap 1.0 on android

None of the buttons do anything in the sample code except "Get Session", which returns NULL, regardless of whether or not you are logged into Facebook. Have tried phones with Android 2.2, 2.34, and tablet with 3.1.

Login always required, FB.init() doesn't restore previous session properly on iOS

Hey guys,

I'm trying to use the plugin. The main flow of first time use works well. I'm able to log in, then make API calls (e.g. FB.api('/me') and so on).

However, when I reopen the app, the call to FB.init() doesn't seem to restore the session properly.

I've narrowed it down to the fact that the session I'm getting back from Facebook specifies the "expires" as a date string, rather than a unix timestamp (integer).

Therefore the session is never restored properly. See this part of the plugin's init():

if (session && session.expires > new Date().valueOf()) {
  FB.Auth.setSession(session, 'connected');
}

The following returns false, of course: "2011-12-10 21:00:01 +0000" > new Date().valueOf() :-)

My feeling is that this is caused by an incorrect settings on my Facebook app. I've tried to enable and disable "Upgrade to Requests 2.0", I've also made sure to keep old APIs available ("Remove Deprecated APIs" Disabled). I'm running out of ideas.

Did anyone encounter that problem? Can anyone offer suggestions to fix this?

Thanks in advance!

Mat

Note: I've made sure to use the older version of the FB SDK for iOS (commit 91f256424531030a454548693c3a6ca49ca3f35a), as suggested. I'm not removing the JSON code, as suggested in pull request #67.

Demo Not working in Android

I've tried everything I can think of. But can't get this thing to work. Is the App ID supposed to be string based or int?

FB.init({ appId: 19354053785, nativeInterface: PG.FB });

or

FB.init({ appId: "1935653785", nativeInterface: PG.FB });

Login button does nothing on emulator. On the real phone the facebook pages flashes briefly. Always just says not logged in. Me says {"message":An active access token must be used....

Thanks for any help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.