Esempio n. 1
0
        static string[] GetBackgroundModes(NSBundle bundle)
        {
            var backgroundModes = bundle.ObjectForInfoDictionary("UIBackgroundModes");

            if (backgroundModes == null)
            {
                return new string[0];
            }

            return NSArray.StringArrayFromHandle(backgroundModes.Handle);
        }
        static string[] GetBackgroundModes(NSBundle bundle)
        {
            var backgroundModes = bundle.ObjectForInfoDictionary("UIBackgroundModes");

            if (backgroundModes == null)
            {
                return(new string[0]);
            }

            return(NSArray.StringArrayFromHandle(backgroundModes.Handle));
        }
Esempio n. 3
0
        static void ThrowIfNoDescription(NSBundle bundle, string key)
        {
            if (!UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
            {
                return;
            }

            var backgroundModes = bundle.ObjectForInfoDictionary(key);
            if (backgroundModes == null)
            {
                throw new InvalidOperationException(string.Format("You must provide a value for {0} in Info.plist to use location services", key));
            }
        }
        static void ThrowIfNoDescription(NSBundle bundle, string key)
        {
            if (!UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
            {
                return;
            }

            var backgroundModes = bundle.ObjectForInfoDictionary(key);

            if (backgroundModes == null)
            {
                throw new InvalidOperationException(string.Format("You must provide a value for {0} in Info.plist to use location services", key));
            }
        }
Esempio n. 5
0
            public UserAgent(NSBundle bundle)
            {
                var appVersion = bundle.ObjectForInfoDictionary("CFBundleShortVersionString")?.ToString() ?? "unknown";

                HeaderValue = string.Format(ValueFormat, appVersion);
            }
Esempio n. 6
0
 private static string StringForInfoDictionary(this NSBundle bundle, Main.DictionaryKey key)
 {
     return(bundle.ObjectForInfoDictionary(key.ToString()).ToString() ?? string.Empty);
 }