In-app preferences screen in an iOS 7 app - ios

I'm fairly new to iOS development and I am porting an Android app to iOS 7. The Android app provides a screen that allows the user to change a number of non persistent settings. Because these are not saved, it doesn't seem appropriate to me to expose them, on iOS, as preferences via a settings bundle and the built-in Settings app. So I'm looking at an in-app settings screen, which I understand is allowed - but perhaps not encouraged - by Apple.
Some questions:
Am I correct that an in-App approach is allowed by Apple? Most example code seems to use settings bundles. Am I going to have problems when the app is submitted to the App Store?
I can put the settings UI in a simple UITableViewController, but is there an approved way to expose this to the user? XCode 5 doesn't provide a settings identifier (and icon) for toolbar buttons, and the "Info" identifier (letter i inside a circle) seems to have been dropped too. Should I use a custom icon? Are there any de facto standards?
I haven't seen this kind of UI element before on iOS but my exposure to the platform as a user is limited.

There is nothing wrong with doing an in-app preference (table)view. You won't be rejected for that (this point seems to be way too much exagerated outside the iOS community). There are guidelines that you can follow: iOS Human Interface Guidelines... or not. As long as you don't use private APIs (assuming you know how to access them anyway), you're fine! So you can use a custom icon, the "i" button, or any UI element that convey the reasonable meaning of providing access to more info/preference.
In your code, you can use the class NSUserDefaults (with the standardUserDefaults) to store your preferences.

Many apps have in-app settings. It's fine. Apple even states that it is fine. Just don't have both.
Use a custom icon. Many apps seem to use an icon that looks like a gear.

Related

Open iOS Settings App (top level - not deep link into the App Settings page) - iOS 12/13

I'm working on a iOS App which interacts with different hardware. We access and configure these devices using a "Soft AP" work flow (ie hotspot)
Our preference is to use NEHotspotConfigurationManager to automate the process for the user and in most cases this works fine.
However, in those edge cases where it doesn't (ie iOS 13+ and location services) we'd like to make the workflow as simple for the user as possible.
Currently we have a nice list of steps that the user needs to take:
Press/swipe home
Open Settings
Navigate to WiFi settings
Find and tap the specified WiFi SSID
Return to the App
It's really not pleasant at all.
I'm aware that there is not official way to open the WiFi settings and I can live with that, but recently I was mucking around with the Wyze App and pairing one of their light bulbs and noted that they have manual workflow which opens the top level Settings page - NOT the App's settings. (nb: The Wyze App also has "app settings")
So, after some more reading, I find that UIApplication.openSettingsURLString will open the App's specific settings page, which is cool and everything, but this is not what I need. I'd be really awesome if it was "officially" possible to launch the iOS Settings App and NOT have it open the App's settings, but just land on the top level page.
I know if the App has no settings, this is the behaviour I will get, but our App does (and I can't be changed)
I don't want to/can't use URL schemes like prefs:root unless it can be guaranteed not to be rejected by Apple!
And, yes, I look at a lot of different blogs and questions on the subject, including A Comprehensive Guide to All 120+ Settings URLs Supported by iOS and iPadOS 13.1 - but I'd like to not have the App rejected

Are voice shortcuts for custom SiriKit Intents supported on watchOS?

I’m trying to get a voice shortcut for a custom Siri Intent working as part of an Apple Watch app, but I’m not sure whether that’s possible. Has anyone had success with this or know if it’s supported?
There isn't much code to share in this case, since most of the code is auto-generated by Xcode, but here’s a quick overview of how I have everything set up.
I created a custom Intent with a .intentdefiniton file and separate Intents Extension targets for my iOS app and watchOS app to handle the Intent.
I set up and donate the shortcuts at the appropriate time. I included an INUIAddVoiceShortcutButton in my app so a user can easily add or edit a phrase for the shortcut.
Everything works fine on an iPhone: the shortcut shows up at relevant times throughout iOS, and the Intents Extension in my iOS app handles the shortcut when I say the invocation phrase to Siri.
Since 20% of my app’s users use the Apple Watch app, I want to provide a congruent experience on watchOS. The donated shortcut shows up on the Siri watch face, as expected. I trigger the shortcut from the Siri watch face, and is handled by the Intents Extension that's part of my watchOS app.
When I say the intent’s invocation phrase to my Apple Watch (Series 3 GPS-only), however, it doesn’t work. Siri says:
Checking with the app...
Then a few seconds later:
I do not recognize that command.
I’ve tried this with a separate Intents Extension for my watchOS app, and without. I get the same results in both situations. It works on the simulator, but not on a real device.
I’ve also made sure I have my Watch Extension and Watch App selected under Target Membership for the .intentdefinition file.
I’ve also tried going into Settings > Developer and enabling Display Recent Shortcuts then tapping Force Sync Shortcuts to Watch, but that doesn’t change the behavior.
Are voice shortcuts for these custom intents even supported on Apple Watch? I haven’t been able to tell one way or another with Apple’s documentation. The SoupChef sample project is set up with an Intents Extension for the watchOS app, which makes me think it should be supported. And, since it works on the simulator, that makes me think it should be supported.
However, this page doesn’t list custom intents as being supported on watchOS, so that makes me think they may not be supported: https://developer.apple.com/design/human-interface-guidelines/watchos/user-interaction/siri/
If anyone can help me figure out whether this is supported I’d really appreciate it. I’m not sure if I’m doing something wrong or if this just isn’t supported.
The problem was on my Apple Watch.
I was able to get it working by erasing the watch (Settings > General > Reset > Erase All Content and Settings) then restoring it from a backup.

Is there a way to access and modify iOS settings with Swift?

Are there any classes or frameworks out there that allow my app to access and modify iPhone settings of the device used to visit my app? I know there's plenty of apps out there which (for example) can change the screen brightness of the device, so I was wondering if it's also possible to modify other settings you can manage in the Settings app on your device (i.e. automatic device lock, time and date, etc.).
No this can't be done... What you can do is to open the settings and that's it. Apple does not allow you to change anything outside your application.

Don't need the App Store to make apps anymore?

I recently found a site that allowed me to bookmark the site and then use it just like an app. There was no url bar, it was indistinguishable from an app you would download on App Store. Is this a new upgrade or technology ?
This is not new technology, I don't remember how long it's been out, but I'm pretty sure at least since iOS 3. It's called a webclip. You can do quite a bit with a webclip but are still limited to functionality provided by JavaScript, so no accessing the flashlight and certain hardware features (although many are being included in the device JS object). Though it is certainly much easier to implement basic app functionality!
+1 to SnoApps and here's a bit more detail about this older detail.
You can specify a webpage to appear like a regular app icon on the iPhone "home" screen (where all the apps appear).
There's more information here under the "Configuring Web Application" section of this Apple Safari Web Content Guide.

Open iPhone/iPad settings panel

My app needs feature to open iPhone/iPad "Mail, contacts, Calendars" settings panel and automatically scroll to view default calendar settings row. Any sample or idea?
I will put it under the IBAction.
The URL scheme for programmatically launching Settings.app to a particular settings panel was briefly exposed (though I'm not sure if it was documented) in iOS 5. However, the capability has been suppressed for third-party apps in iOS 5.1. As it stands, there is currently no way to do this from a third-party app on the latest version of the OS - at least, not in a way that won't get your app rejected from the App Store. There's likely a jailbreak way to do this, but I don't dabble in that, so I wouldn't know.

Resources