Skip to content

Commit 55a10a8

Browse files
committed
feat: add skad 4.0 conversion value update method wrappers
1 parent 8153c92 commit 55a10a8

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ declare module 'react-native-adjust' {
224224
convertUniversalLink: (url: string, scheme: string, callback: (convertedUrl: string) => void) => void
225225
requestTrackingAuthorizationWithCompletionHandler: (handler: (status: number) => void) => void
226226
updateConversionValue: (conversionValue: number) => void
227+
updateConversionValueWithErrorCallback: (conversionValue: number, callback: (error: string) => void) => void
228+
updateConversionValueWithSkad4ErrorCallback: (conversionValue: number, coarseValue: string, lockWindow: boolean, callback: (error: string) => void) => void
227229
getAppTrackingAuthorizationStatus: (callback: (authorizationStatus: number) => void) => void
228230
trackThirdPartySharing: (adjustThirdPartySharing: AdjustThirdPartySharing) => void
229231
trackMeasurementConsent: (measurementConsent: boolean) => void

index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@ Adjust.updateConversionValue = function(conversionValue) {
156156
module_adjust.updateConversionValue(conversionValue);
157157
};
158158

159+
Adjust.updateConversionValueWithErrorCallback = function(conversionValue, callback) {
160+
module_adjust.updateConversionValueWithErrorCallback(conversionValue, callback);
161+
};
162+
163+
Adjust.updateConversionValueWithSkad4ErrorCallback = function(conversionValue, coarseValue, lockWindow, callback) {
164+
module_adjust.updateConversionValueWithSkad4ErrorCallback(conversionValue, coarseValue, lockWindow, callback);
165+
};
166+
159167
Adjust.getAppTrackingAuthorizationStatus = function(callback) {
160168
module_adjust.getAppTrackingAuthorizationStatus(callback);
161169
};

ios/AdjustSdk.m

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,26 @@ @implementation AdjustSdk
476476
[Adjust updateConversionValue:[conversionValue intValue]];
477477
}
478478

479+
RCT_EXPORT_METHOD(updateConversionValueWithErrorCallback:(NSNumber * _Nonnull)conversionValue
480+
errorCallback:(RCTResponseSenderBlock)callback) {
481+
[Adjust updatePostbackConversionValue:[conversionValue intValue]
482+
completionHandler:^(NSError * _Nullable error) {
483+
callback(@[[error localizedDescription]]);
484+
}];
485+
}
486+
487+
RCT_EXPORT_METHOD(updateConversionValueWithSkad4ErrorCallback:(NSNumber * _Nonnull)conversionValue
488+
coarseValue:(NSString * _Nonnull)coarseValue
489+
lockWindow:(NSNumber * _Nonnull)lockWindow
490+
errorCallback:(RCTResponseSenderBlock)callback) {
491+
[Adjust updatePostbackConversionValue:[conversionValue intValue]
492+
coarseValue:coarseValue
493+
lockWindow:[lockWindow boolValue]
494+
completionHandler:^(NSError * _Nullable error) {
495+
callback(@[[error localizedDescription]]);
496+
}];
497+
}
498+
479499
RCT_EXPORT_METHOD(getAppTrackingAuthorizationStatus:(RCTResponseSenderBlock)callback) {
480500
callback(@[@([Adjust appTrackingAuthorizationStatus])]);
481501
}

0 commit comments

Comments
 (0)