Giter Club home page Giter Club logo

Comments (16)

grtzsohalf avatar grtzsohalf commented on June 1, 2024 1

Hi @beylmk I sent an email to you!
As for the question, in our product, the one-month free trial had already been set in App Store Connect before both the first subscription and the resubscription.
Thanks!

from purchases-unity.

aboedo avatar aboedo commented on June 1, 2024 1

@jswilliams we're currently investigating this issue.
As far as we can see, it can happen both in Sandbox and Production, though it's not 100% consistent. When it happens, the transactions don't show up in the receipt, neither on device nor from Apple's verifyReceipt endpoint.

We're digging into ways of addressing this while trying to get Apple to fix their side.

from purchases-unity.

grtzsohalf avatar grtzsohalf commented on June 1, 2024

I can also share the code snippet about this issue:

public void BeginPurchase(Purchases.Package package)
    {
        Purchases.Instance.PurchasePackage(package, (productIdentifier, customerInfo, userCancelled, error) =>
        {
            if (!userCancelled)
            {
                if (error != null)
                {
                    Debug.Log($"Purchase {productIdentifier} failed. PurchaseFailureReason: {error}");
                    AmplitudeManager.Instance.LogErrorEvent($"purchase_{productIdentifier}_failed_{error}", null);
                    NativeDialog.OpenDialog("Message", $"Purchase failed. Reason: {error}", "Ok");
                    return;
                }
                else
                {
                    Debug.Log($"Finished purchase {productIdentifier}!");

                    UserDataManager.Instance.SetIsSubscribed(customerInfo.Entitlements.Active.ContainsKey(entitlementId));
                    subscribeWarning.text = UserDataManager.Instance.isSubscribed ? "" : "You are not subscribed yet";

                    UpdateUI();
                }
            }
            else
            {
                Debug.Log($"Purchase {productIdentifier} failed. PurchaseFailureReason: {error}");
                AmplitudeManager.Instance.logEvent($"purchase_{productIdentifier}_failed_userCancelled", null);
            }
        });
    }

The expected behavior is:
After BeginPurchase is called, customerInfo.Entitlements.Active.ContainsKey(entitlementId) should be true in the callback.
However, this is not the case.

from purchases-unity.

aboedo avatar aboedo commented on June 1, 2024

hi! Thanks for the detailed report! We'll take a look to see what's going on.

from purchases-unity.

vegaro avatar vegaro commented on June 1, 2024

I am looking into this trying to reproduce it. Some questions I have though:

  • If I understand correctly this happens to you in both TestFlight and sandbox?
  • It looks like resubscription has something to do with this since everyone is mentioning the same. Are you letting the subscription renew at all and waiting for it to automatically stop renewing in sandbox? Or are you cancelling the renewal after purchasing, then when it expires, you try to repurchase. If so, how are you cancelling that renewal. Are you closing the app, going to settings, waiting for the expiration then reopening the app? Or waiting for the subscription to expire while the app is open?

Sorry for all this questions, but we are really trying to figure this out.

Thanks!

from purchases-unity.

vegaro avatar vegaro commented on June 1, 2024

Another question. Do you see the purchase dialog when trying to resubscribe? Some of the other reports mention not seeing the purchase dialog at all

from purchases-unity.

grtzsohalf avatar grtzsohalf commented on June 1, 2024

Thanks for the response!

  1. Yes, we see it happening in both TestFlight and sandbox (via xcode installation).
  2. In TestFlight, I am sure the issue happened after I closed the app, waited for expiration, and reopened the app to resubscribe. As for sandbox, I just installed the app via xcode, made a subscription, went to settings to cancel the subscription, and reinstalled the app via xcode using the same build to resubscribe.
  3. And I didn't see the purchase dialog at all either when resubscribing.

from purchases-unity.

grtzsohalf avatar grtzsohalf commented on June 1, 2024

Any update?

from purchases-unity.

beylmk avatar beylmk commented on June 1, 2024

Hey @grtzsohalf the team is looking into this. Unfortunately we still haven't been able to reproduce it. I'll be working on it to day and will report back with any findings.

from purchases-unity.

beylmk avatar beylmk commented on June 1, 2024

@grtzsohalf I think it'd be really helpful if we could see the API logs for your app. Could you email [email protected] with the issue so that we can start a private thread for you to share your app ID and the affected user ID?

And one other question -- we are seeing some interesting behavior around re-subscribing to a cancelled subscription after a free trial has been added. i.e. when a user subscribed to a subscription, cancelled it, then you added a free trial to that product and they tried re-subscribing.

I see that the product in the purchase logs above had a free month...do you remember when you added that? Or was this a purchase of an offer?

from purchases-unity.

jswilliams avatar jswilliams commented on June 1, 2024

Just wanted to pop in and say we're seeing the exact same behavior/bug in cordova-plugin-purchases. Going to get a bug going over there later today. puchases-flutter seems to have the same bug recently opened as well:

RevenueCat/purchases-flutter#449

Another on flutter from 13 months ago that's closed with no real resolution/explaination:

RevenueCat/purchases-flutter#201

My main question that hasn't been answered yet is do we know if this is only something that happens in Sandbox / TestFlight or will it happen in prod as well?

Basically any time a subscription expires in Sandbox or TestFlight there is a chance (not sure how to reliably reproduce it but it happens at least 10% of the time for us) that when you try to repurchase the same package that the system purchase dialog won't come up. There's no errors that I can see. If you call the purchase function the amount of times the subscription renewed before it expired then it will finally pop up. This happens even if it's been a day+ since the TestFlight subscription expired so I don't think it's an Apple caching issue alone.

from purchases-unity.

aboedo avatar aboedo commented on June 1, 2024

@grtzsohalf we just released 4.3.0, which allows you to opt-in to use StoreKit 2 APIs under the hood.
This might fix the issue, could you please give it a shot?
To use StoreKit 2, all you need to do is:

if you're configuring the SDK programmatically:

Purchases.PurchasesConfiguration.Builder builder = Purchases.PurchasesConfiguration.Builder.Init("api_key");
Purchases.PurchasesConfiguration purchasesConfiguration =
     builder.SetUsesStoreKit2IfAvailable(true)
     .Build();
purchases.Configure(purchasesConfiguration);

if you're configuring the SDK through the Unity UI:

Look for a new checkbox called "Uses StoreKit 2 If Available", and make sure it's checked

from purchases-unity.

stale avatar stale commented on June 1, 2024

This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Please reach out if you have additional information to help us investigate further!

from purchases-unity.

grtzsohalf avatar grtzsohalf commented on June 1, 2024

@aboedo No, after I used RevenueCat v4.3.0 with StoreKit 2 API enabled, the issue still existed. After I clicked a button for resubscription, BeginPurchase was called. Then no purchase dialog popped up, and the subscription status was still "unsubscribed" (by checking customerInfo.Entitlements.Active.ContainsKey(entitlementId)).

By the way, in this case, the user was not newly created. However, this issue should still not happen.
So we will keep using the observer mode only in production.

from purchases-unity.

stale avatar stale commented on June 1, 2024

This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Please reach out if you have additional information to help us investigate further!

from purchases-unity.

aboedo avatar aboedo commented on June 1, 2024

Update here:

We've identified an issue on resubscribes where StoreKit will sometimes fail silently when attempting to finish a transaction. When attempting a new purchase of the same product, this will cause the iOS prompt not to show and StoreKit will report the transaction as successful.

We have issued a backend workaround that will ensure that on these occasions, the SDK will return an error and attempt to finish the transaction again. From this point on the user should be able to resubscribe to the product.

from purchases-unity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.