Discussions
"is_sandox" request parameter for subscription revoking
Hi!
Recently I've found out that it is possible to [grant/prolong](https://docs.adapty.io/docs/server-side-api-specs#prolonggrant-a-subscription-for-a-user) subscription with `is_sandbox` parameter in the request body. It works brilliantly for me (except that API responds "Not a valid string" on the boolean "is_sandbox" parameter, but if I pass it as a string "true" all works fine :))
I see an expected event from `Sendbox` environment on every granting with `is_sandbox` flag. But when I want to revoke a granted subscription I can't find how to specify the environment of the transaction.
When revoking a subscription I always see `Production` environment in event feed.
Could you please make it possible to specify the environment for revoking the subscription?
Respectfully,
Vitaliy
Posted by Vitaliy Rusinov 4 months ago
Change email
DM me to change email
Posted by Derek 4 months ago
App in Release mode crashes on Android because of Proguard
Hi,
I've been trying to run my app in Release mode, locally on my computer but I'm getting a crash on app launch.
This is the error from the crash log:
```
Caused by: java.lang.IllegalStateException: TypeToken must be created with a type argument: new TypeToken\<...>() {}; When using code shrinkers (ProGuard, R8, ...) make sure that generic signatures are preserved."
```
I have followed the instruction about setting up Proguard here: <https://docs.adapty.io/docs/android-installation#configure-proguard>.
The workaround I'm using for now is changing these following parameters from `true` to `false` to make it work, but I would like to avoid that:
```groovy
isMinifyEnabled = false
isShrinkResources = false
```
Any ideas?
Thank you!
Posted by Vivien Mahé 4 months ago
I'm getting 401 "Error: Request failed with status code 401", when i hit this api for creating user.
```
const apiEndpoint = `https://api.adapty.io/api/v1/sdk/profiles/`;
const apiKey = 'secret_live_BEHrYLTr.************\*\*\*************';
const headers = {
Authorization: `Api-Key ${apiKey}`,
'Content-Type': 'application/json',
};
let data = {
customer_user_id: "45456456465",
};
axios
.post(apiEndpoint, data, { headers })
.then((response) => {
console.log("Response:", response.data);
})
.catch((error) => {
console.log("error", error);
console.error("Error:", error.message);
});
```
Posted by shubham 4 months ago
Any plans for .Net Maui SDK?
As title. Thanks.
Posted by Nick 4 months ago
React Native Error #2003
Montly subscription on first press opens without errors. After xcode environment subscribe catch error
Error: #2003 (badRequest): Server error
at construct (native)
at apply (native)
at \_construct (http\://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.[ProjectName]\:4013:28).
On restart app on click to subscribe same error [Error: #2003 (badRequest): Server error]
App Shared Secret Key is identic
![](https://files.readme.io/9e33e7b-image.png)
Posted by Ivan Sfase 5 months ago
server-side API. Grant subscription and create user profile.
We are setting up our payment system on our website and I have a question about the API.
Do I need to create a user profile in Adapty before granting the subscription?
Does the user need to exist before calling this endpoint?: <https://docs.adapty.io/docs/server-side-api-specs#prolonggrant-a-subscription-for-a-user>
Do I need to check if the user already exists in Adapty, then call this endpoint <https://docs.adapty.io/docs/server-side-api-specs#create-a-user>, then update the subscription?
Posted by Kevin Amiranoff 5 months ago
Adapty.getViewConfiguration(paywall, locale) become very slow
it takes about 1 min to load ... fk
Posted by ccc 5 months ago
Do Adapty Paywall Templates work with iPads?
I am wondering if we can use the paywall builder to make a paywall for an iPad in conjunction with iPhones?
Posted by Shunt Balushian 5 months ago
I don't see any paywall
In void main() async {
WidgetsFlutterBinding.ensureInitialized();
I entered.
// Attiva le SDK di Adapty
Adapty().activate();
// Controlla lo stato dell'abbonamento
final profile = await Adapty().getProfile();
if (profile.accessLevels['full_app']?.isActive ?? false) {
isSubscriptionActive = true;
} else {
isSubscriptionActive = false;
}
// Ascolta le modifiche allo stato dell'abbonamento
Adapty().didUpdateProfileStream.listen((profile) {
if (profile.accessLevels['full_app']?.isActive ?? false) {
isSubscriptionActive = true;
} else {
isSubscriptionActive = false;
}
});
runApp(const MyApp());
}
And I create
Positioned(
right: 16,
top: MediaQuery.of(context).size.height / 2 - 94,
child: Visibility(
visible: !isSubscriptionActive,
child: FloatingActionButton(
onPressed: () async {
try {
final paywall = await Adapty().getPaywall(id: "FFF", locale: "en");
{
final products = await Adapty().getPaywallProducts(paywall: paywall);
await Adapty().logShowPaywall(paywall: paywall);
```
if (products.isNotEmpty) {
final product = products.first;
final profile = await Adapty().makePurchase(product: product);
if (profile != null) {
// Acquisto riuscito, puoi aggiornare l'interfaccia utente o eseguire altre azioni qui
}
} else {
// Non ci sono prodotti nel paywall
logger.w("Nessun prodotto nel paywall");
}
}
} on AdaptyError catch (adaptyError) {
// Gestisci gli errori specifici di Adapty durante l'acquisto
logger.w("Errore Adapty: ${adaptyError.message}");
} catch (e) {
// Gestisci eventuali altri errori generici durante l'acquisto
logger.w("Errore generico: $e");
}
},
mini: true,
backgroundColor: Colors.orange,
child: const Icon(Icons.shopping_cart),
),
```
),
),
I can't see my paywall. Why?
Posted by Daniele Tona 5 months ago