iOS app:: Google+ integration- Daily Limit for Unauthenticated Use Exceeded - ios

iOS app: - I am integrating google+ API in my iPhone application, i downloaded google+ API through this link:- "https://developers.google.com/+/mobile/ios/sdk/google-plus-ios-sdk-1.0.0.zip".
I have successfully integrated it in my code, but when i am trying to get user information, it is giving me error "The operation couldn’t be completed. (Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.)",
Any idea about this..!! Why this error comes.?

It says "All API calls require either an OAuth 2.0 token or an API key."
So you should get an API key and pass it as a parameter
https://www.googleapis.com/plus/v1/activities/z12gtjhq3qn2xxl2o224exwiqruvtda0i?key=YOUR-API-KEY

This issue happens when you are already logged in and still try to login again and again. I faced same error so did some experiments
1) I opened website on my mobile and everything was fine.
2) Then i tried on another laptop and used different gmail account to login and it again worked fine.
3) On my first laptop i tied again by clicking "Signin" button i got same error, so i opened google.com then logged out completely and then tried again, this time it worked.
So i believe, Issue is clicking login button again and again without logout.
I am not sure if this is a really a issue, but atleast this is what i found. I am still trying, trying and trying , will post if i found anything else.
Cheers !!

Related

Instagram returning "Matching code was not found or was already used" when using OAuth

I am trying to use the Instagram OAuth using the developer documentation at
https://www.instagram.com/developer/authentication/.
Step 1 and 2 are working without any problems, so I have my Client-ID, the Client-Secret, the Redirect-URI and the code.
But every-time I am trying to get the Acces Token I get the following error:
{
"code": 400,
"error_type": "OAuthException",
"error_message": "Matching code was not found or was already used."
}
Any tips how to solve this?
We are experiencing the same issue. It appears that logging out of Instagram, then attempting to use Instagram OAuth through our site after we are logged out of Instagram is a workaround.
We're experiencing the same issue since yesterday (after months of working fine) - have reported it as an issue yesterday via the 'Report Issue' function on https://www.instagram.com/developer/clients/manage/ and I'd encourage you to do the same.
Yet to hear back, but seems likely it's their end having issues rather than something we're doing.
EDIT: It's also working fine for us on our development servers (which use different IPs for interacting with IG's API) but not working on our production server from any of the IPs we have available on the production server.
EDIT2: (July 2016) Just tested and it's mysteriously started working again on our production servers. No reply to the support ticket from Instagram as yet.
EDIT3: (December 2016) And now it's failing again with the same message... Seems like it's Instagram's end again. Nothing much we can do. Frustrating.
Logging in to Instagram, then complete Step 1 from the API Docs (https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code), then follow the redirect and copying the code from the URL, then logging out of my account, then completing Step 3:
curl -F 'client_id=CLIENT_ID' \
-F 'client_secret=CLIENT_SECRET' \
-F 'grant_type=authorization_code' \
-F 'redirect_uri=AUTHORIZATION_REDIRECT_URI' \
-F 'code=CODE' \
https://api.instagram.com/oauth/access_token
That worked for me.
We are also experiencing the same issue from yesterday, looks like clearing browser (or new incognito window) do the trick. Although, the mobile app where we are authenticating through mobile browser, working fine.
Update: Deleted all my browsing history, cleared cache, etc. Like it was a brand new browser and now it works with no issue.
I've been hammering on the auth URL for weeks now. Testing and using the same stored token to re-authorize. Maybe stored tokens have a limit to the number of times they can be re-used?
======
Having the same issue as of today. Authorization was working fine earlier - now I'm getting the same 'Matching code...' response.
Signed in and out of my Instagram account repeatedly, created a new app id and disabled/enabled Implicit Oauth - all with no success.
The 'Authorized Applications' view in my Instagram account reports that my application has indeed been authorized, but I can't make calls to the API. Authenticating through an Incognito window returned a successful response but it's not a solution.
Tried reporting to Instagram through their 'Report Issue' form, but it won't allow me to submit the form.
I got the same error message. After 2 hours trying every workaround, I realized that I was using FB secret code instead of IG. Double check it first before trying any other solutions.
SOLVED! Just log out of Instagram and try again. That worked for me.
I solved this by creating a service on the backend/server side that authorised the user.
My backend API is a ruby on rails app. Here is a code snippet to understand.
def token
#response = Instagram.get_access_token(params[:code], redirect_uri: mobile_token_url)
instagram_user = InstagramUserCreator.new(user_params)
if instagram_user.find_or_create
redirect_to "taddarmobileapp://?token=#{instagram_user.user.token}"
else
redirect_to 'taddarmobileapp://'
end
end
I just store the token on the phone and use it to authorise the user to my backend API.

