
Native Country Picker for Android™ and iOS™ with Editor Integration
Protorius42
$5.49
(no ratings)
Jump AssetStore
Native Country Picker for Android™ & iOS™ with Editor Integration for Unity™
Android is a trademark of Google LLC.Simplify country code input in your Android and iOS games and apps! This plugin features an intuitive country code and name picker with system font flags. Users simply select their country. Easy to integrate and well-tested. Includes well-tested source code for free modification. Supports iOS 15+, Android 22+, Unity 2023 & 6.Android is a trademark of Google LLC.FeaturesNative UI Integration: Utilizes the native contact picker UI on both Android and iOS, ensuring a consistent and intuitive user experience that aligns with platform conventions.Cross-Platform Compatibility Designed to work seamlessly on both Android and iOS platforms with a unified API, simplifying development and deployment.Clear and Concise API Offers a straightforward and easy-to-use C# API for Unity developers to integrate the country name 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 country picking might fail or be canceled by the user.Async/Await Pattern: The primary API method, `ShowCountryDialogAsync`, 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 iOS SwiftUI, including a practical callback mechanism from native Swift to Unity.Unity & Jetpack Compose UI Integration Example (Kotlin): Demonstrates seamless integration between Unity and native Android Jetpack Compose UI (Kotlin), including a practical callback mechanism from native Kotlin to Unity.Using the API in C#Code available here: https://gist.github.com/protorius42/ec013279e0b9bc1ef0f4ac19912d0b7b// (1) Create an instance of NativeCountryPickervar picker = new NativeCountryPicker();// (2) Create parameters for the dialogvar pickerParams = new NativeCountryPickerParams(label: "What's your country?", selectedCountry: "US", closeButtonLabel: "Close";//(3) Show the country picker dialog asynchronouslyvar result = await picker.ShowCountryDialogAsync(pickerParams);// (4) Process the resultif (this.label != null){ if (result.Item2 == NativeCountryErrorCodes.NoError) { Debug.Log($"[{result.Item1.CountryCode}]{CountryList.Countries[result.Item1.CountryCode].Name}") } else { Debug.Log($"Error: {result.Item2}"; }