benjaminmayo/merchantkit

How to get started?

sampdubs opened this issue · 2 comments

Hello, I would like to include in app purchases in my app as a way to accept donations. However, I cannot figure out how to use the MerchantKit library. I have done all the simple things like initializing my donation product in AppDelegate

let merchant = Merchant(configuration: .default, delegate: self)
let product = Product(identifier: "com.RMBR.donate", kind: .consumable)
merchant.register([product])
merchant.setup()

But I cannot figure out how to actually get a user to purchase the product. As you can probably tell, I am quite confused with how this works. Any help will be greatly appreciated!

Thanks!

Please download the example project in the repository and go from there.

Hi, It would be nice to flesh out this functionality of the project a little more. Even after going through the sample project, I'm still confused. The commitPurchaseTask expects a Purchase object. But can't figure out how to create one.