ACAccountStore Error 5 - ios

When attempting to save an account into an ACAccountStore, I sometimes receive this error. Later, if I attempt to access this account, I find that it's actually been saved. So far, I've yet to find any information about this nondescript error. Does anyone know what it means?
Error Domain=com.apple.accounts Code=5 "The operation couldn't be completed. (com.apple.accounts error 5.)"

This question is a little dated, but I'm struggling in the same area. Here's one thing that should help: I did find documentation on the error codes:
typedef enum ACErrorCode {
ACErrorUnknown = 1,
ACErrorAccountMissingRequiredProperty,
ACErrorAccountAuthenticationFailed,
ACErrorAccountTypeInvalid,
ACErrorAccountAlreadyExists,
ACErrorAccountNotFound,
ACErrorPermissionDenied,
ACErrorAccessInfoInvalid
} ACErrorCode;
I found this in the documentation under the Accounts.framework link.
Interpreting this gives error=5 being "Account already exists" and error=6 being "Account not found." I'm hopeful this makes the errors a little less "nondescript."

This error occurs because you didn't set the Facebook account in the settings. The settings are available in iOS 6. Set that account and then try again.
Also give proper alert message on error.

While I didn't find any documentation to support (or contradict) my findings, here is what seems be changed (since iOS 5):
In iOS 5, the user is prompted with access request even when there are no Twitter accounts setup. In iOS 6 it seems the request is declined with error code 6 when there are no accounts setup.
In iOS 5 the user is prompted again (and again) with access request if the user had previously disabled access to said account from Settings > Twitter. Now, in iOS 6, it seems access request is silently declined (with no error, i.e. nil error) if user has removed access to app from Settings
If anyone else finds a better answer, do comment, please.

Related

swift - Sign in With Apple "Sign Up not completed" error

Made all the setup for sign in with apple, but when pressing on continue and passing Face ID check I am getting "Sign Up not completed" error. However, no error is thrown to the delegate.
Then I tried to create a test project with my friend's Paid developer account and everything was fine, no errors. I haven't connected to the API, just trying to print Email and Fullname.
May be something is wrong with my company's Developer account?
I had the same issue. I did followings and it was working fine.
Go to developer apple and choose app's bundle id
Remove Sign In With Apple and save
Again go to your app's bundle id and add Sign In With Apple and save.
Hope this works!
I had created Auth Key with Apple Sign selected in which is never used. When I remove the unused Auth Key it worked.
I recently encountered this error and the root problem turned out to be some back-end data problem with my Apple account.
I ultimately had to raise an Apple Technical Support Request, generate some debug information for them, and then they ultimately fixed their back-end data for my account. The overall process took just under three weeks.
For me the reason was , I was using my bundle id in the place where Apple services ID should be entered in cognito user pool.
As suggested on this SO thread, this is sometimes an issue one Apple's end. I have tested with Apple's own project from the documentation and ran into the same issue.
I reached out to Apple DTS support and they replied the following:
The underlying issue was unexpected. We have confirmed the issue was
caused by an internal data feed sync operation and was resolved today.
So in my case, the issue went away after 2 days without any changes.
Sometimes, it just takes 2 days on Apple's side to process everything.
Spare yourself the hassle and just wait it out. If you have followed their documentation you did everything right:
https://help.apple.com/xcode/mac/11.0/#/dev50571b902
Just go to your project's signing capabilities, click + and add Sign in with Apple:
Add the SignInWithApple Button:
import AuthenticationServices
...
SignInWithAppleButton(.signUp) { request in
request.requestedScopes = [.fullName, .email]
} onCompletion: { result in
switch result {
case .success(let authResults):
handleSuccess(authorization: authResults)
case .failure(let error):
logger.error("SIWA login failure: \(error)")
}
}
.signInWithAppleButtonStyle(.white)

IOS CNContactStore executeSaveRequest fails with CNErrorDomain Code=500

When attempting to save a contact that has populated Social Profile data the following error is encountered: This is seen in iOS 9.2
Domain=CNErrorDomain,Code=500 "(null)"
UserInfo={CNKeyPaths=(SocialProfiles),
NSUnderlyingError=0x1612681f0{Error Domain=ABAddressBookErrorDomain
Code=0 "(null)"}}
I am serializing a contact that already exists in a different phone's address book and when I look at the attributes for the Facebook social Profile Inotice that the UserIdentity attribute is nil (null).
I'm not sure if I am just missing some knowledge on how this works and this is expected behavior, a usage problem or is it a defect?
Solved. The issue was that the default contact account was an exchange account. The socialProfile save is not allowed in this type of container. Solution is to remove the unsupported property and attempt the save again.