Invalid Facebook token

I'm having some trouble handling Facebook errors.
My app displays a page that tells users they've blocked the app when the login fails.
This page tells the users to go to settings>>privacy>>facebook and unblock the app.
I navigate to this page if the sessionStageChanged method contains an error.
I am however noticing a problem when a user changes their password, which will invalidate the iOS Facebook integration login, this will off course result in the error message not being correct anymore.
I've created another error page that tells the user that their password within ios integration has expired but I'm having trouble to figure out when I need to navigate to it.
-Both the different types of failure return Facebook error 2, which is a pretty generic error so I can't find what caused the problem from this error code.
-I've found another answer on here that used the [FBSession renewSystemCredentials] method but I am noticing that this will also return the ACAccountCredentialRenewResultFailed || Rejected error in both cases so this also won't work.
-I found the official documentation with this page: https://developers.facebook.com/docs/facebook-login/testing-your-login-flow/ but this does not have a solution only an explaination.
What should I do in this case?
How do I now when to navigate to the app blocked page and when to navigate to the password changed page?
I'm using Facebook SDK version: 3.10.0.
Thanks in advance!
Thanks for the comments.
After Ming Li's answer I found some stuff on this page: https://developers.facebook.com/docs/ios/errors
But after testing it in my app the Facebook error returned the same error for an invalid login.
I'm going to handle this by letting my user manually navigate trough the different types of solutions.
See the "Handling Errors" section of this page for strategies on how to notify users of different types of errors: https://developers.facebook.com/docs/graph-api/using-graph-api/#errors

Could not fulfill request (error code 7) via openActiveSessionWithReadPermissions with Facebook test users

Background
Recently upgraded to Facebook SDK 3.2
Tested on both device and simulator (iOS 5.1 through 6.1)
Error is only present when attempting to authenticate Facebook test users.
Error
The Facebook server could not fulfill this access request: Temporarily unable to make API calls on behalf of XXXXXX.
UserInfo={com.facebook.sdk:ErrorLoginFailedReason=com.facebook.sdk:SystemLoginCancelled, com.facebook.sdk:ErrorInnerErrorKey=Error Domain=com.apple.accounts Code=7}
Steps to Reproduce
Clear simulator or manually remove Facebook account from device settings.
Create a test user via Facebook's accounts/test-users endpoint.
Add Facebook account in device settings.
Authenticate via openActiveSessionWithReadPermissions & accept the permissions dialog.
Expected Result
FBSessionStateHandler block returns with state == FBSessionStateOpen.
A nil NSError.
Actual Result
FBSessionStateHandler block returns with a error.fberrorCategory == FBErrorCategoryUserCancelled with the above user info trace.
Solution Attempts
I've followed the steps outlined in this question; namely checking my bundle name, ensuring my app type is set to Native/Desktop and setting my App Secret in Client to NO.
As well, I have ensured I am only asking for read permissions (ie. email).
I've even bypassed the Facebook SDK altogether by attempting to authentication with a ACAccountStore instance & got the same results.
Again, everything works fine with a regular user (non-test); so it must have something to do with the configuration & recent 3.2 changes.
1) Facebook 3.1 SDK splits read and publish permissions. Use only read permissions (e.g., email) in the first authentication call. Using both will break it and result in that generic error. It seems Facebook's SDK doesn't actually do what it's meant to do: fall back to older authentication methods. David tells me an updated Parse SDK will make the permissions split easier, but it will of course be up to Facebook to fix that bug in their SDK.
2) Independently, the issue I was having seems to have gone away after signing out of Facebook in the device's Settings, and then back in. Maybe a glitch in the iOS integration? (The permissions split issue still applies here, however. Make sure you do read first and publish (e.g., publish_actions) separately later, the first time you actually need it.)

