Closed rajeshzmoke closed 1 year ago
Hi @rajeshzmoke
We'll check this internally and get back to you.
Hi @rajeshzmoke
This issue is expected for Android 12 and above if you have not catered the Notification trampolines handling.
Apps need to add the manual handling for android 12 onwards to inform the CleverTap SDK about the notification click and get the In-App message.
To achieve the same, add the following code in the onNewIntent()
method of the Launcher/Main FlutterActivity:
class MainActivity : FlutterActivity() {
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
// On Android 12, Raise notification clicked event when Activity is already running in activity backstack
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
cleverTapDefaultInstance?.pushNotificationClickedEvent(intent!!.extras)
}
}
}
The same is referred in the CleverTap Android Push doc.
Closing this ticket. Feel free to reopen the issue if you have any further questions.
what about java?
My MainActivity.java is extended using FlutterActivity class
e.x public class MainActivity extends FlutterActivity {}
How can I declare cleverTapDefaultInstance?.pushNotificationClickedEvent(intent!!.extras) in my activity?
Hi @HAFIZkhan-source
Please refer the doc on how to access the CleverTap Instance.
@shivamsharma2710 The above doc was not helpful. My MainActivity is extended using FlutterActivity using Java and having the onCreate method only. So my doubt is what should I pass into cleverTapDefaultInstance?.pushNotificationClickedEvent() method parameter? like in kotlin we can pass intent!!.extras
clevertap plugin
clevertap_plugin: ^1.6.0
Template used on CT dashboard
flutter doctor
Clicking on notfication gives the following logs, but In-App message is not shown