Search code examples
c#iosplist

Getting a setting from Entitlements.plist


I am trying to add some custom settings in an iOS application.

Entitlements.plist supports custom settings

screenshot

But I can't find a way to get these setting programmatically.

I tried:

var bundle= NSBundle.FromPath ("Entitlements.plist");

But bundle is null. Could you help me, please?

P.S. I use Xamarin studio and C#, but I can read objective-c code.


Solution

  • I do not figure out how I can read settings from Entitlements.plist. If someone can tell me how to access to Entitlements.plist please write here.

    Instead I added a settings.plist in a root directory of project. Code for settings access:

            var settings = new NSDictionary (NSBundle.MainBundle.PathForResource ("settings.plist", null));
    
            var value= (NSString)settings ["key"];