Open aravasio opened 1 week ago
@aravasio We have a sample app setup with notifications service and content extensions setup in our react native repo. Could you please try comparing its implementation with yours and checking it is different from yours?
Here is the sample app: https://github.com/CleverTap/clevertap-react-native/tree/master/Example/ios Podfile: https://github.com/CleverTap/clevertap-react-native/blob/master/Example/ios/Podfile Notification Service Extension: https://github.com/CleverTap/clevertap-react-native/tree/master/Example/ios/NotificationServiceSwift
Describe the bug Context: React Native. Issue: I'm trying to implement Push Impressions on the iOS platform by adding a new Notification Service Extension to the project and the application crashes (probably) when it tries to dynamically load the CleverTapSDK on runtime.
To Reproduce I can successfully setup a simple NSE and put a breakpoint on it that stops when the device receives a Push Notification and prints some message. The problem, however, arises when I try to use CleverTap code in it. When following the Push Impressions guide, it's indicated that the necessary code to implement it on iOS is:
However, when trying to include the necessary import (
import CleverTapSDK
), after adding it to the podfile like so:(I have also tried without
:linkage => :dynamic
, or usingclevertap-react-native ...
to no success, either)I start getting application crashes when I receive a Push on the device, and the NSE launches:
Expected behaviour A received Push Notification would trigger the NSE and it will call
didReceiveRequest
successfully, allowing us to track impressions.Screenshots Pictured: The crash itself.![Screenshot 2024-06-26 at 16 42 09](https://github.com/CleverTap/clevertap-ios-sdk/assets/7585675/9a14889b-8b95-40cf-a724-98ebc97aafc8)
Environment (please complete the following information):
Possible Solution I'm not 100% sure. Maybe if linking / setting up the SDK in the NSR requires extra steps, document them?
Additional Info This seems to only stop crashing when I comment the
pod 'CleverTap-iOS-SDK'
and remove import / code from the NSE. Just adding the pod on the NSE target seems to be reason for the crash.