Discussions
Error: #2009 (encodingFailed): Failed to find encoder for property "vendorId" for react native expo
I want to test purchases from my react native expo application but I am getting this error.
My code:
```
export const getAdaptyWeeklyPaywall = async () => {
try {
const id = "my_id";
const paywall = await adapty.getPaywall(id);
console.log(paywall.products[0]);
const product=paywall.products[0]
try {
const profile = await adapty.makePurchase(paywall.products[0]);
} catch (error) {
console.log("hata: "+error)
// handle the error
}
// the requested paywall
} catch (error) {
// handle the error
console.log("hata: " + error);
}
};
```
Posted by Görkem 3 months ago
How to get discount price for the product
Hi team, after the recent Flutter Adapty SDK release (`adapty_flutter: ^2.6.2`) it's no longer possible to get a discount price for the product.
Before (version: `adapty_flutter: ^2.4.4`) I just used
```
if (adaptyPaywallProduct.isDiscountAvailable) {
return adaptyPaywallProduct.discounts.first.localizedPrice ?? '';
}
```
Posted by Andriy 3 months ago
Flutter: Promotional Offers for subscription
Howdy,
We setup our product and added the promotional offer for an subscription into appstoreconnect & we added an offer into the adapty product.
But whenever i try to call the `presentCodeRedemptionSheet() (and enter the correct code)`or `https://apps.apple.com/redeem?ctx=offercodes&id={apple_app_id}&code={code}` with the correct data, apple says that the code is not valid.
i can not find a proper documentation how to set it up correctly from appstoreconnect into adapty / the app.
Posted by Chris 4 months ago
An issue with adapty activation?
Hello,
I am working on the store page for my app and am receiving a 404 error - stating 'PurchaseContainer not found' along with a url.
<https://api.adapty.io/api/v1/sdk/in-apps/purchase-containers/paywall_one/?profile_id=40962bd6-e3de-457f-8112-a6ae0b9c8184&locale=en>
Full error below:
\[Error: #2003 (badRequest): Request is unsuccessful. <https://api.adapty.io/api/v1/sdk/in-apps/purchase-containers/paywall_one/?profile_id=40962bd6-e3de-457f-8112-a6ae0b9c8184&locale=en> Code: 404, Response: {"errors":[{"detail":"PurchaseContainer Not Found","status":"404","source":{"pointer":"/data"},"code":"not_found"}]}]
And here is the error of the URL if you don't want to go to it.
{
errors: [
{
detail: "Authentication credentials were not provided.",
status: "401",
source: {
pointer: "/data"
},
code: "not_authenticated"
}
]
}
And the implementation is correct according to the docs
// App.js //
useEffect(() => { adapty.activate('MY_ADAPTY_API_KEY') }, \[])
Any ideas - looking at similar discussions but not finding anything of use.
Thanks!
\-M
Posted by Max Nelson 4 months ago
Adapty + Facebook Ads integration
Hi!
Our team has some questions about integrating Adapty with Facebook Ads.
The situation: iOs app made with Unity released into kids category. Because of kids category restrictions that we can't use Unity version of Facebook SDK.
We want to launch an ad campaign and we need to do an Facebook's events call to increase the effectiveness. But Adapty's documentation says that integration will not work without an "Facebook anonymousID" because of IDFA changes (<https://docs.adapty.io/docs/facebook-ads>). Anyway anonymousID is not available in the Unity-version of Facebook SDK.
So the question is: if we enable Adapty's Facebook integration will it still works without anonymousID?
Posted by Konstantin 4 months ago
Unique Views in AB testing? Where to find them?
I've had a very strange experience with how Adapty is distributing users and counting views.
For context, in the AABB test, I've got a split of views like this right now:
A: 43
AA: 175
B: 72
BB: 70
The situation is further complicated by the fact that we have a paywall-slider (a paywall containing several slides). I thought that maybe every different slide was being counted as a different view. So, I went into your documentation to find out what exactly you are counting as a view. It wasn't there. However, there was a mention about unique views. That would help me solve this problem, but I am not able to find where to opt into that in my AB testing.
P.S. I am writing about the old/deprecated version of paywalls and AB tests. We have yet to migrate to your new paywall 2.0 system.
Posted by David 4 months ago
Transfer App
how to transfer app to another adapty account ??
Posted by cakra 4 months ago
Not clear how to verify purchase using Adapty
Hi Adapty team,
I am trying to implement a subscription mechanism in my Flutter app (target platform: iOS).
I've done all the setup on the App Store Connect side (all the required subscriptions are in place)
and now I am trying to implement the client-side logic.
I am also using the StoreKit test environment (sandbox) for testing. Also, I completed the setup for iOS app in the Adapty console with all the required data.
When I am trying to purchase a subscription, I get the following error:
```dart
try {
final product = _adaptyProducts.first;
final result = await Adapty().makePurchase(product: product);
debugPrint('result: $result');
// successful purchase
} on AdaptyError catch (adaptyError) {
debugPrint('error: $adaptyError');
} catch (e) {
debugPrint('error: $e');
}
```
This code throws AdaptyError with the following message:
```
HTTPError.backend(POST /sdk/in-apps/apple/receipt/validate/, [2.4.5]: Adapty/Backend.Validator.swift#21,
statusCode: 400, body: {"errors":[{"detail":"21002: The data in the receipt-data property was malformed.","status":"400","source":{"pointer":"/data"},"code":"APPLE_RECEIPT_VALIDATION_ERROR"}]})
```
Can you please help me to understand what is wrong with my setup?
And I figured out that I need to do some receipt verification (unfortunately, I can't find any documentation about the process of purchase with verification). Still, I don't know how to do it.
Posted by Andriy 4 months ago
Flutter adapty.makePurchase(...) takes more ~20 seconds on iOS
After invoking `await adapty.makePurchase(product: event.product);` it takes between 5 seconds and 30 seconds until the purchase dialog of the App Store is purchased which leads to display long loading times to the users.
Is this some implementation issue from the client side (flutter app), the communication between Adapty and Apple or something else?
I troubleshooted the network from the client side, and doesnt seems to be an issue with the local network. Also i tested on different devices.
Posted by Anderson Oki 4 months ago
Protocol 'AdaptySystemEventParameters' as a type cannot conform to 'Encodable' Flutter error
I have this issue while doing iOS build. Android is good. What I need to do?
The error is in this lines
//
// EventType.swift
// Adapty
//
// Created by Aleksei Valiano on 07.10.2022.
//
import Foundation
enum EventType {
case appOpened
case paywallShowed(AdaptyPaywallShowedParameters)
case onboardingScreenShowed(AdaptyOnboardingScreenParameters)
case system(AdaptySystemEventParameters)
}
extension EventType {
enum Name {
static let appOpened = "app_opened"
static let paywallShowed = "paywall_showed"
static let onboardingScreenShowed = "onboarding_screen_showed"
static let system = "system_log"
}
```
static let systemEvents = [Name.system]
var name: String {
switch self {
case .appOpened:
return Name.appOpened
case .paywallShowed:
return Name.paywallShowed
case .onboardingScreenShowed:
return Name.onboardingScreenShowed
case .system:
return Name.system
}
}
```
}
extension EventType: Encodable {
func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: Event.CodingKeys.self)
switch self {
case .appOpened:
try container.encode(Name.appOpened, forKey: .type)
case let .paywallShowed(value):
try container.encode(Name.paywallShowed, forKey: .type)
try value.encode(to: encoder)
case let .onboardingScreenShowed(value):
try container.encode(Name.onboardingScreenShowed, forKey: .type)
try value.encode(to: encoder)
case let .system(value):
try container.encode(Name.system, forKey: .type)
let data = try Backend.encoder.encode(value)
let string = String(decoding: data, as: UTF8.self)
try container.encode(string, forKey: .customData)
}
}
}
Posted by Oleh Savenko 5 months ago