Exemple #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)
        {
#if UNITY_IOS
            string appId    = FacebookSettings.AppId;
            string fullPath = Path.Combine(path, "Info.plist");
            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;
            }
            PListParser pListParser = new PListParser(fullPath);
            pListParser.UpdateFBSettings(appId, FacebookSettings.IosURLSuffix, FacebookSettings.AppLinkSchemes[FacebookSettings.SelectedAppIndex].Schemes);
            pListParser.UpdateInfolist();
            pListParser.WriteToFile();
#endif
        }
        public void UpdateInfolist()
        {
            if (PListParser.ContainsKeyWithValueType(this.XMLDict, "UIApplicationExitsOnSuspend", typeof(bool)))
            {
                this.XMLDict.Remove("UIApplicationExitsOnSuspend");
            }
            PListDict desPlist = new PListDict(DescriptionSchemes);

            foreach (var item in desPlist)
            {
                if (!this.XMLDict.ContainsKey(item.Key))
                {
                    this.XMLDict.Add(item.Key, item.Value);
                }
            }
        }
        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 facebookParser = new PListParser(fullPath);
            facebookParser.UpdateFBSettings(
                appId,
                FacebookSettings.IosURLSuffix,
                FacebookSettings.AppLinkSchemes[FacebookSettings.SelectedAppIndex].Schemes);
            facebookParser.WriteToFile();
        }