Esempio n. 1
0
    /**
     * Set callback for receiving remote configuration keys for the app
     *
     * @param onAppConfigReceivedCallback method called back with the received dictionary of key/value pairs
     */
    public static void SetAppConfigCallback(Action <Dictionary <string, string> > onAppConfigReceivedCallback)
    {
        if (GameObject.Find(FGLEnhance_Callbacks.CallbackObjectName) == null)
        {
            string     newName        = "__FGLEnhance_Callback_" + UnityEngine.Random.Range(0, int.MaxValue);
            GameObject callbackObject = new GameObject(newName);
            callbackObject.AddComponent <FGLEnhance_Callbacks>();
        }

        FGLEnhance_Callbacks.OnAppConfigReceivedCallback = onAppConfigReceivedCallback;

        InitializeEnhance();
#if UNITY_EDITOR
        FGLEditorInternals.RequestAppConfig(FGLEnhance_Callbacks.CallbackObjectName);
#elif UNITY_ANDROID
        FGLAndroidInternals.RequestAppConfig(FGLEnhance_Callbacks.CallbackObjectName);
#elif UNITY_IOS
        FGLiOSInternals.RequestAppConfig(FGLEnhance_Callbacks.CallbackObjectName);
#endif
    }