You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
import CleverTapSDK // This import is not specified in the documentation, but my understanding is that it's necessary to acces the `CleverTap` namespace.
class NotificationService: UNNotificationServiceExtension {
var contentHandler: ((UNNotificationContent) -> Void)?
var bestAttemptContent: UNMutableNotificationContent?
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
CleverTap.sharedInstance()?.recordNotificationViewedEvent(withData: request.content.userInfo)
super.didReceive(request, withContentHandler: contentHandler)
}
override func serviceExtensionTimeWillExpire() {
if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
contentHandler(bestAttemptContent)
}
}
}
However, when trying to include the necessary import (import CleverTapSDK), after adding it to the podfile like so:
target 'NotificationServiceExtension' do
use_frameworks! :linkage => :dynamic
pod 'CleverTap-iOS-SDK'
#pod 'clevertap-react-native', :path => '../node_modules/clevertap-react-native'
end
(I have also tried without :linkage => :dynamic, or using clevertap-react-native ... to no success, either)
I start getting application crashes when I receive a Push on the device, and the NSE launches:
dyld[8764]: Library not loaded: @rpath/CleverTapSDK.framework/CleverTapSDK
Referenced from: <43C0D5B0-B598-3B09-8910-7E84ECC63AEA> /private/var/containers/Bundle/Application/D66E599F-EC8B-42E7-8A46-3A39CD4AE0C9/mobileapp.app/PlugIns/NotificationServiceExtension.appex/NotificationServiceExtension
Reason: tried: '/usr/lib/swift/CleverTapSDK.framework/CleverTapSDK' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/CleverTapSDK.framework/CleverTapSDK' (no such file), '/private/var/containers/Bundle/Application/D66E599F-EC8B-42E7-8A46-3A39CD4AE0C9/mobileapp.app/PlugIns/NotificationServiceExtension.appex/Frameworks/CleverTapSDK.framework/CleverTapSDK' (no such file), '/private/var/containers/Bundle/Application/D66E599F-EC8B-42E7-8A46-3A39CD4AE0C9/mobileapp.app/PlugIns/NotificationServiceExtension.appex/Frameworks/CleverTapSDK.framework/CleverTapSDK' (no such file), '/private/var/containers/Bundle/Application/D66E599F-EC8B-42E7-8A46-3A39CD4AE0C9/mobileapp.app/Frameworks/CleverTapSDK.framework/CleverTapSDK' (no such file), '/usr/lib/swift/CleverTapSDK.framework/CleverTapSDK' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/CleverTapSDK.framework/CleverTapSDK' (no such file), '/private/var/containers/Bundle/Application/D66E599F-EC8B-42E7-8A46-3A39CD4AE0C9/mobileapp.app/PlugIns/NotificationServiceExtension.appex/Frameworks/CleverTapSDK.framework/CleverTapSDK' (no such file), '/private/var/containers/Bundle/Application/D66E599F-EC8B-42E7-8A46-3A39CD4AE0C9/mobileapp.app/PlugIns/NotificationServiceExtension.appex/Frameworks/CleverTapSDK.framework/CleverTapSDK' (no such file), '/private/var/containers/Bundle/Application/D66E599F-EC8B-42E7-8A46-3A39CD4AE0C9/mobileapp.app/Frameworks/CleverTapSDK.framework/CleverTapSDK' (no such file)
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.
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.
The text was updated successfully, but these errors were encountered:
@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?
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.
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.
The text was updated successfully, but these errors were encountered: