SlideShare a Scribd company logo
In App Purchase
In app purchase is a relatively simple feature with a bit of hassle from the stores who handle the product management. The API itself is trivial
What’s In App Purchase?
✦ In app purchase allows us to use the Google Play or
iTunes billing system to pay for virtual goods
✦ This is a huge benefit as payment can be as easy as a
single click and very convenient
✦ It’s also a restriction, both Apple & Google prohibit the
sale of virtual goods in any other way!
✦ The drawbacks are: 30% commission & you can’t/
shouldn’t pay for non-virtual goods
Before we begin lets review the basics of what is in-app-purchase. In app purchase allows us to use the same billing support Apple & Google use for buying apps in
order to sell items within the app. You can use this to sell virtual goods which means things that are parts of the application such as digital content, upgrades, in-app
features, game elements etc.

Using in-app-purchase is much easier than credit card billing or any other form of payment as the whole process is managed by Google or Apple. 

However, it’s also a requirement. If you have elements sold within your app you might get banned if you don’t use in app purchase. As an example we recently updated
the kitchen sink demo in the Apple appstore and got a rejection. The tester reviewed the link in the app to codenameone.com and complained that we sell items within
the site (the subscription) and don’t use in-app-purchase. We explained that that app is completely free and the subscription has nothing to do with the app and the app
passed the verification.

This should obviously teach you that communication in these cases is bidirectional and also how serious Apple is about the in-app-purchase requirement.

So why don’t we sell Codename One subscriptions via in-app-purchase. This is something we are actually considering but the main demotivation is the 30% commission
to Apple. They now have a special case for subscriptions that might make them more financially viable so we might add that in the future as an option but overall in-app-
purchase is expensive. If you are having thoughts about charging extra for in-app-purchase made thru the app that would be a problem as it’s prohibited by the Apple
terms of service.
Let’s start by looking at the code for in app purchase. Just like push requires the push callback in the main class, in app purchase requires the callback in the main class
too.
I’ll skip ahead to the callback methods for the purchase. itemPurchased is the actual purchase callback and it includes the sku representing the item that was purchased.
An sku is a constant value that you define when you setup the items in google play or itunes connect. The sku lets you determine the item that the user purchased when
you have more than one item. We are calling into the pending build method in this case to proceed with the purchase flow we started there. I’ll go into that soon.

We have an error callback as well which we can use for error logging. The refund callback might be interesting if this is a feature you can disable on refund but in this
case if a user asks for a refund there isn’t much we can do as the app was already built. 

The rest of the callbacks relate to subscription and manual purchase callback which is no longer used. Subscription is a subject in its own right that I won’t get into here.
But it’s a very good direction as it allows a constant and steady stream of revenue.

Lets move into the AppForm code for purchase
The purchase UI shows a dialog with commands for purchasing an iOS, Android or source code build. For now we don’t support the iOS build but might provide this in a
future update. Based on the command selected by the user we can select the right target and perform the right purchase type
Once pending build is invoked it just invokes build app as usual. Since this is invoked by the purchase callback this is effectively seamless We could have used the SKU
value from the server and called the build app callback with the SKU which would have worked exactly the same as this.

As you can see the code is pretty trivial, the main hassle is dealing with this in Google’s and Apples interfaces
In Google Play after you’ve uploaded your initial APK you can select “In-app products”
We click “Add New Product” then select managed product which allows us to add a new product SKU
I type in build_for_android as the SKU, I can use an arbitrary string value to represent the SKU
I type in a name and a description for the item we’re selling, this will be displayed to the user as part of the native payment process by Google play
The next state is scrolling down to the price and clicking the add price button so we can enter the price for the item using the local currency
I set the price for 40 NIS which is mostly a trial and error thing of what google will generate in terms of the pricing table. Once this is set I can scroll to the top and save
the data and this in a nutshell is in app purchase.
Thank You
Thanks for watching. I hope you found this informative

More Related Content

PPTX
Apps for good - Review It
PDF
How to make money from your mobile app? [6 techniques & a BONUS video]
PDF
Push Notification - Part 1 - Transcript.pdf
PDF
Payments in Mobile Apps
PPTX
Cloud wrap
PPTX
Ict becki and abbie business model
PDF
http://kredit-pod-zalog.mozello.ru/novosti-kredit_zalog-zaim-zallog_dengi-pod...
PDF
Electrical Home App
Apps for good - Review It
How to make money from your mobile app? [6 techniques & a BONUS video]
Push Notification - Part 1 - Transcript.pdf
Payments in Mobile Apps
Cloud wrap
Ict becki and abbie business model
http://kredit-pod-zalog.mozello.ru/novosti-kredit_zalog-zaim-zallog_dengi-pod...
Electrical Home App

