public BackgroundModesCapability(BackgroundModesCapability other)
     : base(other)
 {
     AudioAirplayPIP     = other.AudioAirplayPIP;
     LocationUpdates     = other.LocationUpdates;
     VOIP                = other.VOIP;
     NewsstandDownloads  = other.NewsstandDownloads;
     ExternalAccComms    = other.ExternalAccComms;
     UsesBTLEAcc         = other.UsesBTLEAcc;
     ActsAsBTLEAcc       = other.ActsAsBTLEAcc;
     BackgroundFetch     = other.BackgroundFetch;
     RemoteNotifications = other.RemoteNotifications;
 }
Пример #2
0
        //Background Modes
        void ApplyBackgroundModesCapability(BackgroundModesCapability capability)
        {
            //update pbxproject
            switch (_platform)
            {
            case BuildPlatform.tvOS:
                _pbxproj.EnableSystemCapability("com.apple.BackgroundModes.appletvos", true);
                break;

            case BuildPlatform.iOS:
            default:
                _pbxproj.EnableSystemCapability("com.apple.BackgroundModes", true);
                break;
            }

            //update info.plist
            var modes = new PListArray();

            if (capability.UsesBTLEAcc)
            {
                modes.Add("bluetooth-central");
            }

            if (capability.AudioAirplayPIP)
            {
                modes.Add("audio");
            }

            if (capability.ActsAsBTLEAcc)
            {
                modes.Add("bluetooth-peripheral");
            }

            if (capability.ExternalAccComms)
            {
                modes.Add("external-accessory");
            }

            if (capability.BackgroundFetch)
            {
                modes.Add("fetch");
            }

            if (capability.LocationUpdates)
            {
                modes.Add("location");
            }

            if (capability.NewsstandDownloads)
            {
                modes.Add("newsstand-content");
            }

            if (capability.RemoteNotifications)
            {
                modes.Add("remote-notification");
            }

            if (capability.VOIP)
            {
                modes.Add("voip");
            }

            if (modes.Count > 0)
            {
                var changes = new PListDictionary();
                changes.Add("UIBackgroundModes", modes);
                ApplyInfoPlistChanges(changes);
            }

            //update entitlements file
        }