
Native Phone Number Picker for Android™ and iOS™ with Editor Integration
Protorius42
$10.44
(no ratings)
Jump AssetStore
Native Phone Number Picker for Android™ & iOS™ with Editor Integration for Unity™
Android is a trademark of Google LLC.You can quickly and effortlessly implement a native phone number input solution with a country code picker featuring system flags and automatic dial codes. Users simply select their country and enter their number.We hope this asset saves you significant time and effort on UI implementation, allowing you to concentrate on your core game or application development.Android is a trademark of Google LLC.Features:Native UI Integration: This integration utilizes the native contact picker UI on both platforms, ensuring a consistent and intuitive user experience that aligns with platform conventions.Cross-Platform Compatibility Designed to work seamlessly on both platforms with a unified API, simplifying development and deployment.Clear and Concise API Offers a straightforward and easy-to-use C# API for developers to integrate the phone number picker functionality into their applications with minimal code.Optimized Performance Leverages native platform functionalities for optimal performance and responsiveness.Easy to Use and Implement, Source Code Included: The plugin boasts a straightforward API designed for ease of integration. The complete source code is included, allowing for free modification and customization to fit your specific project needs.Thread-Safe: The plugin's core functionality is thread-safe, ensuring reliable operation even in multithreaded Unity environments.Error-Safe Handling: The API provides robust error-handling mechanisms, allowing you to gracefully manage scenarios where the user might fail or cancel phone number picking.Async/Await Pattern: The primary API method, `ShowPhoneNumberDialogAsync`, utilizes the modern `async/await` pattern for asynchronous operation. This prevents blocking the main Unity thread, ensuring a smooth and responsive user experience.Unity Editor Dialog: The plugin includes a convenient Unity Editor dialog that mirrors the runtime functionality, allowing for easy testing and iteration directly within the Unity Editor.System Font Flags: The country selection within the picker utilizes the device's native system fonts to display country flags, ensuring consistent and up-to-date flag visuals.SwiftUI Showcase: Demonstrates seamless integration between Unity and native SwiftUI, including a practical callback mechanism from native Swift to Unity.Unity & Jetpack Compose UI Integration Example (Kotlin): This example demonstrates seamless integration between Unity and native Jetpack Compose UI (Kotlin), including a practical callback mechanism from native Kotlin to Unity.Simulator Support: The plugin is fully functional within the device simulator, providing a convenient environment for testing and debugging your application's integration without requiring a physical device.Using the API in C#https://gist.github.com/protorius42/d8aea9dbb0ed439fa11367250b29cd20// (1) Create an instance of NativePhonePickervar picker = new NativePhonePicker();// (2) Create parameters for the dialogvar pickerParams = new NativePhonePickerParams(textFieldLabel: "What's your phone number?",buttonLabel: "Confirm",selectedCountry: "US",title: "Phone Picker Sample",selectedCountryLabel: "Select Country");// (3) Show the phone number picker dialog asynchronouslyvar result = await picker.ShowPhoneNumberDialogAsync(pickerParams);// (4) Process the resultif (result.Item2 == NativePhoneErrorCodes.NoError){this.label.text = $"{result.Item1.DialCode}{result.Item1.Number}";}else{this.label.text = $"Error: {result.Item2}";}