public SampleClient(IWorklightClient wlc, IWorklightPush push)
        {
            this.client = wlc;
            this.push   = push;
            SecurityCheckChallengeHandler customCH = new CustomChallengeHandler(appRealm);

            client.RegisterChallengeHandler(customCH);
            push.Initialize();
        }
Example #2
0
        /// <summary>
        /// Connect to the server instance
        /// </summary>
        private async Task <WorklightResponse> Connect()
        {
            //lets send a message to the server
            client.Analytics.Log("Trying to connect to server", metadata);

            ChallengeHandler customCH = new CustomChallengeHandler(appRealm);

            client.RegisterChallengeHandler(customCH);
            WorklightResponse task = await client.Connect();

            //lets log to the local client (not server)
            client.Logger("Xamarin").Trace("connection");
            //write to the server the connection status
            client.Analytics.Log("Connect response : " + task.Success);
            return(task);
        }
Example #3
0
		/// <summary>
		/// Connect to the server instance
		/// </summary>
		private async Task<WorklightResponse> Connect()
		{
			//lets send a message to the server
			client.Analytics.Log("Trying to connect to server", metadata);

			ChallengeHandler customCH = new CustomChallengeHandler(appRealm);
			client.RegisterChallengeHandler(customCH);
			WorklightResponse task = await client.Connect();
			//lets log to the local client (not server)
			client.Logger("Xamarin").Trace("connection");
			//write to the server the connection status
			client.Analytics.Log("Connect response : " + task.Success);
			return task;
		}