Step 1. add MagicPush SDK to your app build.gradle

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'

Step 2. add notifications permission to your manifest

Add the following permission to your manifest file.

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

Step 2. integrate the SDK into your base activity.

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!