I heard that apple prevent from programmers to toggle airplane mode on and off, there is option to pop up message to the user then he will decide what he want to do? if yes how could I do it?
Check if there is a network connection, if there is none
Present the user with an alert with options such as Cancel and Open Settings, if the user chooses to open the settings app
Navigate to Settings app. See this to see how to open Settings app from your app: Opening the Settings app from another app
Related
So we have a task that app1 needs to copy some data to clibboard then open app2 which reads this data from clipboad and uses it. This is already implemented and works. But the first time app1 need to access app2 iOS wanted me confirm that action with the following dialog: "app1 wants to open app2" with options to Open or Cancel. I pressed Open and now it never shows this dialog. However we need this dialog because we want to thorougly test this process, including the case when user presses Cancel. Is there any way to bring this dialog back without wiping our iphones?
We have tried:
Reinstalling both app1 and app2
Restarting device
Enabling and disabling developer mode (ios 16)
Enabling and disabling lockdown mode (ios 16)
Changing system time forward
None of these actions made this dialog to appear again. Wiping and reactivating and iphone will work of course but maybe there is a faster way?
Try deleting "app1" before re-installing it. When you just install a new app over the old one, the data associated with the old one remains in place. Deleting the app first should remove it and hopefully remove the permission to launch "app2" in the process.
Try the following:
Open the iPhone Settings app
Select "General"
Select "Transfer or Reset iPhone"
Select "Reset"
Select "Reset Location & Privacy"
If that doesn't work, select "Reset All Settings"
Device : iPhone 5 / iOS 9.3
I have an iOS app which I need to launch from a website. I was able to do it via custom URL scheme.
When I click the "Open App" button in the website, an alert dialog appears that says "Safari wants to open MyApp" with OK & Cancel buttons.
Clicking OK : everything is just fine. The app gets launched from the website perfectly.
Clicking Cancel : First time, it just dismisses preventing the app being launched, which is correct.
When I click on the "Open App" button once again from the website, I expect the same "Safari wants to launch MyApp" alert dialog to appear once again, which is not happening.
Instead, it shows a dialog that says "Cannot Open Page - Safari cannot open the page because the address is invalid" with an OK button.
My assumption was, every time when you click on that link in the website (that can launch the app via custom url scheme), I should be prompted with "safari wants to open MyApp" alert dialog all the time.
What am I missing here ? Appreciate your help in advance.
It's a known behavior.
If you tap on facebook://feeds:
And open it then Safari won't blacklist the facebook scheme for that Safari tab. You would be allowed to open facebook://profile, facebook://feeds, facebook://settings, etc. on that tab
However if you click on 'Cancel' then you're no longer able to able any url with that scheme for that tab only ie you won't be able to open facebook://profile, because it's been blacklisted for that tab.
What should you do?
Open a new tab and try again. It would no longer be blacklisted for that tab.
It would have been much better though if Apple prompted its user with options like:
Deny once. Deny Always. Allow Always
But I'm guessing if they did that then they'd have to provide alternate ways for the user to customize behavior per host/scheme. Obviously Apple doesn't want to allow that.
I met the same problem when using Google Tag Manager in my code. Try the javascript event for opening the app instead of using the href of the tag a.
I was getting a similar error, fixed it by allowing "Installing App" in restriction(Settings->General->Restriction), enable the toggle button. It is by default enabled but I restricted it in past by disabling the toggle button.
Hope this helps anyone.
I just fixed the same problem on an iphone. Go to settings> General> Restrictions> Safari. Make sure it is "allowed" or turned on (swipe to green). Exit out of settings and retry. It should work.
I am working on an app in which I need to open the device settings app on button client rather than app settings. I am using UIApplicationOpenSettingsURLString - but this opens the app settings page not the root level for device settings.
So, may I please get some suggestions on how to open the device settings app and may I also know is there any possibility to open the wi-fi settings page in the device settings programmatically.
You con only open the app-settings as you mentioned above.
If it would would it would also be listed in the documentation:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/#//apple_ref/doc/constant_group/Settings_Launch_URL
Even Apps like GoPro or Twitter just give instructions how to enter the settings rather then linking directly.
I want to know if there is a way to open "Settings" of the device, where are Wifi Toggler, Data Toggler, Air Plane Toggler...
I have a shortcut to "prefs:root=WIFI", but I don't know If I can open this WIFI settings and simulate a click on a back button to go to Settings.
I'm developing on iOS 7 and greater.
Thanks.
As I just read, this is not possible. Answered by #richard-venable in How to open Settings programmatically like in Facebook app?.
There is no URL you can use to get to the root level of the Settings app.
You can send the user to your app's section of the Settings app using UIApplicationOpenSettingsURLString in iOS 8.
Thanks to #saurabh-prajapati for the comment.
I have an app where I'd like to open the Settings.app so the user can enable Wi-Fi or mobile data, but when I use
UIApplication.sharedApplication().openURL(NSURL(string: UIApplicationOpenSettingsURLString)!)
I get redirected to my custom settings, where I have an option for Notifications and one for Use Mobile Data.
Is there a way to either
Disable these custom settings, or
Show the main settings view, or
Another way to redirect the user to the Wi-Fi settings?
No Apple, only allows you to open the settings app on with your now app settings selected.
As for you your apps settings you want to disable, this is also not possible since these are the defaults settings for each app.