Watch App terminates upon deactivation if WKAlert is being shown - ios

I'm creating a watch app and I'm noticing that "Program ended with exit code: 0" is shown in the debug window if the watch app is deactivated (via cmd+shift+h, lower wrist, etc). The code I'm using to present alert in the WKInterfaceController is:
presentAlert(withTitle: alert.title, message: alert.message, preferredStyle: .alert, actions: [cancelAction, continueAction])
I'm trying to understand why the watch app is closing with no error if a wkalert is visible and active on the screen. The memory of the app is under 20mb and doesn't spike at all when the alert is shown. On every other screen the app simply deactivates. Maybe there is a workaround? Any help would be appreciated.
Thanks - Ross

I reported this bug to Apple:
Summary:
Displaying an Alert will crash App (code 0) if Alert is presented and home button is pressed while displaying a modal view.
Steps to Reproduce:
Display a modal view on Apple Watch then display an Alert. Taping Home button or when screen goes blank the App will crash with Code 0. With attached file tap the Modal button then the PopUp button then on simulator press cmd-shift-H or on watch allow screen to go blank. App will crash with Code 0.
Expected Results:
App should not crash. Displaying with Push segue style instead of Modal will not cause crash.
Actual Results:
crash with Code 0
Version:
iOS 3.0 and iOS 3.1
After reporting this bug to Apple they responded but I am unable to provide the log feedback they requested:
This is a follow-up regarding regarding Bug ID# 29131322.
Engineering has requested the following information in order to further investigate this issue:
Could we get a sysdiagnose from the Watch right after the crash?
Thank you.
Please provide your response or results by updating your bug report and compress any bundled files (e.g. nested folders) prior to uploading.
watchOS sysdiagnose Instructions:
https://developer.apple.com/services-account/download?path=/iOS/watchOS_Logs/sysdiagnose_Logging_Instructions.pdf
watchOS Logging Profile:
https://developer.apple.com/services-account/download?path=/iOS/watchOS_Logs/watchOS_logging.mobileconfig
If you could provide the log feedback and attach it to bug report 29131322 that might help get it fixed.

Related

App Screen Goes black when tap on UIAlertAction

I am working on existing swift app written in Swift 4.0. I am getting strange issue in any of screen If I tried to use UIAlertController with UIAlertAction in form of alert or action sheet. As soon as I tap on UIAlertAction Button complete screen goes black(Blank) and I need to force quit to restart app, I am getting this on iOS 14.7.1....
I tried to use alert on Main Thread, added scene delegate as well as Deployment target is iOS 13.0 But no luck and interesting part is If I run app with Xcode everything works fine but if I tried to use app on device directly without run, getting this strange issue....Any Suggestions...
Thanks in advance....
I got solution for now, after seeing Debug View Hierarchy I got on tap of UIAlertAction, it remove window that's why complete app goes blank, So I created new window for showing Alert. I followed this stack OverFlow Answer Every UIAlertController disappear automatically before user responds - since iOS 13
May be it helps someone....

iOS 14 app killed immediately after being minimized and receiving snapshot warning

My IOS 14 app is always being killed immediately when it is being minimized. I have already added background modes: background fetch and background processing. However, when the app goes into the background and I switch to another app, XCode is telling me this:
Snapshotting a view (0x7f91ed844000, UIKeyboardImpl) that has not been rendered at least once requires afterScreenUpdates:YES
So I thought maybe the app can't create screenshots for the app switcher and Apple then just kills the app. My problem is that the message doesn't tell me how I can add this to the view. The documentation doesn't help me either also Google and searching here doesn't help. Everything I find is about how to take a screenshot and save it somewhere which is not what I am trying to do. Does anyone have an idea how I can approach this problem?
Thank you very much!

iOS Request permission dialog not showing on screen recording or quicktime video

Does anyone know when the App Store started requiring the app previews to be on a physical device and show this pop-up?
Even when I mirror my iPhone Xs to my Mac, the pop-up does not show. If no pop-up on video, app store rejects app preview.
Anyone know of a better way to get around this issue?
Another image that shows issue:
This pop-up NEVER shows on screen recording or mirroring....
We have same problem. You have two options:
You can record the screen from another mobile or camera
You can use a previous iOS. We have checked that permission dialog can be screen recorded with iOS12
What was your solution?
Yes,  has been steadily, over the past 3'ish years or so, working on removing certain system sensitive controls from being displayed in that feed. My guess it's for $SEKURITY reasons, though it doesn't completely make sense, to me, what would be the attack vector that it attempts to prevent.
The location dialog is not the only case I know that it hides. It originally started with them hiding even *** in the password text fields, and hiding the keyboard in such input, as well. Apparently it now expanded to location, and likely other system dialogs. 🤷‍♂️
Surprisingly few people seem to be discussing this.
I published an app last year (2021 / June) on 14.? which required the popup and it was accepted. Did this again with another app just after 15.? and I cannot get it past the apple store. Once they allowed me to post a video recording and I got it through, but since then ... no chance.
How are people getting their app through - I assume apple use the screen capture system to do their testing.
I had the same problem but my app was accepted.
Surely screen recording does not work, but screen capture does. I have embedded a screenshot of the permission dialog into a video and submitted it for app review.

How to reopen last view while open the app after terminating in iOS

I am very new in iOS application development so don't have any special idea about the resources available in iOS development.
I want that if I am on a particular view and then I suddenly terminate the app by clicking on "Home" button, then while I open the app again, it should open the last page on which I was while terminating the app. Since the app is not terminated, it was in background.
I can show the snapshot of my storyboard if it can describe my question in a better way-
In the screenshot, when I open the app after closing it, if I am not logged in then when I will open the app, Login screen (1) will open. And if I am logged in then (4) will open. That is correct. But suppose if I was on (5) before closing the app, then also it opens (4), that should not happen. How to control that?
If someone have any idea about that, please share.
Thanks in advance.
You can see reference here
https://developer.apple.com/videos/wwdc/2012/?id=208
and here
http://useyourloaf.com/blog/2013/05/21/state-preservation-and-restoration.html
And here
https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=ios%20restore%20state%20stackoverflow

iOS restore state issue

I recently upgraded my old iPhone app and the new state restore iOS 3/4 feature has introduced a problem. I don't know the name of this restore state feature - what is it called?
Here is my problem scenario:
I navigate into a detail screen on my app. I click a button to navigate to an address and it launches google maps as expected. Then I launch my app again. It briefly shows the last screen I was on, but immediately launches the google map again.
What I want is to simply restore the detail screen that I was last on.
Any hints?
thanks
It is called multitasking, and it is built in automatically when you build under iOS 4.0+. Without you posting any code, it is tough so say, but why don't you put a breakpoint at the line that redirects to Google Maps and see what is calling it. Then you can backtrack to see why it is being called on the reopening of the app.

Resources