/// <summary>
    /// Initialize the SDK.
    /// </summary>
    /// <param name="appId">
    /// ID for your app, as supplied by Swrve.
    /// </param>
    /// <param name="apiKey">
    /// Scret API key for your app, as supplied by Swrve.
    /// </param>
    /// <param name="config">
    /// Extra configuration for the SDK.
    /// </param>
    public void Init(int appId, string apiKey, SwrveConfig config = null)
    {
        if (SDK == null || SDK is SwrveEmpty)
        {
            bool supportedOSAndVersion = true;
#if !UNITY_EDITOR
#if UNITY_IPHONE
            supportedOSAndVersion = SwrveSDK.IsSupportediOSVersion();
#elif UNITY_ANDROID
            supportedOSAndVersion = SwrveSDK.IsSupportedAndroidVersion();
#else
#warning "We do not officially support this plaform. tracking is disabled."
            supportedOSAndVersion = false;
#endif
#elif !UNITY_IPHONE && !UNITY_ANDROID
#warning "We do not officially support this plaform. tracking is disabled."
            supportedOSAndVersion = false;
#endif
            if (supportedOSAndVersion)
            {
                SDK = new SwrveSDK();
            }
            else
            {
                SDK = new SwrveEmpty();
            }
        }
        if (config == null)
        {
            config = new SwrveConfig();
        }
        SDK.Init(this, appId, apiKey, config);
    }
Exemplo n.º 2
0
 public void Init(int appId, string apiKey)
 {
     if (this.SDK == null || this.SDK is SwrveEmpty)
     {
         bool flag = SwrveSDK.IsSupportedAndroidVersion();
         if (flag)
         {
             this.SDK = new SwrveSDK();
         }
         else
         {
             this.SDK = new SwrveEmpty();
         }
     }
     this.SDK.Init(this, appId, apiKey, this.Config);
 }