marcel
marcel

Reputation: 313

iOS setting bundle not editable

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.

Upvotes: 0

Views: 108

Answers (1)

SharpMobileCode
SharpMobileCode

Reputation: 938

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>

Upvotes: 1

Related Questions