1SFMCSdk.configure(applicationContext as Application, SFMCSdkModuleConfig.build {
2 pushModuleConfig = MarketingCloudConfig.builder().apply {
3 setApplicationId("{mc_application_id}")
4 setAccessToken("{mc_access_token}")
5 setSenderId("{fcm_sender_id}")
6 setMarketingCloudServerUrl("{marketing_cloud_url}")
7 setMid("{mid}")
8 setNotificationCustomizationOptions("{your instance of NotificationCustomizationOptions}")
9
10 // Tell the SDK how to handle button & Carousel clicks in a Push Notification
11 setUrlHandler(UrlHandler { context, url, _ ->
12 PendingIntent.getActivity(
13 context,
14 Random().nextInt(),
15 Intent(Intent.ACTION_VIEW, Uri.parse(url)),
16 PendingIntent.FLAG_UPDATE_CURRENT
17 )
18 })
19 // Other configuration options
20 }.build(applicationContext)
21}) {
22 // TODO handle initialization status
23}