Adding Firebase SDK somehow breaks facebook login for no apparent reason - ios

I'm running Xcode beta 10, with ios 10 beta, and I got my facebook login working.
if I simply just add
import Firebase and FIRApp.configure() in my appdelegate, I get the following error:
Optional(Error Domain=com.facebook.sdk.core Code=8 "(null)" UserInfo={com.facebook.sdk:FBSDKGraphRequestErrorCategoryKey=0, com.facebook.sdk:FBSDKGraphRequestErrorHTTPStatusCodeKey=400, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=An active access token must be used to query information about the current user., com.facebook.sdk:FBSDKGraphRequestErrorGraphErrorCode=2500, com.facebook.sdk:FBSDKGraphRequestErrorParsedJSONResponseKey={
body = {
error = {
code = 2500;
"fbtrace_id" = CIheVvb2bpQ;
message = "An active access token must be used to query information about the current user.";
type = OAuthException;
};
};
code = 400;
}})
This makes virtually no sense to me, I'm not doing anything with firebase yet, not trying to authenticate or track a login, why would simply importing firebase, and configuring it in the appdelegate cause this, and any ideas on how to fix?

Related

Disabled Facebook Login iOS throws com.facebook.sdk.core Code=8

Our App was disabled a week ago due to violation on 6.1 and we tried to fix the issue
I have tried reimplementing the login following the instructions on the Facebook login setup guide. Also tried updating from 9.0.1 to the latest version 12.1.0
I can confirm that the info.plist is correct, the permissions are correct, bundle id is correct, and we only use test accounts.
However this error still throws, I could not find any references to fix this.
Could anyone help?
Don't know if this helps but the android app using version 5.4.0 build is working fine
Error Domain=com.facebook.sdk.core Code=8 "(null)" UserInfo={NSRecoveryAttempter=<_FBSDKTemporaryErrorRecoveryAttempter: 0x1630097f0>, NSLocalizedRecoverySuggestion=The server is temporarily busy, please try again., com.facebook.sdk:FBSDKErrorDeveloperMessageKey=Unsupported request, com.facebook.sdk:FBSDKGraphRequestErrorHTTPStatusCodeKey=400, com.facebook.sdk:FBSDKGraphRequestErrorGraphErrorCodeKey=1, NSLocalizedRecoveryOptions=(
OK
), com.facebook.sdk:FBSDKGraphRequestErrorParsedJSONResponseKey={
body = {
error = {
code = 1;
"fbtrace_id" = ANc5PSXRGPTACuYqqxYTDda;
message = "Unsupported request";
type = OAuthException;
};
};
code = 400;
}, com.facebook.sdk:FBSDKGraphRequestErrorKey=1}
From your error response, it seems like you are requesting data from a not-existing API or that your token is invalid
error = {
code = 1;
"fbtrace_id" = ANc5PSXRGPTACuYqqxYTDda;
message = "Unsupported request";
type = OAuthException;
};
from Facebook's docs: OAuthException | code= 1
//API Unknown//
Possibly a temporary issue due to downtime. Wait and retry the operation. If it occurs again, check that you are requesting an existing API.

Swift Gmail API: Try to send message gives error -1001

