View on Asset Store (opens in new tab)
Package details
- Latest version
- 1.0.0
- Last updated
- First released
- Unity version
- 6000.0.44 or later
- Package size
- 983 KB
- Files
- 26
- Favorites
- 1
- Views in the past week
- 8
Price tracking
- Last checked
- Tracked since
- Lowest recorded
- $9.49 on
Keywords
Native Phone Number Picker for Android™ and iOS™ with Editor Integration
Native Phone Number Picker for Android™ & iOS™ with Editor Integration for Unity™ Android is a trademark of Google LLC.
Affiliate link · Purchases support this site
Price history
Last 6 months
USDAsset preview
1 / 3
Native Phone Number Picker for Android™ and iOS™ with Editor Integration screenshot 1
About this asset
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.
From the publisher's Asset Store listing.
Technical details
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 NativePhonePicker
var picker = new NativePhonePicker();
// (2) Create parameters for the dialog
var 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 asynchronously
var result = await picker.ShowPhoneNumberDialogAsync(pickerParams);
// (4) Process the result
if (result.Item2 == NativePhoneErrorCodes.NoError)
{
this.label.text = $"{result.Item1.DialCode}{result.Item1.Number}";
}
else
{
this.label.text = $"Error: {result.Item2}";
}
Compatibility
| Unity version | Built-in | URP | HDRP | Custom |
|---|---|---|---|---|
| 6000.0.44f1 | Compatible | Compatible | Compatible | Compatible |
As listed on the Asset Store.