I am using cordova in my ionic app. For the Facebook functionality I am getting that "currently uses Facebook SDK for iOS v4.15.1, which relies on the recently deprecated Version 2.7 of the Graph API.
As a result, there is a risk that your app will no longer function if you don't upgrade to Facebook SDK for iOS v4.39.0.
As an admin of this app, please upgrade to the latest SDK as soon as possible to ensure your app's continued performance and to take advantage of new features."
But I am not using Facebook SDK, I am using openfb.js to login the user into the app.
Please confirm how I need to make sure that my app will run smoothly as I am not using this Faceboook SDK.
Here is the code which I am using in my App to use the Facebook functionality:
Also the reference link for OpenFB : https://github.com/ccoenraets/OpenFB
$scope.fbLogin = function(){openFB.init({appId: 'XXXXXXXXXXXXXX'});
openFB.login(
function(result1) {
if(result1.status === 'connected') {
var access_token = result1.authResponse.accessToken;
openFB.api({
path: '/me',
success: function(result) {
var o = {};
o.id=result.id;
o.email = result.email;
o.first_name = result.first_name;
o.last_name = result.last_name;
o.gender = result.gender;
o.name = result.name;
//Hitting some api to get the data
console.log(JSON.stringify(result));
},
error: errorHandler});
} else {
console.log(JSON.stringify(result1));
}
}, {scope: 'publish_actions, email, public_profile, user_friends'});
}
Related
I need a web and mobile application which will work on android, iphone and windows as well.
I want to use facebook login for my apps and customer can like my page after login thats why i am using cordova to convert my web app into android app but i need to integrate facebook-like option which i didn't get in plugin.
So i implemented this using oglike
$scope.facebookLike = function() {
if($localStorage.hasOwnProperty("accessToken") === true) {
$http.post("https://graph.facebook.com/me/og.likes?access_token="+$localStorage.accessToken+"&object=https://www.facebook.com/Nxtlife-Technologies-Ltd-UK-180614345644169/?ref=br_rs");
alert("like sucessfully done");
} else {
alert("Not signed in");
$scope.facebookLogin();
}
}
Problem:
The code will not throwing any error but after success message it didin't make any changes to my page. like count is remains same.
og.likes is for Open Graph objects – external URLs, outside of Faceook.
You can not like Facebook pages by any other means than the official Like button.
I have old code that uses facebook api 1.0 and I need to integrate it with new facebook sdk. However setting
Settings.setPlatformCompatibilityEnabled(true);
does not help. Access token is generated for api 2.0. So me/friends call behave differently than on version api 1.0.
Code that authorizes user
OpenRequest openRequest = new OpenRequest(MainActivity.getInstance());
openRequest.setIsLegacy(true);
openRequest.setLoginBehavior(SessionLoginBehavior.SSO_WITH_FALLBACK);
openRequest.setCallback(new Session.StatusCallback()
{
//my callback code
});
openRequest.setPermissions(Arrays.asList(GLOBAL_PERMISSION));
Session session = new Builder(context).build();
if (SessionState.CREATED_TOKEN_LOADED.equals(session.getState()) || allowLoginUI) {
Session.setActiveSession(session);
session.openForPublish(openRequest);
return session;
}
I'm using Facebook phonegap plugin for my mobile app project. The problem is I get an empty result for friendlist
js
facebookConnectPlugin.api("/me/friends?fields=picture,name", ["public_profile", "user_friends"],function(
response) {
console.log(JSON.stringify(response.data))
}, function(response) {
console.log(JSON.stringify(response))
});
result
2014-08-10 01:41:29.700 TypeOut[590:60b] new permissions (
installed,
"public_profile",
email,
"user_friends"
)
2014-08-10 01:41:29.701 TypeOut[590:60b] Graph Path = /me/friends?fields=picture,name
2014-08-10 01:41:30.292 TypeOut[590:60b] []
How can I fix this?
It will only return friends that are also using the app
If your app is a game, use Request Dialog. If your app is not a game, and on mobile, use Message Dialog.
One benefit of node js that we can use the ready made huge base of javascript libraries? So, I was wondering how to integrate the Facebook sdk at http://connect.facebook.net/en_US/sdk.js into my node project?
I am a bit new to Node so the question might be naive..
You cannot integrate the Facebook SDK directly. There are some libraries at http://npmjs.org which deal with Facebook connectivity, but most of them are quite old.
If you're just looking for Facebook Login integration, https://www.npmjs.org/package/passport-facebook could be a starting point.
I ended up developing my of "library", which is not too complicated because the Facebook Graph API can be used via standard HTTP requests.
Try this .
First do npm install facebook-nodejs-sdk
And then
var connect = require('connect'),
fbsdk = require('facebook-sdk');
connect()
.use(connect.cookieParser())
.use(connect.bodyParser())
.use(fbsdk.facebook({
appId : 'YOUR APP ID',
secret : 'YOUR API SECRET'
}))
.use(function(req, res, next) {
if (req.facebook.getSession()) {
res.end('Logout');
// get my graph api information
req.facebook.api('/profile', function(me) {
console.log(me);
});
} else {
res.end('Login');
}
})
.listen(9000);
Has anyone used the Instagram Plugin for Cordova/Phonegap (https://github.com/vstirbu/InstagramPlugin) and have a sample implementation they would be willing to share with me?
I have tried in my phonegap application steps as below,
Pre requisite : Instagram App installed in your device.
if you have installed phonegap using node js then
its simple to add plugin to app
add plugin : cordova plugins add https://github.com/vstirbu/InstagramPlugin
add to your index.html page.
you can test instagram installed or not using below code,
Instagram.isInstalled(function (err, installed) {
if (installed) {
console.log("Instagram is installed");
} else {
console.log("Instagram is not installed");
}
});
then share your image (you need to pass base64 or canvas id)
Instagram.share(canvas_id or base64, function (err) {
if (err) {
alert("not shared");
} else {
alert("shared");
}
});
it open device default sharing popup then select instagram to share and that it.
Note : After sharing on instagram not redirect to phonegap app back this is the major issue with it.