You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think an SDK must reduce the dependencies with another dependencies. It is a good idea to avoid usage of RemoteMessage in braze functions inside BrazeFirebaseMessagingService. I mean is better to just pass what you are going to use.
😭 My problem
In my case, I'm using this library as a component that belong to my background message layer. My problem is the way that you use a firebase model force me to include firebase in my Braze component.
🧰 Example of potencial improvements:
Function: isBrazePushNotification
funisBrazePushNotification(remoteMessage:RemoteMessage): Boolean {
val remoteMessageData = remoteMessage.data
return"true"== remoteMessageData[Constants.BRAZE_PUSH_BRAZE_KEY]
}
funhandleBrazeRemoteMessage(context:Context, remoteMessage:RemoteMessage): Boolean {
if (!isBrazePushNotification(remoteMessage)) {
brazelog(I) { "Remote message did not originate from Braze. Not consuming remote message: $remoteMessage" }
returnfalse
}
val remoteMessageData = remoteMessage.data
brazelog(I) { "Got remote message from FCM: $remoteMessageData" }
val pushIntent =Intent(BrazePushReceiver.FIREBASE_MESSAGING_SERVICE_ROUTING_ACTION)
val bundle =Bundle()
for ((key, value) in remoteMessageData) {
brazelog(V) { "Adding bundle item from FCM remote data with key: $key and value: $value" }
bundle.putString(key, value)
}
pushIntent.putExtras(bundle)
BrazePushReceiver.handleReceivedIntent(context, pushIntent)
returntrue
}
💡 Suggestion:
funhandleBrazeRemoteMessage(context:Context, data:Map<String, String>): Boolean {
if (!isBrazePushNotification(data)) {
brazelog(I) { "Remote message did not originate from Braze. Not consuming remote message: $remoteMessage" }
returnfalse
}
brazelog(I) { "Got remote message from FCM: $data" }
val pushIntent =Intent(BrazePushReceiver.FIREBASE_MESSAGING_SERVICE_ROUTING_ACTION)
val bundle =Bundle()
for ((key, value) in data) {
brazelog(V) { "Adding bundle item from FCM remote data with key: $key and value: $value" }
bundle.putString(key, value)
}
pushIntent.putExtras(bundle)
BrazePushReceiver.handleReceivedIntent(context, pushIntent)
returntrue
}
The text was updated successfully, but these errors were encountered:
🗒️ Context
I think an SDK must reduce the dependencies with another dependencies. It is a good idea to avoid usage of
RemoteMessage
in braze functions insideBrazeFirebaseMessagingService
. I mean is better to just pass what you are going to use.😭 My problem
In my case, I'm using this library as a component that belong to my background message layer. My problem is the way that you use a firebase model force me to include firebase in my Braze component.
🧰 Example of potencial improvements:
Function: isBrazePushNotification
💡 Suggestion:
Function: handleBrazeRemoteMessage
💡 Suggestion:
The text was updated successfully, but these errors were encountered: