diff --git a/ios/RNAppsFlyer.h b/ios/RNAppsFlyer.h index 8a4123f0..ee80d9a7 100755 --- a/ios/RNAppsFlyer.h +++ b/ios/RNAppsFlyer.h @@ -27,7 +27,7 @@ static NSString *const NO_DEVKEY_FOUND = @"No 'devKey' found or its static NSString *const NO_APPID_FOUND = @"No 'appId' found or its empty"; static NSString *const NO_EVENT_NAME_FOUND = @"No 'eventName' found or its empty"; static NSString *const EMPTY_OR_CORRUPTED_LIST = @"No arguments found or list is corrupted"; -static NSString *const SUCCESS = @"Success"; +static NSString *const AF_SUCCESS = @"Success"; static NSString *const INVALID_URI = @"Invalid URI"; static NSString *const IOS_14_ONLY = @"Feature only supported on iOS 14 and above"; diff --git a/ios/RNAppsFlyer.m b/ios/RNAppsFlyer.m index 6dd5dfa1..cf455015 100755 --- a/ios/RNAppsFlyer.m +++ b/ios/RNAppsFlyer.m @@ -14,7 +14,7 @@ @implementation RNAppsFlyer NSError* error = nil; error = [self callSdkInternal:initSdkOptions]; if (error == nil){ - successCallback(@[SUCCESS]); + successCallback(@[AF_SUCCESS]); }else{ errorCallback(error); } @@ -27,7 +27,7 @@ @implementation RNAppsFlyer NSError* error = nil; error = [self callSdkInternal:initSdkOptions]; if (error == nil){ - resolve(@[SUCCESS]); + resolve(@[AF_SUCCESS]); }else{ reject([NSString stringWithFormat: @"%ld", (long)error.code], error.domain, error); } } @@ -83,7 +83,7 @@ -(NSError *) callSdkInternal:(NSDictionary*)initSdkOptions { [AppsFlyerLib shared].appleAppID = appId; [AppsFlyerLib shared].appsFlyerDevKey = devKey; [AppsFlyerLib shared].isDebug = isDebug; - + ® if(error != nil){ return error; } @@ -141,7 +141,7 @@ -(NSError *) callSdkInternal:(NSDictionary*)initSdkOptions { errorCallback(@[error.localizedDescription]); return; } - successCallback(@[SUCCESS]); + successCallback(@[AF_SUCCESS]); }]; } @@ -159,7 +159,7 @@ -(NSError *) callSdkInternal:(NSDictionary*)initSdkOptions { reject([NSString stringWithFormat: @"%ld", (long)error.code], error.domain, error); return; } - resolve(@[SUCCESS]); + resolve(@[AF_SUCCESS]); }]; } @@ -238,18 +238,18 @@ -(NSError *) callSdkInternal:(NSDictionary*)initSdkOptions { RCT_EXPORT_METHOD(setCustomerUserId: (NSString *)userId callback:(RCTResponseSenderBlock)callback) { [[AppsFlyerLib shared] setCustomerUserID:userId]; - callback(@[SUCCESS]); + callback(@[AF_SUCCESS]); } RCT_EXPORT_METHOD(stop: (BOOL)isStopped callback:(RCTResponseSenderBlock)callback) { [AppsFlyerLib shared].isStopped = isStopped; - callback(@[SUCCESS]); + callback(@[AF_SUCCESS]); } RCT_EXPORT_METHOD(logLocation: (double)longitude latitude:(double)latitude callback:(RCTResponseSenderBlock)callback) { [[AppsFlyerLib shared] logLocation:longitude latitude:latitude]; NSArray *events = @[[NSNumber numberWithDouble:longitude], [NSNumber numberWithDouble:latitude]]; - callback(@[SUCCESS, events]); + callback(@[AF_SUCCESS, events]); } RCT_EXPORT_METHOD(setUserEmails: (NSDictionary*)options @@ -288,7 +288,7 @@ -(NSError *) callSdkInternal:(NSDictionary*)initSdkOptions { } else{ [[AppsFlyerLib shared] setUserEmails:emails withCryptType:emailsCryptType]; - successCallback(@[SUCCESS]); + successCallback(@[AF_SUCCESS]); } } @@ -301,19 +301,19 @@ -(void)sendLaunch:(UIApplication *)application { RCT_EXPORT_METHOD(setAdditionalData: (NSDictionary *)additionalData callback:(RCTResponseSenderBlock)callback) { [[AppsFlyerLib shared] setAdditionalData:additionalData]; - callback(@[SUCCESS]); + callback(@[AF_SUCCESS]); } //USER INVITES RCT_EXPORT_METHOD(setAppInviteOneLinkID: (NSString *)oneLinkID callback:(RCTResponseSenderBlock)callback) { [AppsFlyerLib shared].appInviteOneLinkID = oneLinkID; - callback(@[SUCCESS]); + callback(@[AF_SUCCESS]); } RCT_EXPORT_METHOD(setCurrencyCode: (NSString *)currencyCode callback:(RCTResponseSenderBlock)callback) { [[AppsFlyerLib shared] setCurrencyCode:currencyCode]; - callback(@[SUCCESS]); + callback(@[AF_SUCCESS]); } RCT_EXPORT_METHOD(generateInviteLink: (NSDictionary *)inviteLinkOptions @@ -501,7 +501,7 @@ - (BOOL)isExpoApp { RCT_EXPORT_METHOD(anonymizeUser: (BOOL *)b callback:(RCTResponseSenderBlock)callback) { [AppsFlyerLib shared].anonymizeUser = b; - callback(@[SUCCESS]); + callback(@[AF_SUCCESS]); } RCT_EXPORT_METHOD(updateServerUninstallToken: (NSString *)deviceToken callback:(RCTResponseSenderBlock)callback) { @@ -517,21 +517,21 @@ - (BOOL)isExpoApp { [deviceTokenData appendBytes:&whole_byte length:1]; } [[AppsFlyerLib shared] registerUninstall:deviceTokenData]; - callback(@[SUCCESS]); + callback(@[AF_SUCCESS]); } RCT_EXPORT_METHOD(setOneLinkCustomDomains:(NSArray *) domains successCallback :(RCTResponseSenderBlock)successCallback errorCallback:(RCTResponseErrorBlock)errorCallback) { [[AppsFlyerLib shared] setOneLinkCustomDomains:domains]; - successCallback(@[SUCCESS]); + successCallback(@[AF_SUCCESS]); } RCT_EXPORT_METHOD(setResolveDeepLinkURLs:(NSArray *) urls successCallback :(RCTResponseSenderBlock)successCallback errorCallback:(RCTResponseErrorBlock)errorCallback) { [[AppsFlyerLib shared] setResolveDeepLinkURLs:urls]; - successCallback(@[SUCCESS]); + successCallback(@[AF_SUCCESS]); } RCT_EXPORT_METHOD(performOnAppAttribution:(NSString *) urlString @@ -543,7 +543,7 @@ - (BOOL)isExpoApp { errorCallback(error); } else { [[AppsFlyerLib shared] performOnAppAttributionWithURL:url]; - successCallback(@[SUCCESS]); + successCallback(@[AF_SUCCESS]); } } @@ -606,13 +606,13 @@ - (BOOL)isExpoApp { RCT_EXPORT_METHOD(setHost: (NSString*)hostPrefix hostName: (NSString*)hostName successCallback :(RCTResponseSenderBlock)successCallback) { [[AppsFlyerLib shared] setHost:hostName withHostPrefix:hostPrefix]; - successCallback(@[SUCCESS]); + successCallback(@[AF_SUCCESS]); } RCT_EXPORT_METHOD(addPushNotificationDeepLinkPath: (NSArray*)path successCallback :(RCTResponseSenderBlock)successCallback errorCallback:(RCTResponseErrorBlock)errorCallback) { [[AppsFlyerLib shared] addPushNotificationDeepLinkPath: path]; - successCallback(@[SUCCESS]); + successCallback(@[AF_SUCCESS]); } RCT_EXPORT_METHOD(disableSKAD: (BOOL *)b ) {