does anyone know if the new Google's Firebase can post tweets to Twitter?
I checked Google's Firebase website and it mentions that users can authenticate using their services. Once this authentication and authorization is done, I should have the required keys to access Twitter's API.
However, I was wondering if the Google's Firebase (Android SDK), can post tweets using one of its classes or methods automatically (without having to send an independent REST request from the Android app).
There is no API in Firebase that posts to Twitter.
But you can get the access token when the user signs in and use that to post to twitter in your own code. For more info, see https://firebase.google.com/support/guides/firebase-web#get_the_access_token_numbered
According to
firebase.auth.TwitterAuthProvider one can store the access token and secret to access the twitter APIs. Though Get the access token there is an explicit warning of Twitter API not directly invokable! The authdata structure will return everything needed for the twitter API. And then you need to use Android OAuth2 to set the proper parameters with the different Twitter APIs.
Related
Does Instagram API policy allows to use
https://instagram.com/{user-id}/media/
endpoint to fetch latests media from iOS app. We tried to use documented
api.instagram.com/v1/users/{user-id}/media/recent
but it requires access token. By investigating Instagram web app I discovered that it is using endpoint from first link for fetching user's data.
The Instagram web app is not using the link you provided, it is using:
GET https://instagram.com/{username}/
And in the response inside a script tag it sets Window._sharedData with all the data including the user's media:
window._sharedData.entry_data.UserProfile[0].userMedia
I am not sure about the policies, but you may fetch and extract this data without calling the API.
But, using the API would be easier and the preferred way. As you are going to fetch some public media, you can use a fixed client_id instead of an access_token to avoid authentication:
Some API only require the use of a client_id. A client_id simply
associates your server, script, or program with a specific
application. However, other requests require authentication -
specifically requests made on behalf of a user. Authenticated requests
require an access_token. These tokens are unique to a user and should
be stored securely. Access tokens may expire at any time in the
future.
The API call:
api.instagram.com/v1/users/{user-id}/media/recent/?client_id={client_id}
Instagram username is not a user-id. you can find user-id by link : http://jelled.com/instagram/lookup-user-id
Is it possible to retrieve Facebook page posts in an iOS application without having to use Facebook Login?
I am currently using the Tumblr API which works perfectly fine and delivers pictures and texts from everything that has been posted.
Any help would be much appreciated.
Thanks.
Facebook SDK says, that you need any valid access token if the post is public. So just use your app access token.
Read how to request app access token here.
Yes, this is possible. There are two options from my point of view:
If your Page is only posting in public, you could use an App Access Token
If your Page also contains non-public Posts, you should use a Page Access Token
See https://developers.facebook.com/docs/graph-api/reference/v2.0/page/feed/#readperms
An access token is required to view publicly shared posts.
A user access token is required to retrieve posts visible to that person.
A page access token is required to retrieve any other posts.
An App Access Token will not expire unless you change your App secret, a Page Access Token will expire the latest 60 days after issuing.
You should consider to wrap this in an own webservice, so that you don't have to hard-code an Access Token into your App. With an own webservice, you could encapsulate the Access Token validity issues.
I recommend their graph api for such tasks
Using it I have successfully retrieved page level data using Facebook graph api(REST)
using an app token(public posts)
user token(posts visible to that user) or
page token(all posts in page)
App token is obtained by default on creation of your Facebook app(easiest way)
User token is obtained on a user oauth login(needs oauth,can be done with oauth libraries)
Page token is obtained with a second call to Facebook, after obtaining the user token if you have manage_pages permission from the page admin (needs oauth and a second call to Facebook)
Try Facebook graph explorer and hit the page URL to get a json response of your page information.
Play with the graph explorer
https://developers.facebook.com/tools/explorer/
Page data reference
https://developers.facebook.com/docs/graph-api/reference/v2.0/page/
Access token reference
https://developers.facebook.com/docs/facebook-login/access-tokens
I have had a search around stackoverflow, but was unable to find an answer to my question, so I thought I'd ask.
I'm currently working on an iOS app where I would like to get a feed of a public timeline without the user of the app being required to have a twitter account.
I am successfully able to do this using twitters v1.0 of the API and all works perfectly. Simply making a request to http://api.twitter.com/1/statuses/user_timeline.json?screen_name=username retrieves all the information that I require.
However, since v1.0 has been deprecated and V1.1 requires authentication for each request, I get a bad authorization error using this API. Having looked at the Twitter documentation and how to generate OAuth request headers, I don't fully understand the "Getting a signing key" section of the documentation in the link below. (this is my first time working with Twitter's API and OAuth, I'm trying to gain a good understanding, before I start the implementation)
https://dev.twitter.com/docs/auth/creating-signature
As I understand it, the consumer secret can be found when logging into twitter.com/apps but I'm not sure where I would get the "OAuth Token Secret" in order to generate a valid signing key.
Since this is an iOS app, I know I could use the TWRequest class, but to my understanding, this would require the user to have twitter setup on their device.
I hope the above makes sense and any help would be appreciated.
Thanks
If you go to the Twitter application you have set up https://dev.twitter.com/apps
You should see your Access token secret under the heading Your access token. If you don't see this then you probably haven't generated an access token yet.
I am writing a custom API for twitter which will be used in Twitter for iPhone. what's the response my third-party API gives to twitter can make twitter think the user is logged in.
I know the twitter for iPhone auth step is using XAuth to /oauth/access_token, when it is set my API, I will gives the response 'oauth_token=191074378-1GWuHmFyyKQUKWV6sR6EEzSCdLGnhqyZFBqLagHp&oauth_token_secret=NpCkpRRC5hGEtikMLnQ2eEcEZ0SIVF5Hb2ZgIwmYgdA&user_id=191074378&screen_name=oauth_test_exec&x_auth_expires=0' directly to twitter for iPhone. but twitter tells me server intern error rather than a correct response. what is the incorrect part ?
Now that you have revealed your OAuth tokens anyone can copy them and use them to violate the Twitter TOS. You should go to dev.twitter.com and reset your OAuth tokens immediately. This is why it is called and OAuth Secret.
I'm now dealing with twitter API and my app posts some text to twitter. I managed to get acces to my twitter and i can post now to my twitter using ma app's consumer key and consuer secret, also using my access key and access token for authenticate me. But how do I post messages to someone else's twitter knowing only his password and login? Do I need somehow to get his access key and access token? How?
previously it was possible to post Tweet remotely using username and password. This can not be done anymore.
All methods of status update using curl / json are deprecated and not functioning.
Twitter requires you to use OAuth 100% of the time now.