Exemplo n.º 1
0
 /// <summary>
 /// Initialize the SDK for a windows phone app.
 /// </summary>
 /// <param name="appId">App id for the app on appacitive.</param>
 /// <param name="apikey">API key for the app on appacitive.</param>
 /// <param name="environment">The environment to use - sandbox or live.</param>
 /// <param name="settings">Additional settings for initializing the SDK.</param>
 public static void Initialize(string appId, string apikey, Environment environment, AppacitiveSettings settings = null)
 {
     #if WINDOWS_PHONE
     InternalApp.Initialize(Platforms.WP8, appId, apikey, environment, settings);
     #elif WINDOWS_PHONE7
     InternalApp.Initialize(Platforms.WP7, appId, apikey, environment, settings);
     #endif
 }
Exemplo n.º 2
0
 public static void Initialize(IApplicationHost host, string apiKey, Environment environment, AppacitiveSettings settings = null)
 {
     settings = settings ?? AppacitiveSettings.Default;
     // Set the api key
     AppacitiveContext.ApiKey = apiKey;
     // Set the environment
     AppacitiveContext.Environment = environment;
     // Set the factory
     AppacitiveContext.ObjectFactory = settings.Factory ?? AppacitiveSettings.Default.Factory;
     // Register defaults
     RegisterDefaults(AppacitiveContext.ObjectFactory);
     // Initialize host
     host.InitializeContainer(AppacitiveContext.ObjectFactory);
 }
Exemplo n.º 3
0
 public static void Initialize(IApplicationHost host, string apiKey, Environment environment, AppacitiveSettings settings = null)
 {
     if (Interlocked.CompareExchange(ref _initialized, 1, 0) == 0)
     {
         settings = settings ?? AppacitiveSettings.Default;
         // Set the api key
         AppacitiveContext.ApiKey = App.Apikey = apiKey;
         // Set the environment
         AppacitiveContext.Environment = App.Environment = environment;
         // Use api session
         AppacitiveContext.UseApiSession = settings.UseApiSession;
         // Set the factory
         AppacitiveContext.ObjectFactory = settings.Factory ?? AppacitiveSettings.Default.Factory;
         // Register defaults
         RegisterDefaults(AppacitiveContext.ObjectFactory);
         // Initialize host
         host.InitializeContainer(AppacitiveContext.ObjectFactory);
         // Setup real time connections
         App.EnableRealtime = settings.EnableRealTimeSupport;
         if (settings.EnableRealTimeSupport == true)
             StartRealTime().Wait();
         
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initialize the Appacitive SDK with a customized platform implementation for windows phone app.
 /// </summary>
 /// <param name="platform">Custom device platform implementation</param>
 /// <param name="appId">App id for the app on appacitive.</param>
 /// <param name="apikey">API key for the app on appacitive.</param>
 /// <param name="environment">The environment to use - sandbox or live.</param>
 /// <param name="settings">Additional settings for initializing the SDK.</param>
 public static void Initialize(IDevicePlatform platform, string appId, string apikey, Environment environment, AppacitiveSettings settings = null)
 {
     InternalApp.Initialize(platform, appId, apikey, environment, settings);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initialize the SDK for a windows phone app.
 /// </summary>
 /// <param name="appId">App id for the app on appacitive.</param>
 /// <param name="apikey">API key for the app on appacitive.</param>
 /// <param name="environment">The environment to use - sandbox or live.</param>
 /// <param name="settings">Additional settings for initializing the SDK.</param>
 public static void Initialize(string appId, string apikey, Environment environment, AppacitiveSettings settings = null)
 {
     #if WINDOWS_PHONE
     InternalApp.Initialize(Platforms.WP8, appId, apikey, environment, settings);
     #elif WINDOWS_PHONE7
     InternalApp.Initialize(Platforms.WP7, appId, apikey, environment, settings);
     #endif
 }
Exemplo n.º 6
0
 /// <summary>
 /// Initialize the Appacitive SDK with a customized platform implementation for windows phone app.
 /// </summary>
 /// <param name="platform">Custom device platform implementation</param>
 /// <param name="appId">App id for the app on appacitive.</param>
 /// <param name="apikey">API key for the app on appacitive.</param>
 /// <param name="environment">The environment to use - sandbox or live.</param>
 /// <param name="settings">Additional settings for initializing the SDK.</param>
 public static void Initialize(IDevicePlatform platform, string appId, string apikey, Environment environment, AppacitiveSettings settings = null)
 {
     InternalApp.Initialize(platform, appId, apikey, environment, settings);
 }
Exemplo n.º 7
0
 public static void Initialize(IApplicationHost host, string apiKey, Environment environment, AppacitiveSettings settings = null)
 {
     if (Interlocked.CompareExchange(ref _initialized, 1, 0) == 0)
     {
         settings = settings ?? AppacitiveSettings.Default;
         // Set the api key
         AppacitiveContext.ApiKey = App.Apikey = apiKey;
         // Set the environment
         AppacitiveContext.Environment = App.Environment = environment;
         // Use api session
         AppacitiveContext.UseApiSession = settings.UseApiSession;
         // Set the factory
         AppacitiveContext.ObjectFactory = settings.Factory ?? AppacitiveSettings.Default.Factory;
         // Register defaults
         RegisterDefaults(AppacitiveContext.ObjectFactory);
         // Initialize host
         host.InitializeContainer(AppacitiveContext.ObjectFactory);
         // Setup real time connections
         App.EnableRealtime = settings.EnableRealTimeSupport;
         if (settings.EnableRealTimeSupport == true)
         {
             StartRealTime().Wait();
         }
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// Initialize the SDK for use inside an ASP.net application.
 /// </summary>
 /// <param name="appId">App id for the app on appacitive.</param>
 /// <param name="apikey">API key for the app on appacitive.</param>
 /// <param name="environment">The environment to use - sandbox or live.</param>
 /// <param name="settings">Additional settings for initializing the SDK.</param>
 public static void InitializeForAspnet(string appId, string apikey, Environment environment, AppacitiveSettings settings = null)
 {
     InternalApp.Initialize(Platforms.Aspnet, appId, apikey, environment, settings);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Initialize the SDK for use inside an ASP.net application.
 /// </summary>
 /// <param name="appId">App id for the app on appacitive.</param>
 /// <param name="apikey">API key for the app on appacitive.</param>
 /// <param name="environment">The environment to use - sandbox or live.</param>
 /// <param name="settings">Additional settings for initializing the SDK.</param>
 public static void InitializeForAspnet(string appId, string apikey, Environment environment, AppacitiveSettings settings = null)
 {
     InternalApp.Initialize(Platforms.Aspnet, appId, apikey, environment, settings);
 }