I'm facing an issue
I'm trying to integrate the Salesforce SDK into flutter and create a flutter plugin, so far everything is ok, only on android when the app is closed, I don't receive any notification, since communication between Flutter and native codes are via MethodChannel and binaryMessenger. So there is no OnCreate method in which I config the sdk ( It was mentioned in order to receive notification on background, it's a requirements).
Even I created a CustomFirebaseMessagingService to receive the push messages there, the messages are received there but when the app is terminated I don't get any notification(it's related to the SDK configuration which might be terminated). If I config and initialize the SDK on this onMessageReceived, I get the notifications but the context is differ from the flutter app's context.
class CustomMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(message: RemoteMessage) {
if (PushMessageManager.isMarketingCloudPush(message)) {
SFMCSdk.requestSdk { sdk ->
sdk.mp {
it.pushMessageManager.handleMessage(message)
}
}
}
}
override fun onNewToken(token: String) {
SFMCSdk.requestSdk { sdk ->
sdk.mp {
it.pushMessageManager.setPushToken(token)
}
}
}
Any Idea how to resolve this issue ?