コード例 #1
0
        /// <summary>
        /// Updates the info plist.
        /// </summary>
        protected virtual void PostprocessXcodePlist()
        {
            // read plist
            Dictionary <string, object> dict;

            dict = ReadPlist();

            // cleanup plist
            dict.Remove("CFBundleIconFiles");

            // remove default launch image entries from the plist -
            // otherwise we get a black launch screen.
            // without these values, launch uses our LaunchScreen.xib file (white screen)
            dict.Remove("UILaunchStoryboardName~ipad");
            dict.Remove("UILaunchStoryboardName~iphone");
            dict.Remove("UILaunchStoryboardName~ipod");

            // update plist
            dict["UIPrerenderedIcon"] = true;
            dict["CFBundleAllowMixedLocalizations"] = true;

            iOSProductInfo productInfo = PlatformUtil.GetSettings <iOSProductInfo>(SagoPlatform.PlatformUtil.ActivePlatform);
            object         urlScheme   = productInfo.UrlScheme;

            dict["CFBundleURLTypes"] = new List <object> {
                new Dictionary <string, object> {
                    { "CFBundleURLName", PlayerSettings.applicationIdentifier },
                    { "CFBundleURLSchemes", new List <object> {
                          urlScheme
                      } }
                }
            };

            dict["LSApplicationQueriesSchemes"] = iOSLSApplicationQueriesSchemes.Schemes;
            dict["CFBundleShortVersionString"]  = this.BundleShortVersion;
            dict["CFBundleVersion"]             = this.BundleVersion;
            dict["UILaunchStoryboardName"]      = "LaunchScreen";

            // Inform App Store submission/Testflight that we do not use any non-standard encryption.
            dict["ITSAppUsesNonExemptEncryption"] = false;

            dict["NSPhotoLibraryUsageDescription"] = "This app would like to save photos to your camera roll.";

            dict["LSHasLocalizedDisplayName"] = true;

            // write plist
            WritePlist(dict);
        }
コード例 #2
0
        protected virtual void PreprocessPlayerSettings()
        {
            iOSProductInfo info = PlatformUtil.GetSettings <iOSProductInfo>();

                        #if !SAGO_BUILD_DO_NOT_USE_VERSION_SERVICE
            if (!VersionService.Bump(info))
            {
                Debug.LogWarning("Could not bump build number.", info);
                switch (this.BuildType)
                {
                case iOSBuildType.Simulator:
                case iOSBuildType.Device:
                    Debug.LogWarning("Could not bump build number");
                    break;

                default:
                    throw new System.InvalidOperationException("Could not bump build number");
                }
            }
                        #endif

            PlayerSettings.productName           = info.DisplayName;
            PlayerSettings.applicationIdentifier = info.Identifier;
            PlayerSettings.bundleVersion         = this.BundleVersion;

            if (string.IsNullOrEmpty(info.UrlScheme))
            {
                throw new System.Exception("UrlScheme property is missing from iOS platform prefab");
            }

            // short bundle version
            // the short bundle version property was added in Unity 4.6.3, so
            // set it via reflection to play nice with older versions of Unity.
            PropertyInfo shortBundleVersion = typeof(PlayerSettings).GetProperty(
                "shortBundleVersion",
                BindingFlags.Public | BindingFlags.Static
                );
            if (shortBundleVersion != null)
            {
                shortBundleVersion.SetValue(null, this.BundleShortVersion, null);
            }
        }