Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There’s no mechanism to activate developer determined subscription offers for Android. #57

Open
AshHerb opened this issue Feb 5, 2023 · 5 comments
Labels
moreinfo More information is needed

Comments

@AshHerb
Copy link

AshHerb commented Feb 5, 2023

I have some developer determined win-back offers as part of a subscription I plan to make available for lapsed subscribers. The free-trial and introductory pricing phases are straightforward but I don’t think defold has a way referring to specific offers besides the free-trial and introductory pricing when making a call to iap.buy().

Perhaps an additional member of the options table along with the subscription token to specify the particular offer that as a developer I want to give.

Also, maybe offers for a subscription are returned as part of the data in the callback for a call to iap.list().

@britzl britzl transferred this issue from defold/defold Feb 6, 2023
@britzl
Copy link
Collaborator

britzl commented Feb 6, 2023

Move to correct repository.

@AshHerb can you please also share the technical documentation for "developer determined win-back offers"? We have not looked into this and it will save us time if you can provide as much information around this as possible.

@britzl britzl added the moreinfo More information is needed label Feb 6, 2023
@AshHerb
Copy link
Author

AshHerb commented Feb 6, 2023

Move to correct repository.

@AshHerb can you please also share the technical documentation for "developer determined win-back offers"? We have not looked into this and it will save us time if you can provide as much information around this as possible.

Okay. I will.

@AshHerb
Copy link
Author

AshHerb commented Feb 6, 2023

In the reference for the method purchases.subscriptionsv2, one of its fields lineItems[] which contains the item level info for the subscription purchase, has as one of it's items, offerDetails, which is stated to be Offer details information related to a purchase line item.

More on offerDetails

@britzl
Copy link
Collaborator

britzl commented Feb 6, 2023

@AshHerb the APIs you linked are for the REST API (ie used from a game backend to Google servers).

But I'm not sure what more you need in the client besides what is already returned? For a subscription you get one or more subscription offers. Example:

{
  description = "",
  subscriptions = {
    {
      pricing = {
        {
          currency_code = "SEK",
          price = 12,
          recurrence_mode = "INFINITE",
          billing_cycle_count = 0,
          price_string = "12,00 kr",
          billing_period = "P1M"
        }
      },
      token = "AUj/Yhhm6F/wEICMXas5tNTPvm6bNOF/h1Z3BNBELFLtnexoGDZmmFdHW/5ykS+Foa094I8dxDLKjFFxlx1RjEgGpP82ujxRrOLAo9cz/xxeVIiXdTvi+JxlIjMznRO3zqiG"
    }
  },
  ident = "com.defold.iap.subscription.one",
  title = "Subscription one (In-App Tester)"
}

The subscriptions field is a list of SubscriptionOfferDetails, each containing a list of pricing phases and an offer token that is used when buying the subscription.

The offer token is passed as part of the iap.buy() call, like this:

local subscription = ... -- returned product from call to iap.list()
local token = subscription.subscriptions[1].token
iap.buy("com.defold.iap.subscription.one", { token = token })

@AshHerb
Copy link
Author

AshHerb commented Feb 6, 2023

Oh my bad. Thanks for your clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
moreinfo More information is needed
Projects
None yet
Development

No branches or pull requests

2 participants