Home / IOS Development / ios – in_app_purchase how do i get the data needed for android verification from serverVerificationData

ios – in_app_purchase how do i get the data needed for android verification from serverVerificationData



I’m trying to implement server side verification for IAPs in my flutter app. I̵

7;m using the package

https://pub.dev/packages/in_app_purchase

version: ^ 0.3.4 + 8

And I’m confused about how to get the data to confirm my purchase for Android and iOS. In the documentation they say

“or verify the data using your own server with serverVerificationData.”

This string seems to return some sort of coded string. How do I extract the required data from this string? I tried base64Decode () since localVerificationData is base64Encoded, but this did not work.

Android needs a package name, purchase ID and purchaseToken. And Ios needs reception data. I’m confused about how to get this data from the serverVerificationData string.

I am currently implementing Android first.

The local Verification Data documentation states

The data used for local verification.

If the source is IAPSource.AppStore, this data is a based64-encoded string. The structure of the payload is defined using ASN.1. If the source is IAPSource.GooglePlay, this data is a JSON string.

But the string I got did not look like JSON at all. I’m also not sure if it’s safe to post here, as it may contain sensitive information.


Source link