Facebook APP [and js api] not showing any of the friends - javascript

I am trying to create a facebook web app, but am unable to get any of the friends through facebook javascript API. What I basically want my app to do is that it will ask a user to login and then after authorization, his/her all the friends{weather using the app or not} should be displayed.
Is it possible to get friends who don't use the app at all?
If so, please tell me how! :)
img : http://postimg.org/image/9r959i38n/
code in my app:
FB.api('/me/friends',function(res){
console.log(res.data[0].name); //just sample output
});
Thanks

/me/friends now only returns friends who are also using your app - https://developers.intern.facebook.com/docs/apps/changelog#v2_0_graph_api
See the full document for new APIs that might solve your problem instead.

Here's two new APIs for:
Inviting friends - https://developers.facebook.com/docs/graph-api/reference/v2.0/user/invitable_friends
Tagging friends -https://developers.facebook.com/docs/graph-api/reference/v2.0/user/taggable_friends

With the release of version 2.0 of the API,
In Graph API v2.0, access to /me/friends is no longer part of the default (public_profile)
permissions. We now require you to ask for the new permission user_friends. With this
permission, /me/friends now returns the person's friends who are also using the app.
https://developers.facebook.com/docs/apps/changelog#v2_0_permissions
Solution (temporary)
You can use version 1.0 till April 30th 2016.
http://graph.facebook.com/v1.0/
Opinion: This change will put an end for spam apps

Related

A way to get and send Direct Messages in Instagram in NodeJS

Is it possible to get and send Instagram Direct Messages programmatically in NodeJS? I couldn't find any recent answers about the subject, so decided to ask here.
Right now I know that there are:
Instagram API
FB Instagram API (Graph API)
instagram-private-api package
First and second don't have api for direct messages as I understand.
Third one is a bit doubtful. Hard to say how exactly it works. Is Instagram okay with developers using this lib?
If you use the instagram-private-api you can send direct messages via:
const userId = await ig.user.getIdByUsername('username');
const thread = ig.entity.directThread([userId.toString()]);
await thread.broadcastText('Message from node');
(Source: https://github.com/dilame/instagram-private-api/issues/792)
As of August 16, 2021 you can send IG messages through the official API.
Here is a quote from the official "FACEBOOK for developers" website:
"All Instagram business accounts can connect to Messenger API for Instagram as of August 16, 2021." (Instagram Messaging)

Does anyone have the ability to create an account with my key?

EDIT : tried the authorized domain and it seems to be what i need, i'll try to go deeper with André's answer :)
Thank you !
Hi,
I'm new to firebase and i just finished a project but i had a question:
Since the doc says i have to put my api keys and else in the javascript, they are visible to anyone even if put into process.env
i've read here : Is it safe to expose Firebase apiKey to the public?
that making the api key public is normal and not a big deal.
I'm using the email/password auth and i'm scared
If someone takes my :
API_KEY_FIREBASE
AUTH_DOMAIN
DB_URL
PROJECT_ID
that are in the source code and use the createAccount function, is he gonna be able to create an account ?
Is yes, is there a way to disable this ?
I want to be able to create account only through the firebase console
I'm not using firebase database for my data, i only use it for auth so i don't have to create a user table in my database, but i use the IDTokens they provide to secure some routes on express.
thank you ! :)
Someone can only create an account when you have that option enabled in your firebase console. So If you have it disabled there is no problem.
You can look here in the "before you begin" section for how to enable/disable Email/password sign-in method.

how to get account details when integrating plaid api

I am actually trying to integrate Plaid api for ACH payments and following "https://plaid.com/docs/link/" tutorial in Ruby. In this I have written the js code and it shows me pop up to select bank accounts.
I am using it in sandbox mode in which I am using test credentials to verify the account and it successfully verifies the account. For server side scripting I have installed plaid gem and configured it using following code into my_app/config/initializers/plaid.rb
Plaid.config do |p|
p.customer_id = 'test_id'
p.secret = 'test_secret'
p.environment_location = 'https://tartan.plaid.com'
end
where I have replaced the customer_id and secret key with my own. I am using a user controller in which under create method I am trying to create a user like this:
user = Plaid.add_user('auth', 'plaid_test', 'plaid_good', 'usaa', '1234')
Now I am confused how would it work.
I am trying to create a server side handler using ruby but I dont understand where I am lacking (as I am new to Ruby). I actually want that after successfully validating credentials there should be an option to select account like in the given demo
https://demo.plaid.com/stripe
I really need help as I am badly stuck in this from last three days. Any help would be appreciated. Thanks
Plaid Link returns a 'public_token' - you'll need to use the /exchange_token API endpoint to exchange the public token for an API access token.
The plaid-ruby library has a detailed example of the exchange token flow!

Can't Post to Facebook Page using JS

Okay what I want is to post to the Facebook Page as an Page(This is developing mode application only viewable to ne).
I have done with Facebook login.
So basically I ask for 2 permissions and they are
Manage Pages
Publish Pages
I can post to the page using the Facebook graph explorer tool but can't via my Javascript code.
Here is the code that I write using JS. This code is written inside a function.
FB.api('me/accounts', function(response){
token = response.data[0].access_token;
post_with_token(token);
});
function post_with_token(token){
var message = $('#post_body').html();
var page_id = 'page_id';
FB.api('page_id/feed', 'post',
{ message : message,
access_token : token},
function (response){
console.log(response);
});
The error object in the console says this
message: "(#200) The user hasn't authorized the application to perform this action"
Both the apps My and Graph explorer have the same permissions granted.Is any new permission to be asked. I am unable to figure out what exactly the problem is.Correct me if I am wrong anywhere.
I got the answer that I posted below but didn't got why I need additional permission.?
publish_pages has only been introduced with Graph API version 2.3.
Before that, publish_actions was used to allow posts on pages by the page as well – now with v2.3, they have made that into two separate permissions. publish_actions is for everything you publish as/in the name of a user, and publish_pages is for publishing as a page.
Graph API Explorer has API version 2.3 selected by default – that is why your call was successful there. Most likely, with your own API call from your JS code, you did not use v2.3, but specified a lower API version when initializing the JS SDK.
So just specify version: 'v2.3' in your FB.init parameters (see Basic Setup section in JS SDK docs), and it should work fine with publish_pages.
Okay I solved the problem . I have to ask for publish_actions permission also. So I asked through the Login Dialog and used the same code as above to post to the page!
The error implies exactly what it says. They've designer their API so it's not going to let you post without proper authorization first.
Facebook provides a guide on how to give proper authorization to your registered app

Login and pay with Amazon integration issue

So, I'm trying to integrate the Login and Pay with Amazon widget, and I'm encountering some problems.
So, I have my seller account all set up on
https://sellercentral.amazon.de/gp/
I have access to my API credentials, and I need to get a LWA client.
So, I have registered on
https://sellercentral.amazon.com/gp/homepage.htm
in order to create an application. I have set up the application, on web settings I have completed the required URL's, and got my client ID.
In the js for the Login and Pay with Amazon widget, I have replaced all the info needed: Client Id, merchant Id etc.
But when I try to make a test login, I receive the following error :
400 Bad Request Unknown client_id
The Pay With Amazon documentation is not very clear, and I can't seem to find anywhere a list with the error codes.
If anybody has an idea, let me know.
Thanks!
you should create your Login with Amazon application using https://sellercentral.amazon.de instead of the .com site. They are separate accounts.
It sounds like you're missing this piece of code:
window.onAmazonLoginReady = function() { amazon.Login.setClientId('CLIENT_ID'); }

Categories