Knetik.KnetikClient.GuestRegister C# (CSharp) Method

GuestRegister() public method

public GuestRegister ( Action cb = null ) : KnetikApiResponse
cb Action
return KnetikApiResponse
        public KnetikApiResponse GuestRegister(
            Action<KnetikApiResponse> cb = null
            )
        {
            // Login as a guest
            KnetikApiResponse loginResponse = GuestLogin ();

            if (loginResponse.Status != KnetikApiResponse.StatusType.Success) {
                Debug.LogError("Guest login failed");
                return loginResponse;
            }
            Debug.Log ("Guest login successful");

            // Then register the new user
            JSONObject j = new JSONObject (JSONObject.Type.OBJECT);
            String body = j.Print ();

            KnetikRequest req = CreateRequest(GuestRegisterEndpoint, body);

            KnetikApiResponse registerResponse = new KnetikApiResponse(this, req, cb);
            return  registerResponse;
        }