Essential Kit Tutorials
DocumentationDownload
Latest(v3)
Latest(v3)
  • Introduction
  • Features Overview
  • Whats new in v3
    • Version 3 vs Version 2
    • Release Notes
    • Upgrade from V2
  • Plugin Overview
    • Settings
    • Folder Structure
    • Installation FAQ
    • Upgrade Guide
  • Features
    • 📒Address Book
      • Setup
      • Usage
      • Testing
      • FAQ
    • App Shortcuts
      • Setup
      • Usage
    • 🆕App Updater
      • Setup
      • Usage
      • Testing
    • 💲Billing Services
      • Setup
        • iOS
        • Android
      • Usage
      • Testing
        • iOS
        • Android
      • FAQ
    • ☁️Cloud Services
      • Setup
        • iOS
        • Android
      • Usage
      • Testing
      • FAQ
    • 🔗Deep Link Services
      • Setup
        • iOS
        • Android
      • Usage
      • Testing
      • FAQ
    • 🛠️Utilities (Extras)
      • Usage
    • 💯Game Services
      • Setup
        • iOS
        • Android
      • Usage
      • FAQ
    • 📸Media Services
      • Setup
      • Usage
      • FAQ
    • 📆Native UI
      • Setup
      • Usage
      • FAQ
      • Examples
        • Login Dialog
    • Network Services
      • Setup
      • Usage
      • FAQ
    • ⏰Notification Services
      • Setup
        • iOS
        • Android
      • Usage
      • Examples
        • Nudge to come-back to the game
      • FAQ
    • ⭐Rate My App
      • Setup
      • Usage
      • FAQ
    • 🤝Sharing
      • Setup
      • Usage
        • Message Composer
        • Mail Composer
        • Social Share Composer
        • Share Sheet
      • FAQ
      • Examples
        • Add Attachment Example
    • Task Services
      • Setup
      • Usage
    • 🌏Web View
      • Setup
      • Usage
      • FAQ
      • Examples
        • Loading Pdf File
  • Notes
    • Resolving Android Gradle Build Errors
    • Google Play Services Authentication
    • Target API Level vs Min API Level
    • Handling Refunds for In-App Purchases (Billing Services)
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Features
  2. Native UI
  3. Examples

Login Dialog

Example to show how to use Alert Dialog for login screen

using UnityEngine;
using VoxelBusters.CoreLibrary;
using VoxelBusters.EssentialKit;


public class LoginView : MonoBehaviour
{
    public void Show()
    {
        //Construct the alert builder
        AlertDialogBuilder builder = new AlertDialogBuilder();
        builder.SetTitle("Log in");
        builder.SetMessage("To access you account need to log in");

        //Create text input field options for entering email
        var emailInputOptions = new TextInputFieldOptions.Builder()
            .SetPlaceholderText("Enter your email here")
            .SetKeyboardInputType(KeyboardInputType.EmailAddress)
            .Build();        

        //Create text input field options for entering password
        var passwordInputOptions = new TextInputFieldOptions.Builder()
            .SetPlaceholderText("Enter your password here")
            .SetIsSecured(true)
            .Build();  
                                
        builder.AddTextInputField(emailInputOptions);
        builder.AddTextInputField(passwordInputOptions);
        builder.AddButton("Log in", (string[] inputValues) => {
            Debug.Log($"Entered email address : {inputValues[0]}");                 
            Debug.Log($"Entered email password : {inputValues[1]}");                                               
        });
        builder.AddButton("Cancel", () => Debug.Log("Cancel clicked"));
    
    
        //Build the dialog from constructed builder and show
        AlertDialog dialog = builder.Build();
        dialog.Show();
    }
}
PreviousExamplesNextNetwork Services

Last updated 3 months ago

Was this helpful?

📆