Closed arodriguezgb closed 3 years ago
Hello! It doesn't seem like we have quite enough information to send this to a human yet to help out. We would love if you could provide more details about your issue by following the template without modifying any of the pre-filled text. If you're looking for support, head over to our Help Center to get in touch with our team directly.
I'm also experiencing a problem with the billing confirmation under Android.
As test user who performs a purchase I receive an email confirming that I purchased the subscription.
Short after I get another email telling me that the subscription was not confirmed.
As I understood from the documentation revenuecat should confirm it automatically.
The observer mode is off.
Error code 2: "There was a problem with the Play Store"
hi!! 👋 thanks for reporting, I'm going to try to reproduce and report back.
@aboedo Purchases.addPurchaserInfoUpdateListener is not working for me
im using the latest sdk 3.4.5
im testing to get my grip on the package but im getting a little issues
basically I have one stful widget and in that widget I have an App bar and 1 button in centre
in my INIT state I have used the following code
**@override void initState() {
Purchases.addPurchaserInfoUpdateListener((purchaserInfo) {
activeSubscriptions = purchaserInfo.entitlements.active.values.toList();
print(activeSubscriptions.length);
print(purchaserInfo.activeSubscriptions.length);
setState(() {
color = activeSubscriptions.isEmpty || activeSubscriptions == null
? Colors.red
: Colors.green;
});
});
super.initState();
}**
im trying to make appBar color change depending on subscription state
when I make a purchase and I get the successful prompt the app bar goes green so this works exactly how I want but when the expiration time ends it does not go back to red UNTIL the state is set again
hi everyone!! There seem to be a few different things going on in this ticket, so I'll address them one at a time:
@arodriguezgb This message happens when you haven't added the email you're using in Google Play to the licensed testers list. Here's our guide on getting that set up, let me know if that doesn't do the trick!
@stwarwas that's correct, our SDK automatically acknowledges purchases. It sounds like there might be an issue with your Google Play Store configuration in the RevenueCat dashboard. Does the purchase show up there? (Remember to check "View Sandbox data" on the top right). If it' doesn't get registered at all, here's our guide to setting up credentials. If that doesn't help, would you mind opening up a separate ticket so we can track it there and figure out what's going on?
@officialFlutterDeveloper and I continued the conversation on a separate ticket for their concerns, if there are any more related questions let's continue on that ticket.
@aboedo The account is on the licensed testers.
I thought it could be the account at first but I tried different accounts on different phones and the same issue, the confirmation never happens.
The process was working fine and it stopped working, same code, nothing changed.
It doesn't work on debug, it doesn't work live. The confirmation just never happens.
The app has been on production for almost two years now, and it was working fine. It all started suddenly, i dont know what version caused this as I noticed because I had to do something else with the confirmation.
Whats supposed to happen:
The user buys the subscription, google play says all is okay, the check mark appears. I check for the status, it says premium, etc. I can confirm the entitlement is active I close the window, because i get that the entitlement is active.
Whats happening: The user buys the subscription, google play says all is okay, the check mark appears. I cannot confirm the entitlement because its never found. The page never closes because its not confirmed.
Edit:
The subscription is working fine, but the confirmation of subscription is not.
I guess I will have to downgrade the plugin and see when it was last working.
@arodriguezgb Thanks for the quick response!
Does the MagicWeather sample app work correctly for you on the same account? If you haven't yet, all you need to do to test it is to edit constant.dart to set up your API key and entitlement id.
I just tested it and it works correctly on my account on purchases_flutter
3.4.5
.
I'm asking to try to figure out whether the problem could be on the app or on the account.
Im getting thus ready, however, there may be something because this was working on earlier versions of the plugin.
Unless something changed in how things have to be done and I missed it.
awesome, let me know how it goes!
@aboedo The subscription status on Weather app is Active. However I mentioned before the subscription is working fine.
Like , if the user restarts the app after doing the subscription, the user will be subscribed.
This app does not cover the issue im having , unless im doing something wrong.
The issue I am having is that after I successfully subscribe, revenuecat is not finding the premium entitlement right away so I can't confirm the order and close the window etc.
Im following the SDK guide and its not working forme, but it was.
edit:
try {
PurchaserInfo purchaserInfo = await Purchases.purchasePackage(package);
var isPro = purchaserInfo.entitlements.all["my_entitlement_identifier"].isActive;
if (isPro) {
// Unlock that great "pro" content
}
} on PlatformException catch (e) {
var errorCode = PurchasesErrorHelper.getErrorCode(e);
if (errorCode != PurchasesErrorCode.purchaseCancelledError) {
showError(e);
}
}
IsPro is never called, because the active entitlements are not being found or something. It doesn't find it. It has nothing to do with debug, since I confirmed it's happening on production with live payments aswell.
Sadly i cant confirm since when this started happening.
thanks for reporting back! A couple of questions:
purchaserInfo.entitlements.active
?I am not sure if it shows there, but its definitely working.
this is what happens: When the subscription is successful on google's framework, I don't get the confirmation right away. But lets say if I close the app and open it again, I am subscribed. So it definitely works,
but that's not the way it should work, the subscription confirmation should work right away to confirm isPRO like in the code I pasted above which is the one on the documentation
And same thing on the second point, the identifier is is correct, its the same yes. Right away entitlements.isActive does not show anything I believe because isPro is not working. But like i said, the sub worked fine, its just in that moment, if I close the app and open it again, when I check again for active entitlements its there and it says its Active.
the issue is here at the time of purchase.
PurchaserInfo purchaserInfo = await Purchases.purchasePackage(package);
var isPro = purchaserInfo.entitlements.all["my_entitlement_identifier"].isActive;
if (isPro) {
**// THIS IS NEVER BEING CALLED BECAUSE ISACTIVE IS NOT WORKING RIGHT AWAY**
}
@arodriguezgb thanks for your patience on this one. And yes, what you describe is the expected behavior - isActive should be true
for the entitlement that's coming from the purchaserInfo
instance returned by purchasePackage
.
I haven't been able to reproduce the bug yet, though: I just tried this again on one of our sample apps, on 3.4.5, with the following code:
And I did go into isPro
right away.
I'm not sure what might be happening for your case.
Have you tried with other test users?
Any chance that the code within isPro
is being called, but it's not making the expected updates? I imagine you might have tested this already, but I'm trying to cover all bases.
@aboedo Yes , I have tried with other tests users.
No , i have tried removing everything and just doing comments like you have there, but it does not get inside isPro. It doesnt get to the else either.
Im not sure what can be causing this :(.
Edit:
This warning could cause that issue ? W/[Purchases] - WARN(12683): 🤖‼️ There's more than one sku in the PurchaseHistoryRecord, but only one will be used.
Not from RevCat, but https://github.com/flutter/flutter/issues/35741
Nothing that could get me to think that is why im having the issue tho.
Edit 2:
I just noticed this when im setting up the revcat when the app launcher.
await Purchases.setup("IDGOESHERE",
appUserId: userid.uid);
E/[Purchases] - ERROR(15061): 😿‼️ Error performing request. E/Purchases(15061): Error fetching subscriber data: Error performing request.
What these two errors mean ? Could that be it.. I am testing on IOS now to see if that error also pops up.
YUP. I dont know what that issue means because I cant find anything to it on the documents but that doesnt happen on IOS wich is why maybe its working.
Edit 3:
Im using the sdk debugging tools i dont know why I didnt before. I think im close to finding a solution, if this works ill update back.
Edit 4:
I have fixed the issue , so for some reason it seems that the Purchases.setup was being called again after doing the Purchase and that seems to have cancelled the completion of the object from purchases so it seems thats why I wasn't getting it. Took a while to figure out what was wrong.
Im sorry for taking too much time on your part and it ended up being on me.
Im going to close this issue ,thanks for your help.
@arodriguezgb Thanks for the update! I'm glad you figured this out! For what it's worth, we've been thinking about ways to make it more apparent when there's a problem like setup
being called more than once, so that this kind of thing is less likely to happen.
Don't hesitate to reach out again if you run into more issues in the future.
Have a great day! Andy
If anyone has a similar issue where ios is working, but not android. Perhaps you are sending your apple apiKey to google like I was :(. Now I'm checking platform and it works perfectly.
if (Platform.isAndroid) {
apiKey = Config.revenueCatAPIKey_google;
} else if (Platform.isIOS) {
apiKey = Config.revenueCatAPIKey_apple;
}
Describe the bug SDK is 3.4.5 Everything works on IOS, but android is not. Same code.
When the subscription is successful I get this message on the log.
W/BillingHelper( 5733): Couldn't find purchase lists, trying to find single data.
The subscription is working, but i cant get the confirmation working and it was working before. Im not really sure when it started malfunctioning, I noticed now because I am working on an event trigger based on the purchase confirmation.
• No issues found! `
W/BillingHelper( 5733): Couldn't find purchase lists, trying to find single data. W/[Purchases] - WARN( 5733): 🤖‼️ There's more than one sku in the PurchaseHistoryRecord, but only one will be used.