You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Docs/RN_PurchaseConnector.md
+84-85Lines changed: 84 additions & 85 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ For more information please check the following pages:
21
21
The Purchase Connector feature of the AppsFlyer SDK depends on specific libraries provided by Google and Apple for managing in-app purchases:
22
22
23
23
- For Android, it depends on the [Google Play Billing Library](https://developer.android.com/google/play/billing/integrate) (Supported versions: 5.x.x - 7.x.x).
24
-
- For iOS, it depends on [StoreKit](https://developer.apple.com/documentation/storekit) (Supported versions: StoreKit1 and StoreKit2 (beta)).
24
+
- For iOS, it depends on [StoreKit](https://developer.apple.com/documentation/storekit) (Supported versions: StoreKit1 and StoreKit2).
25
25
26
26
However, these dependencies aren't actively included with the SDK. This means that the responsibility of managing these dependencies and including the necessary libraries in your project falls on you as the consumer of the SDK.
27
27
@@ -53,6 +53,19 @@ The files for the Purchase Validation feature are always included in the plugin.
53
53
54
54
In such cases, you'll likely experience errors or exceptions when trying to use functionalities provided by the Purchase Validation feature. To avoid these issues, ensure that you opt-in to the feature if you intend to use any related APIs.
55
55
56
+
57
+
## <aid="proguard-rules-for-android"></a>ProGuard Rules for Android
58
+
59
+
If you are using ProGuard to obfuscate your APK for Android, you need to ensure that it doesn't interfere with the functionality of AppsFlyer SDK and its Purchase Connector feature.
60
+
61
+
Add following keep rules to your `proguard-rules.pro` file:
62
+
63
+
```groovy
64
+
-keep class com.appsflyer.** { *; }
65
+
-keep class kotlin.jvm.internal.Intrinsics{ *; }
66
+
-keep class kotlin.collections.**{ *; }
67
+
```
68
+
56
69
## <aid="basic-integration-of-the-connector"></a>Basic Integration Of The Connector
The `PurchaseConnector` requires a configuration object of type `PurchaseConnectorConfig` at instantiation time. This configuration object governs how the `PurchaseConnector` behaves in your application.
-`transactionId` (string): The unique transaction identifier from the App Store transaction
289
+
290
+
**Note:** This method is iOS-specific and should only be called on iOS devices. On Android, consumable transactions are automatically handled by the Purchase Connector.
You can register listeners to get the validation results once getting a response from AppsFlyer servers to let you know if the purchase was validated successfully.</br>
## <aid="testing-the-integration"></a>Testing the Integration
309
-
310
-
With the AppsFlyer SDK, you can select which environment will be used for validation - either **production** or **sandbox**. By default, the environment is set to production. However, while testing your app, you should use the sandbox environment.
311
-
312
-
### <aid="android"></a>Android
313
-
314
-
For Android, testing your integration with the [Google Play Billing Library](https://developer.android.com/google/play/billing/test) should use the sandbox environment.
315
-
316
-
To set the environment to sandbox in React Native, just set the `sandbox` parameter in the `PurchaseConnectorConfig` to `true` when instantiating `PurchaseConnector`.
317
-
318
-
Remember to switch the environment back to production (set `sandbox` to `false`) before uploading your app to the Google Play Store.
319
-
320
-
### <aid="ios"></a>iOS
321
-
322
-
To test purchases in an iOS environment on a real device with a TestFlight sandbox account, you also need to set `sandbox` to `true`.
323
-
324
-
> *IMPORTANT NOTE: Before releasing your app to production please be sure to set `sandbox` to `false`. If a production purchase event is sent in sandbox mode, your event will not be validated properly! *
325
-
326
-
## <aid="proguard-rules-for-android"></a>ProGuard Rules for Android
327
-
328
-
If you are using ProGuard to obfuscate your APK for Android, you need to ensure that it doesn't interfere with the functionality of AppsFlyer SDK and its Purchase Connector feature.
329
-
330
-
Add following keep rules to your `proguard-rules.pro` file:
-`transactionId` (string): The unique transaction identifier from the App Store transaction
587
-
588
-
**Note:** This method is iOS-specific and should only be called on iOS devices. On Android, consumable transactions are automatically handled by the Purchase Connector.
589
-
590
-
591
572
### <aid="important-notes"></a>Important Notes
592
573
593
574
1.**iOS StoreKit2**: The StoreKit2 data source is only available on iOS 15.0 and later. Make sure to check the iOS version before using it.
## <aid="testing-the-integration"></a>Testing the Integration
608
+
609
+
With the AppsFlyer SDK, you can select which environment will be used for validation - either **production** or **sandbox**. By default, the environment is set to production. However, while testing your app, you should use the sandbox environment.
610
+
611
+
### <aid="android"></a>Android
612
+
613
+
For Android, testing your integration with the [Google Play Billing Library](https://developer.android.com/google/play/billing/test) should use the sandbox environment.
614
+
615
+
To set the environment to sandbox in React Native, just set the `sandbox` parameter in the `PurchaseConnectorConfig` to `true` when instantiating `PurchaseConnector`.
616
+
617
+
Remember to switch the environment back to production (set `sandbox` to `false`) before uploading your app to the Google Play Store.
618
+
619
+
### <aid="ios"></a>iOS
620
+
621
+
To test purchases in an iOS environment on a real device with a TestFlight sandbox account, you also need to set `sandbox` to `true`.
622
+
623
+
> *IMPORTANT NOTE: Before releasing your app to production please be sure to set `sandbox` to `false`. If a production purchase event is sent in sandbox mode, your event will not be validated properly! *
0 commit comments