CleverTap / clevertap-react-native

CleverTap React Native SDK
Other
59 stars 71 forks source link

onNotificationOpenedApp not trigger and getInitialNotification getting null on iOS after added ClearTap #375

Open kukadiyaAni opened 8 months ago

kukadiyaAni commented 8 months ago

I'm using clevertap-react-native:1.2.1 and after setting up ClearTap, stop getting the default firebase onNotificationOpenedApp event when tapping on notification and getInitialNotification returns null when clicking on notification and the app is closed

it was working fine before setup ClearTap

Note: When sending notifications from FCM not from ClearTap and it's happen only iOS, Android works fine

For handling ClearTap push notifications click the event below code

CleverTap.addListener(CleverTap.CleverTapPushNotificationClicked, (e)=>{/*consume the event*/})

This event trigger when app force close and tap on notification but if app is active in background then above method is not trigger.

nishant-clevertap commented 8 months ago

Hi @kukadiyaAni

Can you answer following to investigate it:

  1. Which SDK is ClearTap which you have mentioned? Can you mention their documentation?
  2. How have you integrated CleverTap SDK? Do you have used autoIntegrate or manually integrate SDK?
  3. Are you able to get notification callback in all states(foreground, background, killed) when push is sent from CleverTap in iOS?
  4. Can you share debug enabled CleverTap logs in case of app is active in background.
kukadiyaAni commented 8 months ago

@nishant-clevertap Thanks for your time

  1. Which SDK is ClearTap which you have mentioned? Can you mention their documentation? => "clevertap-react-native": "^1.2.1" => https://developer.clevertap.com/docs/react-native => https://developer.clevertap.com/docs/react-native-push-notification

  2. How have you integrated CleverTap SDK? Do you have used autoIntegrate or manually integrated SDK? => We just yarn clevertap-react-native and added the method as per documentation and documentation mentioned in above

  3. Are you able to get a notification callback in all states(foreground, background, killed) when a push is sent from CleverTap in iOS? => Yes, I got and I also got a notification tap event as well but after Integrated ClearTap all firebase notification callback and event stop woking as I mention in question onNotificationOpenedApp and getInitialNotification

nishant-clevertap commented 8 months ago

@kukadiyaAni Can you try integrating CleverTap SDK manually as mentioned here in doc: https://developer.clevertap.com/docs/push-notifications-ios#manually-integrating-push-notification-support

kukadiyaAni commented 8 months ago

@nishant-clevertap you shared documentation for iOS, we have an issue in iOS but we are using react-native, we need an event in react-native side

nishant-clevertap commented 8 months ago

@kukadiyaAni You will also have AppDelegate file in React native in iOS, You have to add methods in that file only as mentioned in doc.