File tree Expand file tree Collapse file tree 5 files changed +34
-14
lines changed Expand file tree Collapse file tree 5 files changed +34
-14
lines changed Original file line number Diff line number Diff line change 11# Versions
22
3+ ## 6.2.1+5
4+ - Added support for useReceiptValidationSandbox API
5+
36## 6.2.1+4
47- Seperated purchase validation API to iOS/Android
58
Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ _Example:_
305305appsFlyerSdk.updateServerUninstallToken("token");
306306```
307307---
308- ** <a id =" validateAndLogInAppAndroidPurchase " > `Stream validateAndLogInAppAndroidPurchase(
308+ ** <a id =" validateAndLogInAppAndroidPurchase " > `Future< dynamic > validateAndLogInAppAndroidPurchase(
309309 String publicKey,
310310 String signature,
311311 String purchaseData,
@@ -321,14 +321,10 @@ appsFlyerSdk.validateAndLogInAppAndroidPurchase(
321321 "purchaseData",
322322 "price",
323323 "currency",
324- {"fs": "fs"}).listen((data) {
325- print(data);
326- }).onError((error) {
327- print(error);
328- });
324+ {"fs": "fs"});
329325```
330326---
331- ** <a id =" validateAndLogInAppIosPurchase " > `Stream validateAndLogInAppIosPurchase(
327+ ** <a id =" validateAndLogInAppIosPurchase " > `Future< dynamic > validateAndLogInAppIosPurchase(
332328 String productIdentifier,
333329 String price,
334330 String currency,
@@ -342,11 +338,17 @@ appsFlyerSdk.validateAndLogInAppIosPurchase(
342338 "price",
343339 "currency",
344340 "transactionId",
345- "additionalParameters").listen((data) {
346- print(data);
347- }).onError((error) {
348- print(error);
349- });
341+ "additionalParameters");
342+ ```
343+
344+
345+ *** To use the purchase validation feature in sandbox mode call the follow API:***
346+
347+ ` void useReceiptValidationSandbox(bool isSandboxEnabled) `
348+
349+ _ Example:_
350+ ``` dart
351+ appsFlyerSdk.useReceiptValidationSandbox(true);
350352```
351353---
352354** <a id =" setPushNotification " > ` void setPushNotification(bool isEnabled) ` **
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ @implementation AppsflyerSdkPlugin {
1111static BOOL _oaoaCallback = false ;
1212static BOOL _udpCallback = false ;
1313static BOOL _isPushNotificationEnabled = false ;
14+ static BOOL _isSandboxEnabled = false ;
1415
1516+ (FlutterMethodChannel*)callbackChannel {
1617 return _callbackChannel;
@@ -111,12 +112,21 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
111112 [self setOneLinkCustomDomain: call result: result];
112113 }else if ([@" setPushNotification" isEqualToString: call.method]){
113114 [self setPushNotification: call result: result];
115+ }else if ([@" useReceiptValidationSandbox" isEqualToString: call.method]){
116+ [self useReceiptValidationSandbox: call result: result];
114117 }
115118 else {
116119 result (FlutterMethodNotImplemented);
117120 }
118121}
119122
123+ - (void )useReceiptValidationSandbox : (FlutterMethodCall*)call result : (FlutterResult)result {
124+ bool isSandboxEnabled = call.arguments ;
125+ _isSandboxEnabled = isSandboxEnabled;
126+ [AppsFlyerLib shared ].useReceiptValidationSandbox = _isSandboxEnabled;
127+ result (nil );
128+ }
129+
120130- (void )setPushNotification : (FlutterMethodCall*)call result : (FlutterResult)result {
121131 bool isPushNotificationEnabled = call.arguments ;
122132 _isPushNotificationEnabled = isPushNotificationEnabled;
Original file line number Diff line number Diff line change @@ -380,7 +380,7 @@ class AppsflyerSdk {
380380 });
381381 }
382382
383- ///Returns `Stream` . Accessing AppsFlyer purchase validation data
383+ ///Accessing AppsFlyer purchase validation data
384384 Future <dynamic > validateAndLogInAppIosPurchase (
385385 String productIdentifier,
386386 String price,
@@ -398,6 +398,11 @@ class AppsflyerSdk {
398398 });
399399 }
400400
401+ /// set sandbox for iOS purchase validation
402+ void useReceiptValidationSandbox (bool isSandboxEnabled) {
403+ _methodChannel.invokeMethod ("useReceiptValidationSandbox" , isSandboxEnabled);
404+ }
405+
401406 /// Set additional data to be sent to AppsFlyer.
402407 void setAdditionalData (Map <String , dynamic > customData) {
403408 _methodChannel
Original file line number Diff line number Diff line change 11name : appsflyer_sdk
22description : A Flutter plugin for AppsFlyer SDK. Supports iOS and Android.
3- version : 6.2.1+4
3+ version : 6.2.1+5
44
55homepage : https://github.com/AppsFlyerSDK/flutter_appsflyer_sdk
66
You can’t perform that action at this time.
0 commit comments