How to enable/disable metro app setting capabilities? - capability

How can I enable/disable programmatically capabilities in a metro app, i.e. capabilities settings defined in the package app manifest such as internet, microphone, location, etc.?

I did a Google search, then I fired up the "help" on my copy of MSVS2012RC (the latest/greatest Metro-capable compiler).
Then answer is "you must set capabilities in your Package Manifest, and only in the Package manifest". It appears that capabilities cannot be changed programmatically.

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

iOS cordova allow location access 'Always'

I am developing an app with Cordova for iOS which includes geolocation functionalities (I use the official plugin https://github.com/apache/cordova-plugin-geolocation). I saw in options of my app that location access can be either set as "Never" or "While Using the App". However some other apps may also the option "Always" as shown in the attached screenshot. I would like to know whether it is possible to also have the option "Always" for Cordova-based applications.
Thanks!
I was using both NSLocationWhenInUseUsageDescription and NSLocationAlwaysUsageDescription in my company's Cordova app and it was working. Then, in late 2017, it stopped.
The fix for me has been to add also NSLocationAlwaysAndWhenInUseUsageDescription.
More broadly speaking, note that you need to have a plugin allowing to track location in background as well as make sure that the necessary background mode option is enabled in XCode.
We use the following plugin to do the job:
https://www.npmjs.com/package/cordova-plugin-lents-background-geolocation
This type of plugin is necessary as iOS stops execution of scripts for apps roughly 3 minutes after the display is turned off, regardless of the app foreground/background condition when the display was turned off. This prevents any JavaScript code to run and therefore any GPS tracking based on setInterval or setTimeout will stop working.
I guess "NSLocationAlwaysUsageDescription" key is the one which you are looking for. Check out this link which details the settings to be done in cordova based applications to have constant location access.
I'm using Ionic 2 and had to add the following to my App-Info.plist file. Even though cordova inserts 'NSLocationAlwaysUsageDescription' and 'NSLocationWhenInUseUsageDescription' keys. This only gave a 'Never' and 'While Using App' option on launch. Xcode suggested using the option below and that worked for me.
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app requires background location tracking</string>

How to open device settings app not the app settings programmatically in iOS 8.0+

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.

In-App Settings or Settings Bundle

What's the better approach, use In-App Settings (A Screen on Startup) or use the Settings Bundle and if nothing is entered show a popup on start? Or is it possible to combine both?
BR,
mybecks
Apple says:
Which option you choose depends on how you expect users to interact with preferences. The Settings bundle is generally the preferred mechanism for displaying preferences. However, games and other apps that contain configuration options or other frequently accessed preferences might want to present them inside the app instead.
Therefore if the settings are going to be used frequently use in-app settings, otherwise make a settings bundle
Try InAppSettingsKit, it will provide you a hybrid solution by maintaining the Settings.app pane.

settings.bundle for preinstalled applications like mobile.safari ,mobile mail and so on

Does enybody know where can I find settings bundle for preinstalled applications like mobile safari, mail and so on?
I have jailbroken ios device.
I have installed my application to /Applcation folder. Not to the standart applications folder /private/var/mobile/Applications.
Therefore my settings.bundle was ignored by the system and I don't see my setting in "system settings" application.
I put my app to /Application to pretect my application from deletion by long push on the app icon. ( cydia installed in the same folder, and also can't be removed)
I case of regular install to /private/var/mobile/Applications i see my settings in "system settings" application and everything is OK.
I don't see settings.bundle in the /Application/MobileSafari.app or in the /Applications/MobileMail.app
They use another way.
And the question is how they do it? Where is they settings.bundle?
That's an interesting question, but I don't think they have a settings.bundle. It's probably preinstalled in the settings app or another way completely. They don't have to have a separate setting for each app, as they're all bundled together. I would search through the Settings.app if it exists (mine isn't currently jailbroken so I can't check) and/or folders in /var. Good luck!

Resources