I have a weird behavior happening to me while using the watch connectivity.
I start the session from the AppDelegate's didFinishLaunchingWithOptions.
The user's goes through the login process, and when the user get's to the home screen if the user open's the Watch it seems that something goes wrong with the session.
At this point I get this log:
[WC] -[WCSession onqueue_handleDictionaryMessageRequest:withPairingID:]_block_invoke delegate MCEWatchSessionDelegate does not implement delegate method
[WC] -[WCSession _onqueue_sendResponseError:identifier:dictionaryMessage:] identifier: [identifier] with WCErrorCodeDeliveryFailed
And at this moment if I print the error on the watch if get:
Error Domain=WCErrorDomain Code=7014 "Payload could not be delivered." UserInfo={NSLocalizedDescription=Payload could not be delivered.}
and there is nothing in the login process using the session or anything related to the WatchConnectivity.
If the user opens the watch app on the login screen, everything works as expected.
If I close and open the app again (session get's activated again) it runs normally and the issue is gone.
If I activate the session again from the iPhone app after the watch has tried and failed to send the message, it goes back to normal.
If I dispatch a queue with a delay, activating the session again on the Iphone app to after the home screen is shown, it also work's normally.
The problem seems to happen only on the first time the user enters the application after the installation, manually log's in and get's to the home screen.
I'm working on retrieving steps data within HealthKit. The query all works as expected (I'm only retrieving step data) however I'm having a strange issue with the Health Access modal that appears (see screenshot below - this is NOT my app, just an example screenshot taken from the web)
The issue is when the user soft closes the app (i.e. pressing the home to get to springboard) and then goes back into the app. The modal doesn't want to disappear when clicking allow or disallow.
Looking at the log it appears I have this strange error:
Error Domain=com.apple.healthkit Code=5 "(null)"
Any thoughts? If further info is required please let me know.
P.S. Just an addition to this, I notice that when clicking "Don't Allow" (where the "Cancel" is within the screenshot), I get an alert dialogue stating:
"You can turn on health data categories later in the Health app."
Upon clicking "OK" the Health Access screen still does not dismiss.
P.S.S. Not sure if this affect this but when the Health Access screen appears, it does so with the following message in the Log:
Unbalanced calls to begin/end appearance transitions for <UIViewController: 0x1343f4040>.
Using Appium, when I launched the app then firstly splash screen appeared then login screen with a keypad. Forgot password button gets hidden by keypad. In this case, Appium is not able to locate forgot password. Click here.
How can I handle this type of problem?
I have also used the code driver.hideKeyboard();, then I get the error in the console as
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing
the command. (Original error: Soft keyboard not present, cannot hide keyboard) (WARNING: The server did not provide any stack trace information)
Command duration or timeout: 118 milliseconds
In my app, I have a UIActivityViewController containing standard items like UIMailActivity (and Messages, Facebook, etc). Sometimes, the user will tap one of these activities, but an error will occur that prevents sharing of the item. What ends up happening is an error message will be displayed, but Mail (or Messages etc) will open up anyway with no content.
Is there a way to either:
Prevent the activity from running if an error occurs
Immediately dismiss the activity if an error occurs
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.