iOS Cognito error 13 on one device but success on another - ios

I am running into a strange problem where the user was able to log in previously and now getting error 13 - Temporary password has expired and must be reset by an administrator. However, switching to a different device using the app login succeeds. Any ideas what needs to be done to clear cache or keys or anything else that is needed?

Related

Safari failing to send valid GET request using Angular's HttpClient

When sending a GET request in Safari, Safari is failing to send a valid request to the server. In fact, it isn't even reaching the server (I've checked this on the back end). Its also failing to provide all but two of the request headers and the response is null (which results in safari logging a kcferrordomaincfnetwork error 303 in the console). I've attached some screenshots below along with some additional findings. Can anyone provide any insight?
Screenshot of the request when it fails
Screenshot of the request when it passes
Issue is only reproducible in Safari on iOS devices.
Issue was happening on the MacBook previously. After clearing the website data once, we never saw the issue again
The call is intermittently failing
When setting a breakpoint before the product details call and manually calling it in the console, it fails the first time and then passes the second time.
Sometimes it isn’t the product details call that is failing (although it usually is)
Sometimes it is the create app or get product image call that fails.
Issue seems to go away after clearing website data, but comes back after one successful session.
When the call fails, we are getting the following error in the console: kcferrordomaincfnetwork error 303
Session storage is empty and issue persists
No exceptions are occurring (I enabled "break on all exceptions" in Safari)
Try running ng serve with the --no-live-reload option. We were seeing similar behavior, and WDS may have been interrupting the HTTP calls. So far, this has solved our problem.

Keychain access error 25308 (errSecInteractionNotAllowed)

In one of my iOS app, I am seeing multiple crashes while accessing the Keychain (in both cases i.e. setting an item & getting an item) and the error code is 25308.
Few details:
1) I am using a 3rd party keychain wrapper https://github.com/kishikawakatsumi/KeychainAccess
2) The accessibility option is set to 'whenUnlockedThisDeviceOnly'
3) This is not happening to all users. I am unable to reproduce it by any chance.
4) I am accessing keychain at few places in AppDelegate. Few crashes are reported on app launch and few are reported on Firebase token refresh notification observer method.
5) In didFinishLaunch, I am trying to access the value for a keychain item where as in Firebase token refresh, I am trying to set the new token value to the keychain.
On my findings I understood that this error code 25308 will be returned when user tries to access the keychain when a device is in locked state. But my Fabric (crash reporting tool) shows that the 'App is in Focus' in all these crashes.
So this got me confused with multiple questions like:
1) What else cases can throw this error 25308 other than device unlocked state?
2) Does firebase token refresh notification causes this background launching of app ? If so, how can I reproduce this. (One supporting thing here is I know that app was not uninstalled)
Update on 01/03:
It seems like the root cause for this is 'App is being launched when Firebase generates a new token and this launch is happening when device is in locked state, hence keychain access is throwing such error 25308.' So is anyone aware how a new firebase token launches the app which is already in terminated state??
Appreciate your responses on this. Thanks..

Voip Push: Under what circumstances does didInvalidatePushTokenForType get called?

The documentation for didInvalidatePushTokenForType says its optional to implement and also says this
This method is invoked if a previously provided push token is no
longer valid for use. No action is necessary to request registration.
This feedback can be used to update an app's server to no longer send
push notifications of the specified type to this device.
Why on earth therefore would somebody not want to implement this? If the token is no longer valid then a server will never be able to send Voip pushes to that device again, so doesn't the app on the handset want to know as soon as possible if its invalided so it can send a new token to the server?
I've been trying to search for info and use of didInvalidatePushTokenForType() but it seems everybody just copy and pastes this method into their source code because everybody else has copy and pasted it. But nobody seems to ever do anything with it.
But seems to like it should be a vitally important method to make use of, so why does nobody apparently?
When would the token become invalid?
Thanks for the asking great question.
1) When would the token become invalid?
If we are update app from the App Store then APNS token doesn't change.
reinstalling the OS or Update OS or Reset iOS device then APNS token does change(Upgrade or downgrade OS).
Device token Invalidated or expired after 2 Years.
iOS9 and later device token changes if I reinstall an app.(As per my experience and Knowledge).
Download app from App Store then run your code using X-Code in this case device token will change.
2) Important of didInvalidatePushTokenForType() or Why? didInvalidatePushTokenForType() is optional
Let's clarify about didInvalidatePushTokenForType() method.
Once token got changed then called didInvalidatePushTokenForType() and didUpdatePushCredentials() method, So all code is placed in didUpdatePushCredentials() instead of didInvalidatePushTokenForType().
That's why Developer doesn't give important to didUpdatePushCredentials() method.
Find Reference from Here

