Exemplo n.º 1
0
        private static void SetCFBundleURLSchemes(
            PListDict plistDict,
            string appID,
            string urlSuffix,
            ICollection <string> appLinkSchemes)
        {
            IList <object> currentSchemas;

            if (ContainsKeyWithValueType(plistDict, PListParser.CFBundleURLTypesKey, typeof(IList <object>)))
            {
                currentSchemas = (IList <object>)plistDict[PListParser.CFBundleURLTypesKey];
            }
            else
            {
                // Didn't find any CFBundleURLTypes, let's create one
                currentSchemas = new List <object>();
                plistDict[PListParser.CFBundleURLTypesKey] = currentSchemas;
            }

            PListDict facebookBundleUrlSchemes = PListParser.GetFacebookUrlSchemes(currentSchemas);

            // Clear and set the CFBundleURLSchemes for the facebook schemes
            var facebookUrlSchemes = new List <object>();

            facebookBundleUrlSchemes[PListParser.CFBundleURLSchemesKey] = facebookUrlSchemes;
            AddAppID(facebookUrlSchemes, appID, urlSuffix);
            AddAppLinkSchemes(facebookUrlSchemes, appLinkSchemes);
        }
        public static void UpdatePlist(string path)
        {
            const string fileName = "Info.plist";
            string appId = FacebookSettings.AppId;
            string fullPath = Path.Combine(path, fileName);

            if (string.IsNullOrEmpty(appId) || appId.Equals("0"))
            {
                Debug.LogError("You didn't specify a Facebook app ID.  Please add one using the Facebook menu in the main Unity editor.");
                return;
            }

            var fbParser = new PListParser(fullPath);
            fbParser.UpdateFBSettings(appId, FacebookSettings.IosURLSuffix);
            fbParser.WriteToFile();
        }
        public static void UpdatePlist(string path)
        {
            const string fileName = "Info.plist";
            string       appId    = FacebookSettings.AppId;
            string       fullPath = Path.Combine(path, fileName);

            if (string.IsNullOrEmpty(appId) || appId.Equals("0"))
            {
                Debug.LogError("You didn't specify a Facebook app ID.  Please add one using the Facebook menu in the main Unity editor.");
                return;
            }

            var fbParser = new PListParser(fullPath);

            fbParser.UpdateFBSettings(appId, FacebookSettings.IosURLSuffix);
            fbParser.WriteToFile();
        }