Highlighted

Accessing iOS Settings

Explorer ,
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

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.

TOPICS
Development

Views

238

Likes

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

Accessing iOS Settings

Explorer ,
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

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.

TOPICS
Development

Views

239

Likes

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
Sep 16, 2015 0
Explorer ,
Sep 16, 2015

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Sep 16, 2015 0