Example #1
0
        private void InternalStart(vx_sdk_config_t config)
        {
            if (_startCount > 0)
            {
                ++_startCount;
                return;
            }

            /// Initialize the VivoxNative module before returning the Client object
#if (UNITY_ANDROID && !UNITY_EDITOR) || __ANDROID__
            // Initialize the VivoxNative module
            AndroidJavaClass  unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
            AndroidJavaObject activity    = unityPlayer.GetStatic <AndroidJavaObject>("currentActivity");
            AndroidJavaObject appContext  = activity.Call <AndroidJavaObject>("getApplicationContext");
            AndroidJavaClass  pluginClass = new AndroidJavaClass("com.vivox.vivoxnative.VivoxNative");
            pluginClass.CallStatic("init", appContext);
#endif
            config.app_id = appId;

            int status = VivoxCoreInstance.Initialize(config);
            if (status != 0)
            {
                throw new VivoxApiException(status);
            }

            MessagePump.Instance.MainLoopRun += InstanceOnMainLoopRun;
            ++_startCount;

            //Start the Unity interop class that will setup the needed message pump
#if UNITY_5_3_OR_NEWER
            VxUnityInterop.Instance.StartVivoxUnity();
#endif
        }
Example #2
0
        public void Start(int logLevel, int debugLocation = 0)
        {
            vx_sdk_config_t config = new vx_sdk_config_t();

            config.initial_log_level          = (vx_log_level)logLevel;
            VivoxDebug.Instance.debugLocation = debugLocation;
            Start(config);
        }
Example #3
0
        /// <summary>
        /// (Recommended to use Start(VivoxConfig config) instead of this method)
        /// This method is used to start VxClient.
        /// Most implementation should use <see cref="Client"/> instead of <see cref="VxClient"/>
        /// </summary>
        /// <param name="config">Optional: config to set on initialize.</param>
        public void Start(vx_sdk_config_t config)
        {
            config = config == null ? new vx_sdk_config_t() : config;

            // This start method we will force the PrepareForVivox as
            // we plan to deprecate this method in the future
#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__
            PrepareForVivox();
#endif
            InternalStart(config);
        }
Example #4
0
        /// <param name="config">Optional: config to set on initialize.</param>
        public void Start(vx_sdk_config_t config = null)
        {
            if (_startCount > 0)
            {
                ++_startCount;
                return;
            }
            config = config == null ? new vx_sdk_config_t() : config;

            config.app_id = appId;

            int status = VivoxCoreInstance.Initialize(config);

            if (status != 0)
            {
                throw new VivoxApiException(status);
            }

            MessagePump.Instance.MainLoopRun += InstanceOnMainLoopRun;

            ++_startCount;
        }
Example #5
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(vx_sdk_config_t obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }