UIWebView disable location prompt - objective-c

Is it possible to disable the location prompt (or auto decline/accept it) that pops up when you visit certain websites that ask for locations? I am not using a MKMapView because my app will be not be just viewing maps (it just may visit websites that might have maps on it).
I'm guessing since the prompt is not being controlled by my app, but by the iOS system, I probably will not be able to auto decline/accept the dialog.

As far as disabling the prompt from within an IOS app while loading a UIWebView, it is possible.
You will need to intercept the html before it gets loaded into the UIWebView then find which part of it triggers the GPS/Location Prompt. Once you found it, you simply remove it from the html then feed the html into the UIWebView thus 'disabling' the prompt. However, as a result, the webpage will be missing that element.

No, it's not possible to do that. Not with UIWebView, not with any iOS browser.

I know no way to prevent the prompt, I hope it will be implemented as a property of the UIWebView.
The dialog is not there for the safety of the user, when it comes to UIWebViews. The app containing the view has already asked for locations access, and it can be enabled and disabled on settings. To ask for location access both from the app and from the web view, I would regard as a bug.

Related

Apple's latest (2015) 'link to app store' directive causes unwanted Safari behaviour

I want to add a link from my app to another of my apps on the appstore.
Question How to link to apps on the app store showed that the itunes.apple.com link was,until recently, the normal way to go. I've tried this and everything is fine. The problem begins when I disgard this and use Apple's new recommendation of using appstore.com. I use the following line of code:
[UIApplication sharedApplication] openURL:[NSURL URLWithString:#http://appstore.com/myappname"]];
The first time I call this from my app it works well. You see it jump through Safari and move onto the appstore where it displays my app.
At this point if you look back into Safari you will notice a new blank tab labelled Favourites has been created.
If I go back to my app and perform the same action to link to the appstore again I'm prompted with one of the two popup boxes:
"Open this page in "App Store"? [Cancel] or [Open].
or
"Cannot Open Page. Safari cannot open the page because the address is invalid" [OK]
I've found that manually deleting the blank tab in Safari will allow the link to work properly but this behaviour isn't what I want my users to see- and I wouldn't be expecting them to delete the blank tabs from Safari.
Any advice on stopping this behaviour whilst following Apple's new rules greatly appreciated.
A simple and clean solution is to present an instance of SKStoreProductViewController inside your app (modally) to display information on the products you are interested in. The user can interact with it as a small view on the App Store and you can simply dismiss it when done.

WinRt WebView control handling navigation within the control

I have a Metro app using a WebView control. I'm using NavigateToString to load a html file which may contain hyperlinks. What I then want to do is detect when one of these hyperlinks is selected and, instead of allowing navigation within the WebView control, to launch IE and view the page there instead.
Is this possible within the WinRT constraints, and if so, how?
So far, I've tried capturing the WebView_LoadCompleted() event, but although it does fire at the right time, I can't see any details about the URI from the NavigationEventArgs.
Unfortunately this isn't possible directly because WebView does not include events like Navigating (which were present in Windows Phone).
Luckily Nick Randolph (brilliant Windows Phone and Windows 8 developer) has created a workaround using script events. He's got a great write up on his blog:
http://nicksnettravels.builttoroam.com/post/2012/04/21/Limitations-of-the-WebView-in-Windows-8-Metro-Apps.aspx

Is it possible to prevent the user from using Safari on iOS?

I need to remove or at least make it impossible for the user to run Safari on an iPad.
Instead, the user should use a far more restricted browser that we will provide.
Is this possible?
With jailbreaking possibly, without jailbreaking, no.
Actually you can. Go to Settings > General > Restrictions, enable them, and turn off Safari. You can find more information on Apple's website.
If you mean to open url in your app by using your own webview instead of opening safari, you can register your class with the UIWebViewDelegate protocol and implement the method – webView:shouldStartLoadWithRequest:navigationType:
Inside this method, you can deal with the url and return NO, so that safari won't be opened.

Facebook Page Tab app not appearing to non-page admin users

I am experiencing a problem similar to 2 others who have recently written about this issue.
A newly created Page Tab Facebook app displays for admin users but not for regular users.
I only have 8 page tabs currently so it cannot be that there are too many.
Also, sandbox mode is disabled ( have tried both enabled and disabled).
Can anyone think of a reason that this might be occurring?
I added the tab with the code:
http://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&next=YOUR_URL
Could it have something to do with https in the url as opposed to http?
I am at a loss and do not know how to go about solving this issue.
Any ideas, however far-out they may be,would be aprreciated.
Thank you to anyone who might think they can help...
Have you forgotten to take the app out of Sandbox Mode? (try toggling it just in case, even if it's not in sandbox mode, as this is by far the most likely explanation here)
Also, check there aren't demographic restrictions set on the app or page via the API, as in this case only the users that meet the restrictions will see the tab. (though the admins will always see it)
Also check that you've configured the Page Tab URL and Secure Page Tab URL settings for the app correctly, as if a user uses HTTPS and the App doesn't support it they won't see the tab
If the tab isn't appearing at all it's almost certainly one of those two problems ,if it's displaying but the content isn't rendering, also check your code and make sure it's not fataling on checking the signed_request for non-admins or something like that

Is it possible to enable or disable VoiceOver within an iOS app?

I would like to be able to turn VoiceOver on or off within my iOS app. The reason for this is I am trying to help a person with disabilities which render her unable to read messages (hence the need for VoiceOver), and who is also unable to triple click the home-button due to motor coordination problems. The way to the setting through Settings>General>Accessibility>VoiceOver>VoiceOver>Flipswitch is far too long and complicated.
Is it possible, without jailbreaking the device, to change this setting in an app? The app doesn't need to make it to the App Store, if that helps.
Alternatively, is it easy to do this with a jailbroken device?
Another approach may be to simulate the triple-click on the home-button that automatically turns on VoiceOver. Is there any way to do this?
Get the app aHomeIcon.
Open the app and tap URL.
Insert the url: prefs:root=General&path=ACCESSIBILITY
Tap 'Done'.
Insert a name to be shown below the icon.
Tap the export button at the bottom of the page. Safari opens.
Add a bookmark and select 'to home-screen'.
Now you can tap that icon and you are redirected to the accessibility part of the settings app.
See this link for reference.