I use this in my applications and I thought I just make it into a library.
Simple Utility that hook up your app to this external applications:
- Inbox (SMS)
- Phone
- Facebook Messenger
- Viber
This is usually used in Help/Support section where you link your app to external apps.
Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation "com.github.raquezha:hookr:1.2.0.2"
}
That's it! In case of a build failed, try cleaning or rebuilding your project. If all else fails try to Invalidate Cache and Restart option
var sampleNumber = "+639123456780"
var facebookId = "1231232131"
Hook.up(context).withSMS(sampleNumber)
Hook.up(context).withPhoneCall(sampleNumber)
Hook.up(context).withMessenger(facebookId)
Can't find your facebook ID? use this: https://findmyfbid.com/
Hook.up(context).withViber(facebookId)
Hook.up(context).withWhatsApp(facebookId)
In case something went wrong you can set a callback,
just call the lambda and it
will be the error message.
Hook.up(context).withSMS(sampleNumber) {
...
Log.e("Hookr", "error: $it")
}