How can I prevent iOS standalone web apps from locking up the device?
Asked Answered
U

2

11

My prototyping service creates standalone, isntallable iOS web apps. Sometimes they lock up the device while in use.

The home button stops working, the app continues to work. The following is shown repeatedly in the device's console (retrived by attaching to xcode).

Apr 25 14:34:57 SpringBoard[67] <Warning>: Unable to determine intended instance of com.apple.webapp. Resulting app will be undefined.

Unnecessarily answered 25/4, 2013 at 22:18 Comment(4)
Did you save the app to the home screen?Hoiden
Yes, it is installed to the homescreen.Unnecessarily
Having the exact same problem, all of a sudden the app locks up the device, but the app continues to work. Home button etc non responsive. Seeing the same error message when attaching to Xcode. Would love to hear if you find a solution.Deerdre
Be sure to file a bug with apple too! bugreport.apple.comUnnecessarily
S
4

Since the cause of this is still unknown, I thought I'd contribute by telling you that I'm getting the exact same problem with an HTML5 app on IOS 6 with iPhone 4s. In my case the app does not lock up (still works) but home button stops working (exactly like you and Jens). The timing is random, and does not seem to be tied to anything I can do to replicate it consistently. Also when it happens, window.orientation always incorrectly reports portrait mode, even when device is physically in landscape (on the iPhone).

UPDATE 12/15/2013
1) Detecing this bug: I've been able to trap when the error occurs on the iPhone. My app works in landscape mode, and normally they can flip to landscape at any time. But to trap this bug, it now detects if the app is running on iPhone and throws up a roadblock page that requires the user to rotate their device to landscape to start. During this time the app looks to see if the gyroscope indicates the device is correctly in landscape mode, but windows.orientation (incorrectly) says it's in portrait. That only happens when the bug is triggered. So, then I can show a nice message telling the user how to recover. Note: this method only works on the iPhone... I haven't yet figured out a solution to detect it on the iPad.

2) Avoiding this bug: I found one way to avoid the problem from occurring (with a little extra work). I've noticed that after cleaning up the way my event handlers work, the problem only occurs on subsequent loads of the app…not the very 1st time I load it. And I also noticed that after closing the app, it's still running in the iOS "task list" (not sure what the proper iOS term for this is).

So double press the home button to bring up the task list and swipe it away (to truly close it). I've never had the problem recur after following this. Additional note: simply doing a reboot of the device is not enough (and seems to still result in hangs). And after a reboot, I've noticed it will be in the task list twice (which seems wrong and perhaps a clue on what's going wrong internally). Anyway, if you rebooted, before starting the app, make sure you go to the task list and remove all instances of the app first.

Sulfuric answered 9/5, 2013 at 18:23 Comment(3)
I'm experiencing the same issue with my 4S and iOS 6 as well. Hopefully this is something that they will fix for iOS 7.Waddington
confirmed this is still happening on iOS 7 :(Sulfuric
On iOS7, I came up with a way to replicate it every time (at least for my app): 1)rotate phone to landscape 2)lay phone flat!! 3)launch app In addition to locking up the home button, I found that it also caused event listeners to stop working. Also, the iOS status bar gets stuck and doesn't move to the top of the screen when shifted back to landscape mode. However, when I commented out all event listeners for orientationchange, resize, load, touchmove, reliability improved greatly. Unfortunately it still hangs, but only 1/5 the time as before. Not a fix, but perhaps a clue.Sulfuric
S
1

The SoundJS team has tracked this issue down to the web app entering full screen mode using:

<meta name="apple-mobile-web-app-capable" content="yes" />

A bug was reported to apple (reference #15133492).

Currently we have no work around except not entering full screen mode.

Seow answered 7/10, 2013 at 22:45 Comment(2)
Yes, that is what I meant by 'standalone web app'. Let me know if you and your team figure anything out!Unnecessarily
@Seow (love SoundsJS BTW!). On iOS7, I found a way to replicate every time (at least for my app): 1)rotate phone to landscape. 2)lay phone flat!! 3)launch app. In addition to locking up the home button, I found that it also caused event listeners to stop working. Also, the iOS status bar gets stuck and doesn't move to the top of the screen when shifted to landscape mode. However, when I commented out all my event listeners reliability improved greatly! Unfortunately it still hangs, but only 1/5 the time as before. Not a fix, but perhaps a clue. REALLY hope apple responds to your bug.Sulfuric

© 2022 - 2024 — McMap. All rights reserved.