Similar to In App Purchase - Transcript.pdf (20)

PPT
Grocery App
PDF
Simple affiliate secrets
PDF
Everlane iOS App Design Critique
PDF
Mobileapps
PPTX
Start On-Demand Business - How To Turn Idea Into Reality?
PDF
Final Project:E Connect
PPTX
Continental gift
PDF
Acquire Customers at the Lowest Cost
PDF
How Does Affiliate Marketing Work
PPTX
Application Deployment Android application.pptx
PPTX
How Much Does it Cost to Build Apps like OfferUp.pptx
PPT
[Android] Google Play in app billing
PDF
Affiliate Marketing Mastermind
PPTX
Apps for good final presentation app dev uk
PDF
The Only Guide You Need To Develop An Instacart Like Grocery App
PDF
Apps for good final presentation
PDF
Simple Affiliate Secrets
PDF
App Store Optimizer
PDF
Apps Army.pdf
PDF
Design_writeup (1)
Grocery App
Simple affiliate secrets
Everlane iOS App Design Critique
Mobileapps
Start On-Demand Business - How To Turn Idea Into Reality?
Final Project:E Connect
Continental gift
Acquire Customers at the Lowest Cost
How Does Affiliate Marketing Work
Application Deployment Android application.pptx
How Much Does it Cost to Build Apps like OfferUp.pptx
[Android] Google Play in app billing
Affiliate Marketing Mastermind
Apps for good final presentation app dev uk
The Only Guide You Need To Develop An Instacart Like Grocery App
Apps for good final presentation
Simple Affiliate Secrets
App Store Optimizer
Apps Army.pdf
Design_writeup (1)
Ad

More from ShaiAlmog1 (20)

PDF
The Duck Teaches Learn to debug from the masters. Local to production- kill ...
PDF
create-netflix-clone-06-client-ui.pdf
PDF
create-netflix-clone-01-introduction_transcript.pdf
PDF
create-netflix-clone-02-server_transcript.pdf
PDF
create-netflix-clone-04-server-continued_transcript.pdf
PDF
create-netflix-clone-01-introduction.pdf
PDF
create-netflix-clone-06-client-ui_transcript.pdf
PDF
create-netflix-clone-03-server.pdf
PDF
create-netflix-clone-04-server-continued.pdf
PDF
create-netflix-clone-05-client-model_transcript.pdf
PDF
create-netflix-clone-03-server_transcript.pdf
PDF
create-netflix-clone-02-server.pdf
PDF
create-netflix-clone-05-client-model.pdf
PDF
Creating a Whatsapp Clone - Part II.pdf
PDF
Creating a Whatsapp Clone - Part IX - Transcript.pdf
PDF
Creating a Whatsapp Clone - Part II - Transcript.pdf
PDF
Creating a Whatsapp Clone - Part V - Transcript.pdf
PDF
Creating a Whatsapp Clone - Part IV - Transcript.pdf
PDF
Creating a Whatsapp Clone - Part IV.pdf
PDF
Creating a Whatsapp Clone - Part I - Transcript.pdf
The Duck Teaches Learn to debug from the masters. Local to production- kill ...
create-netflix-clone-06-client-ui.pdf
create-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-02-server_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-01-introduction.pdf
create-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-03-server.pdf
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-02-server.pdf
create-netflix-clone-05-client-model.pdf
Creating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdf
Ad

Recently uploaded (20)

PDF
Machine learning based COVID-19 study performance prediction
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Empathic Computing: Creating Shared Understanding
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Encapsulation_ Review paper, used for researhc scholars
PPT
Teaching material agriculture food technology
PPTX
Machine Learning_overview_presentation.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
cuic standard and advanced reporting.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
A Presentation on Artificial Intelligence
PDF
Approach and Philosophy of On baking technology
Machine learning based COVID-19 study performance prediction
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Advanced methodologies resolving dimensionality complications for autism neur...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Empathic Computing: Creating Shared Understanding
Review of recent advances in non-invasive hemoglobin estimation
The Rise and Fall of 3GPP – Time for a Sabbatical?
Mobile App Security Testing_ A Comprehensive Guide.pdf
Unlocking AI with Model Context Protocol (MCP)
Encapsulation_ Review paper, used for researhc scholars
Teaching material agriculture food technology
Machine Learning_overview_presentation.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
sap open course for s4hana steps from ECC to s4
cuic standard and advanced reporting.pdf
Electronic commerce courselecture one. Pdf
A comparative analysis of optical character recognition models for extracting...
A Presentation on Artificial Intelligence
Approach and Philosophy of On baking technology

