Skip to content

Commit

Permalink
pr suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
mrehan27 committed Sep 25, 2023
1 parent 9b29848 commit e9d8395
Showing 1 changed file with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,30 @@ class NotificationClickReceiverActivity : Activity(), TrackableScreen {
return

Check warning on line 64 in messagingpush/src/main/java/io/customer/messagingpush/activity/NotificationClickReceiverActivity.kt

View check run for this annotation

Codecov / codecov/patch

messagingpush/src/main/java/io/customer/messagingpush/activity/NotificationClickReceiverActivity.kt#L63-L64

Added lines #L63 - L64 were not covered by tests
}

val diGraph = sdkInstance.diGraph
val deepLinkUtil: DeepLinkUtil = diGraph.deepLinkUtil
val moduleConfig: MessagingPushModuleConfig = diGraph.moduleConfig

val deliveryId = payload.cioDeliveryId
val deliveryToken = payload.cioDeliveryToken
val deepLink = payload.deepLink?.takeIfNotBlank()
val moduleConfig: MessagingPushModuleConfig = sdkInstance.diGraph.moduleConfig
trackMetrics(moduleConfig, payload)
handleDeepLink(moduleConfig, payload)
}

Check warning on line 70 in messagingpush/src/main/java/io/customer/messagingpush/activity/NotificationClickReceiverActivity.kt

View check run for this annotation

Codecov / codecov/patch

messagingpush/src/main/java/io/customer/messagingpush/activity/NotificationClickReceiverActivity.kt#L67-L70

Added lines #L67 - L70 were not covered by tests

private fun trackMetrics(
moduleConfig: MessagingPushModuleConfig,
payload: CustomerIOParsedPushPayload
) {
if (moduleConfig.autoTrackPushEvents) {
sdkInstance.trackMetric(deliveryId, MetricEvent.opened, deliveryToken)
CustomerIO.instance().trackMetric(
payload.cioDeliveryId,
MetricEvent.opened,
payload.cioDeliveryToken

Check warning on line 80 in messagingpush/src/main/java/io/customer/messagingpush/activity/NotificationClickReceiverActivity.kt

View check run for this annotation

Codecov / codecov/patch

messagingpush/src/main/java/io/customer/messagingpush/activity/NotificationClickReceiverActivity.kt#L77-L80

Added lines #L77 - L80 were not covered by tests
)
}
}

Check warning on line 83 in messagingpush/src/main/java/io/customer/messagingpush/activity/NotificationClickReceiverActivity.kt

View check run for this annotation

Codecov / codecov/patch

messagingpush/src/main/java/io/customer/messagingpush/activity/NotificationClickReceiverActivity.kt#L83

Added line #L83 was not covered by tests

private fun handleDeepLink(
moduleConfig: MessagingPushModuleConfig,
payload: CustomerIOParsedPushPayload
) {
val deepLinkUtil: DeepLinkUtil = CustomerIO.instance().diGraph.deepLinkUtil

Check warning on line 89 in messagingpush/src/main/java/io/customer/messagingpush/activity/NotificationClickReceiverActivity.kt

View check run for this annotation

Codecov / codecov/patch

messagingpush/src/main/java/io/customer/messagingpush/activity/NotificationClickReceiverActivity.kt#L89

Added line #L89 was not covered by tests
val deepLink = payload.deepLink?.takeIfNotBlank()

// check if host app overrides the handling of deeplink
val notificationCallback = moduleConfig.notificationCallback

Check warning on line 93 in messagingpush/src/main/java/io/customer/messagingpush/activity/NotificationClickReceiverActivity.kt

View check run for this annotation

Codecov / codecov/patch

messagingpush/src/main/java/io/customer/messagingpush/activity/NotificationClickReceiverActivity.kt#L93

Added line #L93 was not covered by tests
Expand Down

0 comments on commit e9d8395

Please sign in to comment.