iOS setting bundle not editable - ios

Is there a way to create an option in Bundle settings of iOS 7+ in such a way that it's only readable for a user. The user shouldn't be able to edit this within the option menu.
During the first use of the application I will set the above property and unique value.
Writing down the unique id in a database is not a option. The user should see this value in the settings menu of the app, provided by iOS.
Using the IMEI is not a option since the value is undergoing some kind of validation mechanism in the app itself.

You can use a PSTitleValueSpecifier for this. It will display a value that is readonly. Below is an example Root.plist file that shows a user Account Number in the App Settings. When the application start up, you can programmatically update the value and it will show up as read-only on the App Settings page.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Type</key>
<string>PSTitleValueSpecifier </string>
<key>Title</key>
<string>Account Number</string>
<key>Key</key>
<string>account_number_preference</string>
<key>DefaultValue</key>
<string>012-345-6789</string>
</dict>
</array>
</dict>
</plist>

Related

Change the title string of a setting defined via iOS settings bundle at run time?

I'm working on an iPad application that allows users to log in using Touch ID. Also I've included a preference called "Touch ID" in application settings bundle where users can switch on/off that option to enable or disable Touch ID authentication.
The following plist file is what I used to set up the settings bundle.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>StringsTable</key>
<string>Root</string>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Touch ID</string>
<key>Key</key>
<string>settingsTouchID</string>
<key>DefaultValue</key>
<false/>
</dict>
</array>
</dict>
</plist>
The following image is the screenshot of the application settings screen.
However, certain iPads feature "Face ID" instead of "Touch ID," and I'd like to provide the option name (title field in the Plist file) for setting bundle to "Face ID" instead of "Touch ID" for those devices.
Could someone kindly inform me if dynamic titles for the application settings options are possible? 
Note: I have got some alternative solutions like, creating a settings screen within my app itself, renaming the setting name to a generic one, etc.
there is no way to edit plist files at run time

Is it possible to build App Clip without having a full app?

Is it possible to register only AppClip in app connect instead of full app?
Is there a way by which we can hide bottom app banner from App Clip and just use clips?
No - the app clip must be accompanied by your full app. When you create an app clip target in Xcode, it must include a parent application identifier in its entitlements file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>appclips:example.com</string>
</array>
<key>com.apple.developer.parent-application-identifiers</key>
<array>
<string>$(AppIdentifierPrefix)com.myparent.app</string>
</array>
</dict>
</plist>
The image you have posted is of a layout that is used for all app clips, where you supply the image, subtitle, and text for the call to action button. The presentation of the card is handled by the system and cannot be modified to hide any elements.

Set read only a .plist file item

I have a plist file used to store informations as parameters of my application.
It can be configurable by Settings on device and I can set items value programmatically.
Everything working well, but I would like to set items Enable\Disable based on condition.
For example, for some reason I would like to put my item used to store a text information disabled, so the user on device can't edit this parameter on Settings device. Is it possible?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DefaultValue</key>
<string></string>
<key>Key</key>
<string>USERNAME</string>
<key>KeyboardType</key>
<string>Alphabet</string>
<key>Title</key>
<string>User</string>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
</dict>
</plist>
If you want that kind of flexibility, provide a settings interface within your app rather than relying on the Settings app.

NSAppTransportSecurity option not listed in Xcode plist editor

I am trying to add the App Transport Security keys to my Info.plist as described in the following Apple tech note https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/#//apple_ref/doc/uid/TP40016240-CH1-SW3 (Exclusions section)
When I edit the Info.plist file, I did the following:
Click on the '+' next to 'Information Property List' to create a new top level key
Clicked the dropdown to select "NSAppTransportSecurity'
However Xcode doesn't list the option in the drop down list (screenshot below).
Do I need to open the Info.plist file in a text editor and edit this manually?! Or am I missing some (probably obvious!) step?
I'm using Xcode 7.0.1
Thanks
Xcode 7.1 lists the option in the dropdown (App Transport Security Settings). In earlier versions you need to type the raw key NSAppTransportSecurity and set the type to dictionary.
Simply it is not already present in Xcode 7.0
You can use anyway Xcode but I suggest you to open the plist file with a text editor and add this to allow all connections to all domains:
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- .......................... -->
<!-- Other keys already present -->
<!-- .......................... -->
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
To add specific exceptions to a list of domains add this instead:
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- .......................... -->
<!-- Other keys already present -->
<!-- .......................... -->
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>domain.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
</dict>
</plist>
NSIncludesSubdomains is not necessary but permits to access subdomains like wiki.domain.com, blog.domain.com etc.
For a detailed tutorial have a look at this blog post

Open video with (my app) on iOS

I'm creating an iOS app that essentially uploads video files to a cloud server, among other things. To make it more useable, I'd like to implement an Open with/Share with my app button. When you open the camera roll on iOS devices, select a video and click the Share button, a list of compatible apps shows up. I'd like to place my app in this list.
I did some research on the Internet, and found I had to add the file type to my plist file, so I added:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>LSItemContentTypes</key>
<array>
<string>public.video</string>
<string>public.movie</string>
<string>public.mpeg-4</string>
<string>com.apple.m4v-video</string>
<string>com.apple.quicktime-movie</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeName</key>
<string>Moment</string>
<key>LSHandlerRank</key>
<string>Owner</string>
</dict>
</array>
</plist>
My app isn't showing up, however. Am I doing something wrong here?
LSItemContentTypes is for the document controller. Since you're wanting to do this from the camera roll, you may be looking to create a Share Extension.

Resources