예제 #1
0
        /// <summary>
        /// Updates the new project's Info.plist file to include an entry for the Url scheme mandated
        /// by the Google+ login. This means that the plist file needs to have an entry in the for
        /// indicated here: <see cref="https://developers.google.com/+/mobile/ios/getting-started#step_3_add_a_url_type"/>
        /// <para>This boils down to having an entry in the CFBundleURLTypes top level plist field with
        /// a CFBundleURLName equal to the bundle ID of the game, and a single element array for
        /// CFBundleURLSchemes also containing the bundle ID.</para>
        /// <para>We make use of the apple-provided PlistBuddy utility to edit the plist file.</para>
        /// </summary>
        /// <param name="pathToPlist">Path to plist.</param>
        private static void UpdateGeneratedInfoPlistFile(string pathToPlist)
        {
            PlistBuddyHelper buddy = PlistBuddyHelper.ForPlistFile(pathToPlist);

            // If the top-level UrlTypes field doesn't exist, add it here.
            if (buddy.EntryValue(UrlTypes) == null)
            {
                buddy.AddArray(UrlTypes);
            }

            AddURLScheme(buddy, BundleSchemeKey, GetBundleId());
            AddURLScheme(buddy, ReverseClientIdSchemeKey, GetReverseClientId());
        }
        /// <summary>
        /// Updates the new project's Info.plist file to include an entry for the Url scheme mandated
        /// by the Google+ login. This means that the plist file needs to have an entry in the for
        /// indicated here: <see cref="https://developers.google.com/+/mobile/ios/getting-started#step_3_add_a_url_type"/>
        /// <para>This boils down to having an entry in the CFBundleURLTypes top level plist field with
        /// a CFBundleURLName equal to the bundle ID of the game, and a single element array for
        /// CFBundleURLSchemes also containing the bundle ID.</para>
        /// <para>We make use of the apple-provided PlistBuddy utility to edit the plist file.</para>
        /// </summary>
        /// <param name="pathToPlist">Path to plist.</param>
        private static void UpdateGeneratedInfoPlistFile(string pathToPlist)
        {
            PlistBuddyHelper buddy = PlistBuddyHelper.ForPlistFile(pathToPlist);

            // If the top-level UrlTypes field doesn't exist, add it here.
            if (buddy.EntryValue(UrlTypes) == null)
            {
                buddy.AddArray(UrlTypes);
            }

            var gamesSchemeIndex = GamesUrlSchemeIndex(buddy);

            EnsureGamesUrlScheme(buddy, gamesSchemeIndex);
        }