CleverTap / clevertap-react-native

CleverTap React Native SDK
Other
59 stars 71 forks source link

Build error when adding iOS native config for deep linking #401

Open edhesketh opened 1 month ago

edhesketh commented 1 month ago

I have implemented CleverTap push notifications in a react native app, and am adding the additional config required for deep linking on iOS (as described here: https://developer.clevertap.com/docs/push-notifications-ios#custom-handling-deeplinkexternal-url)

When I add the suggested CleverTapURLDelegate method below, I get the following error in xcode and the project fails to build: Conflicting parameter types in implementation of 'shouldHandleCleverTapURL:forChannel:': '__strong id' vs 'CleverTapChannel'

// CleverTapURLDelegate method 
- (BOOL)shouldHandleCleverTapURL:(NSURL *)url forChannel:(CleverTapChannel)channel {
    NSLog(@"Handling URL: \(%@) for channel: \(%d)", url, channel);
    return YES;
}

I'm using version 2.2.1

akashvercetti commented 3 weeks ago

@edhesketh just a quick question. Does importing via #import <CleverTapSDK/CleverTapURLDelegate.h> not work? If so, could you try #import "CleverTapURLDelegate.h" ?

edhesketh commented 2 weeks ago

Thanks for the response @akashvercetti. Yes we're importing via #import <CleverTapSDK/CleverTapURLDelegate.h> but CleverTapURLDelegate.h requires some symbols which are defined in CleverTap.h. This change in the clevertap-ios-sdk would seem to resolve it: https://github.com/CleverTap/clevertap-ios-sdk/pull/366