GameKit Error says player not authenticated but .authenticated property = true

I have an turn-based game using GameKit in iOS. Generally, my authentication with Game Center works. My game works and I can for periods of time send moves back and forth. However, relatively frequently but not constantly, when I try to perform an action (e.g., finding a new match) over Game Center it fails with the error:
Error Domain=GKErrorDomain Code=6 "The requested operation could not be completed because local player has not been authenticated." UserInfo={NSLocalizedDescription=The requested operation could not be completed because local player has not been authenticated.}
Yet, the GKLocalPlayer.localPlayer().authenticated = true, both immediately before getting the error and after. After getting this error, the authentication viewController does not get presented and GameKit methods that rely on authentication cease to function (they don't come back to life ). Then, if I send the app to the background and then bring it back to the foreground, the error does not return when I retry the action (without requiring new login and password entry).
According to this similar observation:
GKLocalPlayer authentication not working, but isAuthenticated returns YES (Game Center sandbox)
"1.Game Center fails to complete authentication if your device has incorrect dates. So, go ahead and check the current date.
You might have done this. I trust you - iOS Simulator >> Reset Content and Settings"
I am getting this problem on the device, not the simulator, ruling out #2. Could someone help me with #1? I may be naive here, but my iPhone and iPad have the right time and date. Is there something or somewhere else I should be checking and setting?
Then, if this is not the issue, what else could be the problem? I am running iOS9.
I've seen this too, and have an open bug with Apple. In my case, I'm testing with multiple physical devices, and only one of those devices ever encounters this. On that particular device, I'm logged into iTunes using a personal account, but logged into game center using a test account.
From what I can see, when the device is using the same login for iTunes, iCloud and game Center, there are no problems. But, when I try to mix-and-match the accounts for whatever testing I need to do, then I randomly get error 6.
There doesn't seem to be anyway to recover from this, except to have the user re-login into game center. Of course, there's no way to present the login view controller again, so the only option is for the user to leave the game, kill it off, and star up again (which re-starts the game center authentication process). I trap the error now, give the user a message saying Game Center has logged them out, and explain what they need to do about it.
But as I said, when I stopped mixing up credentials on the device, the problem went away.
BTW, on a slightly related topic, I've come to view the .authenticated property as completely unreliable. It will be TRUE in conditions where you do not actually have connection to Game Center. I opened a bug on this, too. Apple closed it saying this was working as intended by using "cached" data. Thus, it will report authenticated when it's not authenticated and give you access only to outdated match and leaderboard data which had previously been saved locally.

Is there a method to simulate (.NotDetermined) status from ABAddressBookGetAuthorizationStatus?

I am developing an App and testing on my physical iPhone.
At some point, the app checks if it is authorized to view the contacts (address book) of the phone using ABAddressBookGetAuthorizationStatus().
That call returns a status which can either be .Denied,.Authorized,.Restricted, .NotDetermined.
The last one is returned if you run the app for the first time, and have never approved or denied the app from accessing the device's address book.
Once you answer that authorization question, that answer is stored somewhere, and in the future, you will either get a .Authorized or .Denied status. Never again a .NotDetermined.
I tried deleting the app, and installing again. I tried changing the compile settings and changed the target build iOS. I did a Clean build, but I failed to get that status again.
I know I can copy the Xcode project and name the app something different to trick the iPhone into thinking this is a new app. But what is a straight forward way to let the app receive a .NotDetermined status again?
Go into the General settings and Reset Location and Privacy. (This will have other side effects, but there's nothing you can do about that.)

Resources