How to quit iPhone webapp programmatically - ios

I want to make a couple buttons on my iPhone to control my stereo. I thought I might be able to do this by putting a couple webpages on my homescreen that issue stop, play, next, etc requests to my media server that quit shortly after being opened. Is there a way to tell safari to quit other than crashing it? If not, what's the best way to crash safari? I realize this isn't very elegant, but I really want to have buttons on the homescreen, not in an app, and this was the best solution I could come up with.
I realize I could make the buttons native apps, but I don't want my iPhone running any third party software, even from myself (I have very little iOS programming experience, and even though I'm pretty sure there's a lot of sandboxing/this is trivial, I'm worried I'll mess up my phone). If you think I shouldn't worry about that and think it would be better to make these buttons native applications, or have any other suggestions, please let me know.

Not only is there no need for your web clips to be closed - just issue the command once - crashing Safari is a bad idea at best.

Related

Always on top (on other apps) button in iOS

I am new to iOS development and wondering if it's possible to create a floating button which always stays on top of screen even if you have any other app running in full screen mode?
No you can't do that on iOS, Apple isn't allowing this kind of features (like Messenger on Android for example)
I assume you mean something closer to AssistiveTouch. When turned on in accessibility, it will stay on top of the screen, no matter what app you have open. I recommend reading the Apple Docs for further investigating into this, but at the moment, Apple does not let you do this. Your app can't mess with other apps. It's pretty against what Apple's design guidelines allow you to do.
Is there a work around for what you are trying to accomplish with this? Maybe if you expand your question, I can help.

Can an iOS app interfere with the ipad keyboard?

I ve been getting some reviews on my app about a freeze on the right side of iPad keyboard. I did not even know that could be possible?
Does anyone experienced anything similar?
Any help on this keyboard freeze problem would be really appreciated cause I m little bit lost.
The "right side" of the keyboard is probably a red herring.
There are only two ways you could interfere with keyboard input:
Your input field is rejecting certain characters, but not giving user feedback that you're rejecting them.
You are doing some long-running work on the main thread (like downloading data, reading to/writing from disk, etc.) If this is the case, move it to a background thread.
No it's not readily possible from what I know, due to the strict permissions of the iPad and apple in general it would not be possible for an app to do this without you intentionally "hacking" the iPad. The only thing i could suggest is that the users are downloading malware to the iPad unwittingly through the site that you have made your app available ??

NSLog (or other monitoring event) within UIWebView operations

I'm moderately experienced with iOS, but I'm using UIWebView for the first time on this project.
I'm wondering, is there a way to monitor the line-by-line, internal operations of a UIWebView in Xcode? Maybe drop some NSLogs in there, or some breakpoints? The delegate methods cover the pre- and post-load stuff, but there doesn't seem to be any interface to actually track what the WebView itself does when it loads a page.
Specifically, I'd like to be able to track the app's behavior as each image from a webpage is downloaded and stored. I'm getting some weird errors around an image being unusable on iOS 7, but my PHP/JavaScript swears that everything is fine on its end, and the image seems fine on desktops and on iOS 6. I'm increasingly certain that the problem has to do with the WebView itself, (an answer to a related question seems to suggest it could be about WebKit calls on different threads), and I'd love to breakpoint my way through, or NSLog some key points or something, just to rule some stuff out.
Is anything like this possible? Or is UIWebView a private party that you can only hear about once it's over?
Does it break in Mobile Safari or only in your app?
You can point Safari's web inspector on OS X at Mobile Safari running in the iOS simulator or even on an iOS device (it has to be enabled in settings).
This will allow you to view all the HTTP headers and so on.
Another option is to use something like wireshark to monitor TCP traffic, but that's a lot more complicated.
http://webdesign.tutsplus.com/tutorials/workflow-tutorials/quick-tip-using-web-inspector-to-debug-mobile-safari/

When the device language changes, backgrounded apps quit themselves

I've observed that if I change the device language, and after coming back to home screen, all background processes quit themselves. If I click on a running app icon again, it starts from scratch -- i.e., from application:didFinishLaunchingWithOptions:.
Am I wrong somewhere? What can I do to work around this?
I think this is a nothing odd and a default behavior.
You may want to look into this post if you want to make changes right from inside your application, though I am not sure on how good this is, as I have not personally implemented it.
language change only after restart on iphone
Let me know if you need more help.
Hope this helps you.

Multiple UIWebViews out of memory warning

I am working with some developers who are creating an iOS 5 iPad app for us. I am familiar with coding but my no means an expert. The developers have hit a wall in their code and so I am turning to you guys to check, that there really isn't anything left to try to resolve this problem, before we give up. I've looked around and can't seem to find a straight forward resolution anywhere else, so here's the question to you guys:
The App always has to have four UIWebViews loaded. The UIWebViews need to be able to contain any website out there, be it YouTube, or whatever you can think of (i.e. something like tabbed browsing). We've tried having them on screen and off screen but either way we always run into memory problems.
I know looking to Safari isn't helpful as it's created by the mothership directly, but we're only talking about four UIWebViews here, surely this shouldn't be such a problem? Any ideas...?
Many thanks,
M
There is only one true solution: Create your own equivalent to UIWebView that has only the features that you need, and therefore has a much smaller footprint than Apple's class. I've written such a thing, but it is not public, sorry.

Resources