Exemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            identityText = FindViewById <EditText>(Resource.Id.identityText);

            enrollButton        = FindViewById <Button>(Resource.Id.enrollButton);
            enrollButton.Click += delegate {
                if (identityText.Text.Length == 0)
                {
                    ShowZoomAlert("Empty Username", "Please enter a username.");
                    return;
                }
                latestZoomHybridRequestType = ZoomHybridRequestType.Enroll;
                StartVerification();
            };

            authButton        = FindViewById <Button>(Resource.Id.authButton);
            authButton.Click += delegate {
                if (identityText.Text.Length == 0)
                {
                    ShowZoomAlert("Empty Username", "Please enter a username.");
                    return;
                }
                latestZoomHybridRequestType = ZoomHybridRequestType.Authenticate;
                StartVerification();
            };

            checkEnrollmentButton        = FindViewById <Button>(Resource.Id.checkEnrollmentButton);
            checkEnrollmentButton.Click += delegate {
                if (identityText.Text.Length == 0)
                {
                    ShowZoomAlert("Empty Username", "Please enter a username.");
                    return;
                }
                IsUserEnrolled(identityText.Text.Replace(" ", ""));
            };

            deleteEnrollmentButton        = FindViewById <Button>(Resource.Id.deleteEnrollmentButton);
            deleteEnrollmentButton.Click += delegate {
                if (identityText.Text.Length == 0)
                {
                    ShowZoomAlert("Empty Username", "Please enter a username.");
                    return;
                }
                DeleteUser(identityText.Text.Replace(" ", ""));
            };

            String versionStr = "Zoom SDK v" + ZoomSDK.Version();

            FindViewById <TextView>(Resource.Id.versionText).Text = versionStr;
        }
Exemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            SetStyles();

            // dismiss keyboard when done
            IdentityTextField.ShouldReturn = delegate {
                IdentityTextField.ResignFirstResponder();
                return(true);
            };

            EnrollButton.Enabled        = false;
            EnrollButton.TouchUpInside += delegate {
                if (IdentityTextField.Text.Length == 0)
                {
                    ShowZoomAlert("Empty Username", "Please enter a username.");
                    return;
                }

                latestZoomHybridRequestType = ZoomHybridRequestType.Enroll;
                StartVerification();
            };

            AuthButton.Enabled        = false;
            AuthButton.TouchUpInside += delegate {
                if (IdentityTextField.Text.Length == 0)
                {
                    ShowZoomAlert("Empty Username", "Please enter a username.");
                    return;
                }

                latestZoomHybridRequestType = ZoomHybridRequestType.Authenticate;
                StartVerification();
            };

            CheckEnrollmentButton.Enabled        = false;
            CheckEnrollmentButton.TouchUpInside += delegate {
                if (IdentityTextField.Text.Length == 0)
                {
                    ShowZoomAlert("Empty Username", "Please enter a username.");
                    return;
                }

                IsUserEnrolled(IdentityTextField.Text.Replace(" ", ""));
            };

            DeleteEnrollmentButton.Enabled        = false;
            DeleteEnrollmentButton.TouchUpInside += delegate {
                if (IdentityTextField.Text.Length == 0)
                {
                    ShowZoomAlert("Empty Username", "Please enter a username.");
                    return;
                }

                DeleteUser(IdentityTextField.Text.Replace(" ", ""));
            };

            VersionLabel.Text = "Zoom SDK v" + Zoom.Sdk.Version;

            // Set any customizations to ZoOm's default UI and behavior
            var customization = new ZoomCustomization();

            customization.ShowSuccessScreen = false;
            customization.ShowFailureScreen = false;
            Zoom.Sdk.SetCustomization(customization);

            // Initialize the SDK before trying to use it
            Zoom.Sdk.Initialize(appToken, OnInitializeResult);

            // Set your biometric encryption key if provided
            if (hybridEncryptionKey.Length > 0)
            {
                Zoom.Sdk.SetHybridEncryptionKey(hybridEncryptionKey);
            }
        }