In App Purchase - Transcript.pdf

  • 1. In App Purchase In app purchase is a relatively simple feature with a bit of hassle from the stores who handle the product management. The API itself is trivial
  • 2. What’s In App Purchase? ✦ In app purchase allows us to use the Google Play or iTunes billing system to pay for virtual goods ✦ This is a huge benefit as payment can be as easy as a single click and very convenient ✦ It’s also a restriction, both Apple & Google prohibit the sale of virtual goods in any other way! ✦ The drawbacks are: 30% commission & you can’t/ shouldn’t pay for non-virtual goods Before we begin lets review the basics of what is in-app-purchase. In app purchase allows us to use the same billing support Apple & Google use for buying apps in order to sell items within the app. You can use this to sell virtual goods which means things that are parts of the application such as digital content, upgrades, in-app features, game elements etc. Using in-app-purchase is much easier than credit card billing or any other form of payment as the whole process is managed by Google or Apple. However, it’s also a requirement. If you have elements sold within your app you might get banned if you don’t use in app purchase. As an example we recently updated the kitchen sink demo in the Apple appstore and got a rejection. The tester reviewed the link in the app to codenameone.com and complained that we sell items within the site (the subscription) and don’t use in-app-purchase. We explained that that app is completely free and the subscription has nothing to do with the app and the app passed the verification. This should obviously teach you that communication in these cases is bidirectional and also how serious Apple is about the in-app-purchase requirement. So why don’t we sell Codename One subscriptions via in-app-purchase. This is something we are actually considering but the main demotivation is the 30% commission to Apple. They now have a special case for subscriptions that might make them more financially viable so we might add that in the future as an option but overall in-app- purchase is expensive. If you are having thoughts about charging extra for in-app-purchase made thru the app that would be a problem as it’s prohibited by the Apple terms of service.
  • 3. Let’s start by looking at the code for in app purchase. Just like push requires the push callback in the main class, in app purchase requires the callback in the main class too.
  • 4. I’ll skip ahead to the callback methods for the purchase. itemPurchased is the actual purchase callback and it includes the sku representing the item that was purchased. An sku is a constant value that you define when you setup the items in google play or itunes connect. The sku lets you determine the item that the user purchased when you have more than one item. We are calling into the pending build method in this case to proceed with the purchase flow we started there. I’ll go into that soon. We have an error callback as well which we can use for error logging. The refund callback might be interesting if this is a feature you can disable on refund but in this case if a user asks for a refund there isn’t much we can do as the app was already built. The rest of the callbacks relate to subscription and manual purchase callback which is no longer used. Subscription is a subject in its own right that I won’t get into here. But it’s a very good direction as it allows a constant and steady stream of revenue. Lets move into the AppForm code for purchase
  • 5. The purchase UI shows a dialog with commands for purchasing an iOS, Android or source code build. For now we don’t support the iOS build but might provide this in a future update. Based on the command selected by the user we can select the right target and perform the right purchase type
  • 6. Once pending build is invoked it just invokes build app as usual. Since this is invoked by the purchase callback this is effectively seamless We could have used the SKU value from the server and called the build app callback with the SKU which would have worked exactly the same as this. As you can see the code is pretty trivial, the main hassle is dealing with this in Google’s and Apples interfaces
  • 7. In Google Play after you’ve uploaded your initial APK you can select “In-app products”
  • 8. We click “Add New Product” then select managed product which allows us to add a new product SKU
  • 9. I type in build_for_android as the SKU, I can use an arbitrary string value to represent the SKU
  • 10. I type in a name and a description for the item we’re selling, this will be displayed to the user as part of the native payment process by Google play
  • 11. The next state is scrolling down to the price and clicking the add price button so we can enter the price for the item using the local currency
  • 12. I set the price for 40 NIS which is mostly a trial and error thing of what google will generate in terms of the pricing table. Once this is set I can scroll to the top and save the data and this in a nutshell is in app purchase.
  • 13. Thank You Thanks for watching. I hope you found this informative