Hi everyone :wave: I recently open-sourced a Kotl...
# multiplatform
a
Hi everyone 👋 I recently open-sourced a Kotlin Multiplatform library called
phonenumber
for phone number validation and formatting across Android and iOS. Why I built it: While working on a KMP app, I found myself duplicating phone number validation logic across Android and iOS. Android had
libphonenumber
, iOS had
PhoneNumberKit
, and keeping behavior consistent between both platforms became messy. So I built a shared KMP wrapper that exposes a single API while delegating to each platform’s native implementation. Features: - Global phone number validation - Validation by country ISO code - Validation by country calling code - Format to E.164 - Format to international format - Extract region code - Extract country calling code - Shared API for Android & iOS - Native performance (
libphonenumber
on Android,
PhoneNumberKit
on iOS) GitHub: https://github.com/ajayinnovations/phonenumber Would love feedback on the API design, naming, and any edge cases I might have missed 🙏
K 8
👍 6
t
Sounds very nice! I got curious why just Android and iOS but not the other kmp platforms? 🤔
Ahh ok, found the reason in the readme 😄
• Androiduses Google's`libphonenumber`
• iOSuses`PhoneNumberKit`through a wrapper bridge
a
Yes, I will be adding more platforms too. Thanks for checking it out ☺️
🚀 1
Oh you I got confused by your message. Now I know I will do better next time