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: README.md
+45Lines changed: 45 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -478,6 +478,51 @@ The following parameters are also included with the signal:
478
478
|`TelemetryDeck.Purchase.offerID`| The specific offer identifier for subscription products or customized pricing |
479
479
480
480
481
+
### Google Play
482
+
483
+
When integrating with Google Play Billing Library, you can adopt the TelemetryDeck SDK with Google Play Services in order to let us determine the exact purchase parameters.
484
+
485
+
1. Add the following package as a dependency to your app:
2. You can now use the `purchaseCompleted` function optimized for Google Play Billing:
495
+
496
+
```kotlin
497
+
funpurchaseHandlerInYourApp(
498
+
billingConfig:BillingConfig,
499
+
purchase:Purchase,
500
+
productDetails:ProductDetails
501
+
) {
502
+
TelemetryDeck.purchaseCompleted(
503
+
billingConfig = billingConfig,
504
+
purchase = purchase,
505
+
productDetails = productDetails
506
+
)
507
+
}
508
+
```
509
+
510
+
By default, this method assumes the purchase is a `PAID_PURCHASE`. To determine if the user is converting or starting a trial, you will have to implement your own [server-side validation](https://developer.android.com/google/play/billing/integrate) and inspect the `paymentState` of a subscription.
511
+
512
+
To make it easier to get started, the TelemetryDeck SDK offers a helper method which attempts to guess the purchase origin based on locally available data, so you could:
Note that this approach is not exact and comes with a certain number of limitations, please check the doc notes on `com.telemetrydeck.sdk.googleservices.toTelemetryDeckPurchaseEvent` for more details.
524
+
525
+
481
526
## Custom Telemetry
482
527
483
528
Another way to send signals is to implement a custom `TelemetryDeckProvider`.
0 commit comments