Skip to content

Commit

Permalink
onInstallConversionData set to default true
Browse files Browse the repository at this point in the history
onInstallConversionData set to default true
  • Loading branch information
amit-kremer93 committed Oct 11, 2020
2 parents 9c9b129 + 6320019 commit 7aedfed
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ The dev key is required for all apps and the appID is required only for iOS.<br/
| devKey | Your application [devKey](https://support.appsflyer.com/hc/en-us/articles/211719806-Global-app-settings-#sdk-dev-key) provided by AppsFlyer (required) |
| appId | Your iTunes [application ID](https://support.appsflyer.com/hc/en-us/articles/207377436-Adding-a-new-app#available-in-the-app-store-google-play-store-windows-phone-store) (iOS only) |
| isDebug | Debug mode - set to `true` for testing only |
|onInstallConversionDataListener| Set listener for SDK init response (Optional. default=true) |

*Example:*

Expand All @@ -62,6 +63,7 @@ appsFlyer.initSdk(
devKey: 'K2***********99',
isDebug: false,
appId: '41*****44',
onInstallConversionDataListener: false, //Optional
},
(res) => {
console.log(res);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ appsFlyer.initSdk(
| devKey | Your application [devKey](https://support.appsflyer.com/hc/en-us/articles/211719806-Global-app-settings-#sdk-dev-key) provided by AppsFlyer (required) |
| appId | Your iTunes [application ID](https://support.appsflyer.com/hc/en-us/articles/207377436-Adding-a-new-app#available-in-the-app-store-google-play-store-windows-phone-store) (iOS only) |
| isDebug | Debug mode - set to `true` for testing only |
|onInstallConversionDataListener| Set listener for SDK init response (Optional. default=false) |
|onInstallConversionDataListener| Set listener for SDK init response (Optional. default=true) |


## <a id="guides"> 📖 Guides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private String callSdkInternal(ReadableMap _options) {
isDebug = options.optBoolean(afIsDebug, false);
instance.setDebugLog(isDebug);

isConversionData = options.optBoolean(afConversionData, false);
isConversionData = options.optBoolean(afConversionData, true);
if (isDebug == true) {
Log.d("AppsFlyer", "Starting SDK");
}
Expand Down
8 changes: 4 additions & 4 deletions ios/RNAppsFlyer.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ -(NSError *) callSdkInternal:(NSDictionary*)initSdkOptions {
NSString* devKey = nil;
NSString* appId = nil;
BOOL isDebug = NO;
BOOL isConversionData = NO;
BOOL isConversionData = YES;
NSNumber* interval = 0;

if (![initSdkOptions isKindOfClass:[NSNull class]]) {
Expand All @@ -64,6 +64,7 @@ -(NSError *) callSdkInternal:(NSDictionary*)initSdkOptions {
isDebug = [(NSNumber*)isDebugValue boolValue];
}
isConversionDataValue = [initSdkOptions objectForKey: afConversionData];

if ([isConversionDataValue isKindOfClass:[NSNumber class]]) {
isConversionData = [(NSNumber*)isConversionDataValue boolValue];
}
Expand Down Expand Up @@ -96,7 +97,7 @@ -(NSError *) callSdkInternal:(NSDictionary*)initSdkOptions {
[AppsFlyerLib shared].appsFlyerDevKey = devKey;
[AppsFlyerLib shared].isDebug = isDebug;
[[AppsFlyerLib shared] start];


// Register for background-foreground transitions natively instead of doing this in JavaScript
[[NSNotificationCenter defaultCenter] addObserver:self
Expand Down Expand Up @@ -464,7 +465,7 @@ -(void) reportOnSuccess:(NSString *)data type:(NSString*) type {
NSString* currency = nil;
NSDictionary* additionalParameters = nil;
NSError* error = nil;


if(![purchaseInfo isKindOfClass: [NSNull class]]){
productIdentifier = (NSString*)[purchaseInfo objectForKey: afProductIdentifier];
Expand All @@ -473,7 +474,6 @@ -(void) reportOnSuccess:(NSString *)data type:(NSString*) type {
currency = (NSString*)[purchaseInfo objectForKey: afCurrency];
additionalParameters = (NSDictionary*)[purchaseInfo objectForKey: afAdditionalParameters];


[[AppsFlyerLib shared] validateAndLogInAppPurchase:productIdentifier price:price currency:currency transactionId:tranactionId additionalParameters:additionalParameters success:^(NSDictionary * _Nonnull response) {
successCallback(@[@"In App Purchase Validation completed successfully!"]);
} failure:^(NSError * _Nullable error, id _Nullable reponse) {
Expand Down

0 comments on commit 7aedfed

Please sign in to comment.