I'm trying to send a gmail message in Swift using the GoogleAPIClientForREST and GTMOAuth2 libraries but I'm getting the aforementioned error.
Here's my code:
let message = GTLRGmail_Message()
message.raw = "test"
let query = GTLRGmailQuery_UsersMessagesSend.query(withObject: message, userId: "example#gmail.com", uploadParameters: nil)
let gmailService = GTLRGmailService()
let auth = GTMOAuth2Authentication()
auth.clientID = gmailClientID
gmailService.authorizer = auth
gmailService.executeQuery(query) { ticket, object, error in
print(ticket)
print(object)
print(error)
}
and here's the error:
Optional(Error Domain=com.google.GTMOAuth2 Code=-1001 "(null)" UserInfo={request=<NSMutableURLRequest: 0x600000016ed0> { URL: https://www.googleapis.com/gmail/v1/users/example%40gmail.com/messages/send?prettyPrint=false }})
Notes:
I used "example#gmail.com" for sake of asking the question, I'm using a real email in my app.
I followed all the basic steps in Google's tutorial
Make sure that you've integrated GTMOAuth2 properly into your app by following this tutorial. Be sure to register the Platform as Other and NOT iOS otherwise you'll get "invalid_client" error when authenticating.
You may also check the given solution on this thread.

How to get token_for_business for Facebook login - iOS

How can I get token_for_business from Facebook login? I have setup a business and associated my application with that business. Facebook documentation says you need to call GET /me?fields=token_for_business on User node, and it will return following json.
{
"id": "1234567890"
"token_for_business": "weg23ro87gfewblwjef"
}
I tried by providing token_for_business in parameter list of /me call but didn't work. Need advises.
Edit
I found this URL https://developers.facebook.com/docs/graph-api/reference/v2.5/user and tried by passing token_for_business in param of initWithGraphPath but no gain. I checked in Graph API Explorer and getting the required data. But not sure how to call from my objective-C code.
Edit 2
I Inspected the error object of initWithGraphPath:#"me?fields=token_for_business" call and found following details
Error Domain=com.facebook.sdk.core Code=8 "(null)" UserInfo={com.facebook.sdk:FBSDKGraphRequestErrorCategoryKey=0, com.facebook.sdk:FBSDKGraphRequestErrorHTTPStatusCodeKey=403, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=(#200) Application must be associated with a business. https://business.facebook.com/, com.facebook.sdk:FBSDKGraphRequestErrorGraphErrorCode=200, com.facebook.sdk:FBSDKGraphRequestErrorParsedJSONResponseKey={
body = {
error = {
code = 200;
"fbtrace_id" = "EN9bN/YMloA";
message = "(#200) Application must be associated with a business. https://business.facebook.com/";
type = OAuthException;
};
};
code = 403;
}}
But if I try my app in Graph API Explorer then I'm getting the required data. So now it confusing me.

Error! When sharing a post to Facebook in background

I am using a API call to share a post to facebook.
I am getting a error when i click a share button.
Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x9289500 {com.facebook.sdk:ParsedJSONResponseKey={
body = {
error = {
code = 2500;
message = "An active access token must be used to query information about the current user.";
type = OAuthException;
};
};
code = 400;
}, com.facebook.sdk:HTTPStatusCode=400}
How can i solve this issue.
Any help is appreciated.
code 2500 means that FBSDK failed to retrive user information; check whether your FBAppId is correct with all settings
You have to integrate the latest Facebook SDK into your project from the following link:
https://developers.facebook.com/docs/ios

Facebook iOS SDK - extend expired token

I am having hard time trying to get the new extending-an-expired-token flow work.
When first-time user sign in the app over Facebook SSO, the token returned by Facebook usually expires in roughly 2 hours.
Facebook iOS SDK documentation makes the case simple.
extend expired token
So, I called "extendAccessTokenIfNeeded" according to the documentation. However, token refresh never happens. In the iOS SDK source, there's a global int const "kTokenExtendThreshold" set to 24 (hours).
My "extendAccessTokenIfNeeded" never invokes the real extend token logic.
To do a test, I called "extendAccessToken" instead.
Facebook returns the following error on this call:
Error Domain=facebookErrDomain Code=101 "The operation couldn’t be completed. (facebookErrDomain error 101.)" UserInfo=0x87e8820 {request_args=(
{
key = method;
value = "auth.extendSSOAccessToken";
},
{
key = format;
value = json;
},
{
key = sdk;
value = ios;
},
{
key = "sdk_version";
value = 2;
}
), error_msg=Invalid API key, error_code=101}
What the hell is going on?
I really appreciate any tips and comments. Is it that I missed something?
Thanks
Bill

Resources