clevertap-react-native icon indicating copy to clipboard operation
clevertap-react-native copied to clipboard

TypeError: Cannot read property 'wzrk_dl' of undefined

Open neel132 opened this issue 3 years ago • 9 comments

Encountered this issue in production.

Error Stack trace -

Fatal Exception: com.facebook.react.common.JavascriptException: TypeError: Cannot read property 'wzrk_dl' of undefined, js engine: hermes, stack:
anonymous@1:588099
value@1:100919
value@1:93982
anonymous@1:92620
value@1:93577
value@1:92578

       at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:83)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
       at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
       at android.os.Looper.loop(Looper.java:264)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
       at java.lang.Thread.run(Thread.java:923)


Device -

Android Version - 11 Device - Oppo F11

neel132 avatar Oct 16 '22 16:10 neel132

@neel132 Can you share full stack trace, we can't find origin of error in clevertap file.

piyush-kukadiya avatar Oct 21 '22 07:10 piyush-kukadiya

@piyush-kukadiya this is happening only on production. This stack trace i got from firebase crashlytics.

neel132 avatar Oct 21 '22 08:10 neel132

@piyush-kukadiya any update on this ?

neel132 avatar Oct 27 '22 14:10 neel132

@neel132 Are you using CLEVERTAP_PUSH_NOTIFICATION_CLICKED callback in js?

piyush-kukadiya avatar Oct 28 '22 06:10 piyush-kukadiya

@piyush-kukadiya Implementation -

CleverTap.addListener(CleverTap.CleverTapPushNotificationClicked, (e) => {
  console.log(e.customExtras.wzrk_dl);
})

neel132 avatar Oct 28 '22 06:10 neel132

@neel132 Why are you using customExtras.wzrk_dl ? Where did you find it? Please check payload in console and use accordingly.

piyush-kukadiya avatar Oct 28 '22 09:10 piyush-kukadiya

@piyush-kukadiya I found this key by logging an event once notification is clicked , also i was able to access deep link using this key.

neel132 avatar Oct 28 '22 10:10 neel132

@neel132 customExtras comes in case of iOS. For android we don't have customExtras, you can try e.wzrk_dl for Android. We will fix this in upcoming release.

piyush-kukadiya avatar Oct 28 '22 10:10 piyush-kukadiya

@neel132 Why are you using customExtras.wzrk_dl ? Where did you find it? Please check payload in console and use accordingly.

Hi. I am facing the same issue. I am not sure this is an acceptable reply. You use typescript, so the Event should be correctly typed, we should not need to use console.log() for this. That example is what you have in the official documentation, here https://developer.clevertap.com/docs/react-native-push-notification#handle-push-notification-callback

If this is not correct, please update the documentation so that it reflects the reality.

Thanks

dani-z avatar Mar 03 '23 14:03 dani-z