Search Unity

Question Promotional Offers & [Android] Basic Plans

Discussion in 'Unity IAP' started by ArnauKokoro, Jan 18, 2023.

  1. ArnauKokoro

    ArnauKokoro

    Joined:
    Apr 27, 2021
    Posts:
    45
    Hi,

    I have a question about Subscriptions:

    Is there a way to choose between different promotional offers or to choose between [Android] different basic plans?

    Thanks!
     
  2. Laurie-Unity

    Laurie-Unity

    Unity Technologies

    Joined:
    Mar 5, 2020
    Posts:
    220
    Hi @ArnauKokoro

    Can you perhaps provide a little more info on the use case or challenge you are trying to solve so I can better understand and answer your enquiry?
     
  3. ArnauKokoro

    ArnauKokoro

    Joined:
    Apr 27, 2021
    Posts:
    45
    Hi @Laurie-Unity

    [Android]
    I have a subscription (with its product id) with 1 base plan (with its id) and 1 promotional offer (with its id) (7 days free). I use the product Id from the subscription on "builder.AddProduct(productId, Type.Subscription)" to load the subscription and then on InitializePurchase(productId). Here everything is working. I think because I just have 1 base plan and 1 promotional offer.

    But, what happen if I set a second promotional offer inside the first base plan or a second base plan. How can I choose the second promotion offer or the second base plan?


    Example:

    Subscription -> subscription.first (product Id)
    1 Base Plan -> monthly.plan (id)
    1 Promotional Offer -> free.days (id)
    2 Promotional Offer -> discount.month (id)

    2 Base Plan -> yearly.plan (id)

    Could I use InitializePurchase("subscription.first.monthly.plan.free.days") to load the subscription with 1 Base Plan and 1 Promotional Offer?

    Could I use InitializePurchase("subscription.first.monthly.plan.discount.month") to load the subscription with 1 Base Plan and 2 Promotional Offer?

    Could I use InitializePurchase("subscription.first.yearly.plan") to load the subscription with 2 Base Plan?

    Thanks!
     
  4. ArnauKokoro

    ArnauKokoro

    Joined:
    Apr 27, 2021
    Posts:
    45
    [Android]
    Reading about all of this, on Android this is new for Billing Android Library v5, so I think your are working on it.

    [iOS]
    On iOS you can also create promotional offers for each subscription also. On native swift payments library to indicate the offer you want to give to a user, include a signed paymentDiscount in the SKMutablePayment object.

    Is there a way to do so on Unity IAP nowadays?

    Thanks!
     
  5. Laurie-Unity

    Laurie-Unity

    Unity Technologies

    Joined:
    Mar 5, 2020
    Posts:
    220
    Hi @ArnauKokoro

    Thanks for providing additional details of your use case and follow up notes.

    I have confirmed with IAP engineers that

    [Android]
    This is indeed a new feature, we currently only support 1 base plan and it must be “Backwards compatible”. This is on our roadmap to be added along with Google Billing v5, but I can't provide an ETA on that at the moment.
    https://developer.android.com/google/play/billing/compatibility.

    [IOS]
    I think this might be what you are looking for...Intercepting Apple promotional purchases
     
    Last edited: Jan 19, 2023
  6. ArnauKokoro

    ArnauKokoro

    Joined:
    Apr 27, 2021
    Posts:
    45
    Hi @Laurie-Unity

    [Android]
    That's good!

    [iOS]
    What you mention is how to intercept an apple PROMOTION redeem from AppStore product page.
    What I mean is the same as Android: On iOS you create a subscription (product ID) and then you can create introductory promo (working on Unity IAP), promotion offers (the ones i'm asking how to choose on Unity IAP) and promotional codes (the ones you redeem with IAppleExtension.PresentCodeRedemptionSheet()) for that subscription.

    My question is:
    How can I choose one of that promotional offers from a subscription when I call InitializePurchase(productID)?

    On native Swift language payments library (StoreKit SDK) to indicate the offer you want to give to a user, include a signed paymentDiscount in the SKMutablePayment object.
    https://developer.apple.com/documen...s/implementing_promotional_offers_in_your_app


    [Updated]
    Also I'm trying to get working IAppleExtension.PresentCodeRedemptionSheet() but what I get when calling it is a native popup with a default AppleStore Icon (not my AppIcon) and when I press redeem I go to other page with an error. (Sandbox Testing)

    (TestFlight Testing) It works if I upload the app to TestFlight but still having AppleStore Icon when the popup appears and when I introduce the code the next screen shows the right text but the image appears white. It should appear at least the AppIcon on the two screens.

    It should redeem successful my code because is active and the purchase the subscription is linked from.

    Thanks!
     
    Last edited: Jan 20, 2023
  7. Oole123

    Oole123

    Joined:
    Jun 1, 2022
    Posts:
    1
    Hi,
    since the update to Google Billing v5 is part of the the Unity IAP 4.8, I wanted to ask if there is already a ETA for the support of retrieving all base plans for a subscription?

    I currently have the following setup in the Google Play Console:
    subscription: my.subscription.premium
    • base plan 1: yearly (backwards compatible)
    • base plan 2: monthly

    In my script I pass the product id of the subscription:
    Code (CSharp):
    1. var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    2. builder.AddProduct("my.subscription.premium", ProductType.Subscription);
    I then only see the backwards compatible base plan (yearly) in the app. There is currently no way (or workaround) to show both base plans, right? Or am I missing something?

    Thanks in advance!
     
  8. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    Leaving this here only because Unity closed potentially helpful threads for this previously, and this took us way too long to figure out and other people shouldn't have to go through the same thing.

    For anyone wondering how to get basic subscriptions working, you have to create a new subscription product in google play console. It can only have 1 base plan, and it has to be recurring (not pre-paid). The base plan has to have the same name as the product id.

    Unity has 0 documentation on this. Unity also doesn't support the "new" google product features, despite them being out since May 2022.
     
  9. mightyleaps

    mightyleaps

    Joined:
    Mar 25, 2023
    Posts:
    1
    THANK YOU. WOW that was driving me nuts and this INSTANTLY solved it.

    The fact that we can't have multiple base plans and must name subscription and base plan exactly the same is ridiculous. Kept getting the product ID double up. For example, I named base plan "premium-monthly" and it would return "Unavailable product premium-monthly-premium-monthly" for some reason and this was it.

    Thanks so much!

     
    Last edited: Oct 21, 2023
    ShantiB95 and joshuacwilde like this.
  10. ShantiB95

    ShantiB95

    Joined:
    Feb 8, 2017
    Posts:
    17
    Has anyone tested offers (free trial etc.) under a base plan? It seems that too is broken.

    EDIT: Nevermind, it took some time to update, but offers are working.
     
    Last edited: Mar 20, 2024