Can't send tweet anymore: plugin com.apple.share.Twitter.post invalidated

My app uses an SLComposeViewController to post to Twitter. This worked for a few months and then suddenly stopped about a week ago. The Twitter share view allows me to press "Post," and the following code still gets to the "..." line:
twitterComposeViewController.completionHandler =
^(SLComposeViewControllerResult result){
if (result == SLComposeViewControllerResultDone){
...
}
};
and dismisses the Twitter share view, but the tweet fails. I get a alert view that says,
Cannot Send Tweet
The tweet "[my tweet text]" cannot be sent because the connection to
Twitter failed.
A moment later, the console logs,
plugin com.apple.share.Twitter.post invalidated
I have looked at some similar questions on SO, but none has an applicable answer (my tweet is not over the character limit; I am properly logged in; etc.). I have checked my settings at apps.twitter.com, and I don't see anything unusual.. my consumer key and secret have not changed...
Anyone know how to get more information about the error, or what I should check? Thank you.
I found that strangely iOS has cleared out all of my Twitter account passwords. The accounts were still listed and the error said NOTHING about failing authorization, but that was the issue.
If you go into 'Settings' and 'Twitter', when you click on your account it will say 'user name or password is incorrect'. Fix the info and you will be all set.
Terrible error message, no idea how the average user would think to check that.
This problem occurs if you are trying to post same tweet more than once. You need to post different tweet every time.

Error: Failed to load skin for error: NSURLError Domain

Does anyone know anything about this error: "Error: Failed to load skin for error: NSURLError Domain"
After trying to open a download link in order to reskin an app on an iPad, I get the above error. The interesting/annoying thing about this is that it is not followed by any error code, which is making it difficult to search for in the forums as all of the results that I get include an error code e.g.: "NSURLErrorDomain error -1012"
The re-skinning has worked for another skin, but not for the one I'm working on now.
Any ideas? Any recommendations for diagnostic tests etc.?
NSURLErrorDomain error -1012 is kCFURLErrorUserCancelledAuthentication, meaning that the server issued an authentication challenge that was subsequently rejected. Causes for rejection vary, but could be invalid password supplied, or because the authentication challenge was not handled at all. It's hard to say without seeing the code.
Have resolved this now. Turned out that the URL I was using was simply incorrect.

Facebook iOS 3.1 SDK: can login with Safari but not natively

I'm integrating the iOS 3.1 Facebook SDK. When implementing a login with Facebook feature, I call FBSession openActiveSessionWithReadPermissions:allowLoginUI:completionHandler:. When called on the simulator (where I don't have a FB account set up natively) I can successfully login.
However, from a device with a native Facebook account setup, when calling openActiveSessionWithReadPermissions... the session type returned in the completion handler is always sessionStateClosedLoginFailed, regardless of whether I allow or disallow my app to use Facebook in the alert dialog. The session state before calling the method is sessionStateCreated.
This is the NSError from the completion handler:
Error Domain=com.facebook.sdk Code=2 "The operation couldn’t be completed. (com.facebook.sdk error 2.)" UserInfo=0x20a80820 {com.facebook.sdk:ErrorLoginFailedReason=com.facebook.sdk:ErrorLoginFailedReason, com.facebook.sdk:ErrorInnerErrorKey=Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (No value.) UserInfo=0x208ed930 {NSDebugDescription=No value.}}
What am I doing wrong that would cause this problem?
Update: I just noticed that my app is not appearing in the Settings > Facebook > "Allow these apps to use your account' section. (It was definitely there earlier today).
Update2: If I delete my account from the iOS Settings app, and then log my test user into the Facebook iPhone app, I am able to login with fast app switching. So it appears to only be a problem with the native account.
Update3: I ran the sample Facebook app Scrumptious I have the same problem. Upon clicking 'Login', which calls the openActiveSessionWithRead... I get the same error.
Update4: Possibly related to this bug? http://developers.facebook.com/bugs/450137751688028?browse=search_50a43a39b37ae4868318658
Update5: I should have mentioned this earlier, but it was a Facebook test user account that had this problem.
I switched from using a Facebook test user account to a regular account and this solved the problem on both the Scrumptious app and my app.
Have you set the FacebookAppID in your plist? See "Adding your Facebook App ID" in section 5 of the Getting Started with the Facebook SDK. Also, check the "Facebook" section of your device's settings to make sure your app hasn't been unauthorized (in which case it won't be authorized unless you manually do so).

Resources