iOS Twitter NSURLErrorDomain Code=-1012

I am trying to get the user's contact details by singning up with twitter in my app. I found this project on github which seems really good. I encounter only one problem. If I run it with my new app consumer secret and consumer key codes from twitter it gives me an error :
Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" UserInfo=0x6898e80 {NSErrorFailingURLKey=https://api.twitter.com/oauth/request_token, NSErrorFailingURLStringKey=https://api.twitter.com/oauth/request_token, NSUnderlyingError=0x68980e0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1012.)"}
The output in the console is :
2013-01-16 17:55:24.367 DMTwitterOAuth[3411:c07] current status = Prompt for user data and request token to server
2013-01-16 17:55:24.371 DMTwitterOAuth[3411:c07] current status = Requesting token for current user's auth data...
2013-01-16 17:55:25.433 DMTwitterOAuth[3411:c07] current status = Token received from server
Immediately after I get the alert view in which it says that it encountered a NSURLErrorDomain.
On the other hand, if I run it with some other codes from another twitter app it works, giving me all the details about the user. I just can't understand why for some keys it works, and for some others it doesn't.
Error code -1012 is kCFURLErrorUserCancelledAuthentication. This should mean that some code somewhere called [sender cancelAuthenticationChallenge:] in response to an authentication challenge. This is likely code inside of DMTwitterOAuth, but it's also possible it's Apple's own code inside the URL-loading system.
Make sure that your twitter application access settings are appropriate for what you're trying to do. If you're trying to post a tweet you'll likely need Read and Write access.
See the Application Model docs for more info.
It can be also just wrong authentication data in request header.
Visit the below url it solves the issue generally not in specific to this twitter context.It will give u some idea
https://stackoverflow.com/a/17920301/730807
I hope this helps..
I have recently found this problem occurring in projects where previously Twitter login was working. For this reason I assumed it was due to the change in iOS or maybe an upgrade in the Twitter feature.
One of the main issues is it is almost impossible to recreate this issue, there is a very interesting twitter community blog talking about it here: https://twittercommunity.com/t/ios-twitter-kit-1-10-1-twtrloginbutton-responds-with-1012-error/52766
The Twitter staff are trying to fix this issue but can't recreate it to see what is going wrong.
The problem seems to be that the users Twitter account has become disconnected from their device. This means that the Twitter Auth Helper can't get your details to login correctly.
The way to fix this is to go into settings -> Twitter and then click on your Twitter account name. For me this then prompted me to re-input my password as the account wasn't currently connected. Very frustrating and difficult to find as there is no indication until you click your Twitter account.
I found this solution applied when attempting to login with a Twitter account using Firebase.
According to Twitter, the fix is live in SDK version 1.14.1.

Random Facebook iOS SDK auth token invalidated by API

I randomly get the following message when trying to access the graph from my iPhone using Facebook iOS SDK:
response string: {"error":{"type":"OAuthException","message":"Error validating access token: The session was invalidated explicitly using an API call."}}
I'm not sure why this is because I call the graph immediately after I login, so the token should be valid. Also, this happens randomly around 30% of the time. Does anyone know how to go about debugging this issue?
I've been experiencing the same issue. It happens with any graph request after calling authorize immediately after a successful logout callback (with the idea being that a different user can log in from there).
The authorization screen will say that the user's already accepted the permissions (even though they're supposed to be logged out now...) and if they hit ok it will cause the issue. Almost as if the auth process reissues an invalidated token because it doesn't get the memo that they've logged out. However it won't happen if the user hits the "not you?" link and logs in as someone else as intended (or if they log in again as the same user), so this isn't a major issue in my case.
As for an answer / fix, I made mine fix itself by detecting the error response from the graph call and then making another call to authorize. Not ideal though, since it annoys the user with two consecutive app switches...

Resources