• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Accessing iOS Settings

Explorer ,
Sep 16, 2015 Sep 16, 2015

Copy link to clipboard

Copied

Hi folks,

I'm attempting to access the custom settings I created for my app using the Settings.bundle. However, I can't seem to access the .plist from within ActionScript.

I'm using Julian Dolce's iPhoneAppSettings.as ( https://code.google.com/p/as3iphone/source/browse/#svn%2Ftrunk%2FClasses%2Fcom%2Fflashiphonedevelopm...) which uses the following to read in the .plist:

__path = "Library/Preferences/" + NativeApplication.nativeApplication.applicationID + ".plist";

__file = File.userDirectory.resolvePath( __path );

if( __file.exists )

{

   readBinary( __file );

}

This consistently fails as __file.exists returns false. After doing some research, I also tried __path = "AppData/Library/Preferences/" + NativeApplication.nativeApplication.applicationID + ".plist"; to no avail.

I successfully created the Settings; when I install my app and go to Settings, I see the Settings page for my app. Using XCode's Devices window, I can verify that the .plist file has been installed and that its name matches NativeApplication.nativeApplication.applicationID + ".plist". I'm wondering if I simply have the wrong path to the .plist file? I know that Julian's code is about 5 years old, so maybe the path to the .plist file has changed? Is there a better way of accessing this file?

TIA,

--Chi-An

TOPICS
Development

Views

314

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Sep 16, 2015 Sep 16, 2015

Hey, FYI, the original code does work. I was tripped up by a quirk in iOS: the {applicationID}.plist doesn't exist until you go into the Settings app and look at the custom Settings for your app. I must have been testing it in a different order. If you install the app, then go into Settings, and then launch the app, the file does exist. You can verify this by looking at XCode's Device window: track when the .plist shows up in Library/Preferences.

Votes

Translate

Translate
Explorer ,
Sep 16, 2015 Sep 16, 2015

Copy link to clipboard

Copied

LATEST

Hey, FYI, the original code does work. I was tripped up by a quirk in iOS: the {applicationID}.plist doesn't exist until you go into the Settings app and look at the custom Settings for your app. I must have been testing it in a different order. If you install the app, then go into Settings, and then launch the app, the file does exist. You can verify this by looking at XCode's Device window: track when the .plist shows up in Library/Preferences.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines