Add the following line to your dependencies in your app level build.gradle. Check here for the latest version of the library.
implementation 'com.getmagicpush.sdk:magicpush:1.0.2'
Add the following permission to your manifest file.
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
Replace “YOUR APP ID HERE” with the app ID you can get here.
open class BaseActivity: AppCompatActivity() {
private var magicPushSdk: MagicPushSDK? = null
override fun onCreate(savedInstanceState: Bundle?) {
magicPushSdk = MagicPushSDK(this)
magicPushSdk!!.authenticate("YOUR APP ID HERE")
magicPushSdk!!.requestPermission(this)
}
}
That’s it!