Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix : Redefinition SUCCESS Error #596

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ios/RNAppsFlyer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
38 changes: 19 additions & 19 deletions ios/RNAppsFlyer.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ @implementation RNAppsFlyer
NSError* error = nil;
error = [self callSdkInternal:initSdkOptions];
if (error == nil){
successCallback(@[SUCCESS]);
successCallback(@[AF_SUCCESS]);
}else{
errorCallback(error);
}
Expand All @@ -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); }
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -141,7 +141,7 @@ -(NSError *) callSdkInternal:(NSDictionary*)initSdkOptions {
errorCallback(@[error.localizedDescription]);
return;
}
successCallback(@[SUCCESS]);
successCallback(@[AF_SUCCESS]);
}];
}

Expand All @@ -159,7 +159,7 @@ -(NSError *) callSdkInternal:(NSDictionary*)initSdkOptions {
reject([NSString stringWithFormat: @"%ld", (long)error.code], error.domain, error);
return;
}
resolve(@[SUCCESS]);
resolve(@[AF_SUCCESS]);
}];
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -288,7 +288,7 @@ -(NSError *) callSdkInternal:(NSDictionary*)initSdkOptions {
}
else{
[[AppsFlyerLib shared] setUserEmails:emails withCryptType:emailsCryptType];
successCallback(@[SUCCESS]);
successCallback(@[AF_SUCCESS]);
}
}

Expand All @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -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
Expand All @@ -543,7 +543,7 @@ - (BOOL)isExpoApp {
errorCallback(error);
} else {
[[AppsFlyerLib shared] performOnAppAttributionWithURL:url];
successCallback(@[SUCCESS]);
successCallback(@[AF_SUCCESS]);
}
}

Expand Down Expand Up @@ -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 ) {
Expand Down