A phone numbers tool library that can be run on the web, node and Android. Features:
Refer to JS docs annotations.
To run in the browser either include this html tag in the page:
<script src="//github.com/garronej/phone-number/releases/download/intlTelInputUtils/utils.js>"></script>
Or lazily load the heavy utils script dependency with:
await phoneNumber.remoteLoadUtil();
By default the script is loaded from:
//github.com/garronej/phone-number/releases/download/intlTelInputUtils/utils.js
Some old browser require the script to be downloaded from the site's domain
in this case use:
await phoneNumber.remoteLoadUtil("//my-page.com/utils.js");
And host utils.js
on your server.
Place ./phone_number.js
in res/raw
in your android project.
Include LiquidPlayer/LiquidCore
to your android project.
build.gradle:
dependencies {
compile 'com.github.LiquidPlayer:LiquidCore:0.5.0'
}
Import (copy/paste) the class ./PhoneNumber.java
to your package.
After that static class PhoneNumber
provide the same API that the JS lib
except for function optional argument where java null
should be passed in
place of javascript undefined
.