Purchase manually

Purchasely provides customizable presentation templates you but if you want to create your own and only use Purchasely for handling the purchase process you can. We offer methods to:

  • Get a product

  • Get a plan

  • Get a users subscriptions

  • Purchase a product

  • Restore all products

Getting all products

Purchasely.allProducts(success: { (products) in
	// Returns an array of products and its available plans
}, failure: { (error) in
	// Display error
})

Getting a product

Purchasely.product(with: "PRODUCT_VENDOR_ID", success: { (product) in
	// Returns a product and its available plans
}, failure: { (error) in
	// Display error
})

Getting a plan

Purchasely.plan(with: "PLAN_VENDOR_ID", success: { (plan) in
	// Use the plan to display a price or start a purchase
}, failure: { (error) in
	// Display error
})

Purchasing a plan

Purchasely.purchase(plan: plan, success: {
	// Unlock / reload content and display a success / thank you message to user
}, failure: { (error) in
	// Display error
})

Restoring all products

Purchasely.restoreAllProducts(success: {
	// Reload content and display a success / thank you message to user
}, failure: { (error) in
	// Display error
})

Getting user subscriptions

Purchasely.userSubscriptions(success: { (subscriptions) in
	// Subscription object contains the plan purchased and the source it was purchased from (iOS or Android)
	// Calling unsubscribe() will either switch the user to its AppStore settings 
	// or display a procedure on how to unsubscribe on Android
}, failure: { (error) in
	// Display error
})

Last updated

© Purchasely 2020-2023