SlideShare a Scribd company logo
1 of 66
Download to read offline
IAP auto-renewable
in practice
Cocoaheads Taipei ,2016.12
2
3
In App Purchase
Users use their Apple ID purchase virtual product(s)
Developer use receipt(s) to implement business logic
Financial receive simple report
4
step 1~7
get products user can purchase 

5
6
NSSet *productsIDSet = ["product_identifiers1","product_identifiers2"]
self.productRequest = [[SKProductsRequest alloc]
initWithProductIdentifiers:productsIDSet];
productRequest.delegate = self;
[productRequest start];
7
SKProductsRequestDelegate
- (void)productsRequest:(SKProductsRequest *)request
didReceiveResponse:(SKProductsResponse *)response
{
NSLog(@"receive products %@", response.products);
NSLog(@"invalidProductIdentifiers %@", response.invalidProductIdentifiers);
self.products = response.products;
……
}
[SKProduct] from productsIDSet
8
step 8
user select product to buy 

9
step 8
user select product to buy 

- (void)purchaseProduct:(SKProduct *)inProduct
{
SKPayment *p = [SKPayment paymentWithProduct:inProduct];
[[SKPaymentQueue defaultQueue] addPayment:p];
}
10
step 9 ~11
validate user AppleID/password 

11
step 12 ~14
receive receipt

12
SKPaymentTransactionObserver
- (void)paymentQueue:(SKPaymentQueue *)queue
updatedTransactions:(NSArray *)transactions
{
NSMutableArray *purchasedTransactions = [NSMutableArray array];
for (SKPaymentTransaction *t in transactions) {
switch (t.transactionState) {
case SKPaymentTransactionStatePurchased:
[purchasedTransactions addObject:t];
[[SKPaymentQueue defaultQueue] finishTransaction:t];
break;
//ignore other case in sample code
}
}
if ([purchasedTransactions count] > 0) {
//handle receipts here,continue step 15
}
}
13
step 15~19
verify receipt with Apple server / Your server

14
How server validate a receipt
1.Apple API
receipt product_id
receipt bid
receipt duration(auto-renewable)
https://sandbox.itunes.apple.com/verifyReceipt
https://buy.itunes.apple.com/verifyReceipt
2.DB
ensure receipt transaction_id not used
15
step 20
Deliver purchased content

16
Overview (bad side)
3.1.1 In-App Purchase, 3.1.2 Subscriptions:
If you want to unlock features or functionality within your app,you must use in-app purchase
only verify API, no webhook
When user cancel on iTunes ,Server will not get cancel request.
Can not know which Apple ID user use
Can not know purchase condition until receive receipt
17
A lot of problems we met
18
Receive sandbox receipt on production environment
production validate API ->
receive 21007 status code ->
try sandbox API
Solution:
18
Receive sandbox receipt on production environment
production validate API ->
receive 21007 status code ->
try sandbox API
Solution:
Look like workaround,but it’s spec
19
Critical:Network condition bad When Upload receipt to server
19
Critical:Network condition bad When Upload receipt to server
Business logic

Purchase
Manager
Purchase
Manager
StoreKit
Purchase
ViewController
SKProductsRequestDelegate
SKPaymentTransactionObserverdelegatedelegate
Solution:
cache receipts , remove cache after ensure receipt is uploaded
19
Critical:Network condition bad When Upload receipt to server
Business logic

Purchase
Manager
Purchase
Manager
StoreKit
Purchase
ViewController
SKProductsRequestDelegate
SKPaymentTransactionObserverdelegatedelegate
cache receipts
Solution:
cache receipts , remove cache after ensure receipt is uploaded
19
Critical:Network condition bad When Upload receipt to server
Business logic

Purchase
Manager
Purchase
Manager
StoreKit
Purchase
ViewController
SKProductsRequestDelegate
SKPaymentTransactionObserverdelegatedelegate
cache receipts
trigger API
remove receipts
Solution:
cache receipts , remove cache after ensure receipt is uploaded
19
Critical:Network condition bad When Upload receipt to server
Business logic

Purchase
Manager
Purchase
Manager
StoreKit
Purchase
ViewController
SKProductsRequestDelegate
SKPaymentTransactionObserverdelegatedelegate
cache receipts
trigger API
remove receipts
UI
Solution:
cache receipts , remove cache after ensure receipt is uploaded
20
User purchase on iTunes instead of app
case 1
1.touch purchase product on App
2.when validate AppleID, type wrong password more than 3 times
3.StoreKit ask user to change password
4.redirect to iTunes
5.type correct password and user can purchase on iTunes
21
User purchase on iTunes instead of app
touch this
itms-apps://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptionscase 2
22
User purchase on iTunes instead of app
case 2 https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions
touch this
23
User purchase on iTunes instead of app
Business logic

Purchase
Manager
Purchase
Manager
StoreKit
Purchase
ViewController
SKProductsRequestDelegate
SKPaymentTransactionObserverdelegate
delegate
Solution: init purchase manager at app launch
23
User purchase on iTunes instead of app
Business logic

Purchase
Manager
Purchase
Manager
StoreKit
Purchase
ViewController
SKProductsRequestDelegate
SKPaymentTransactionObserverdelegate
delegate
Solution: init purchase manager at app launch
AppDelegate init at app launch
24
What is receipt (app side)
SKPaymentTransaction
@property(nonatomic, readonly, nullable) NSData *transactionReceipt
/* base64 encode string */
NSString *receiptString = [receipt base64EncodedStringWithOptions:0];
24
What is receipt (app side)
SKPaymentTransaction
@property(nonatomic, readonly, nullable) NSData *transactionReceipt
/* base64 encode string */
NSString *receiptString = [receipt base64EncodedStringWithOptions:0];
25
What is receipt (server side)
25
What is receipt (server side)
25
What is receipt (server side)
26
Critical: Auto-renew fail but user receive charge mail
26
Critical: Auto-renew fail but user receive charge mail
Solution: Trigger Verify API at Next day of expire_date
Not the same day
27
When switch from objC to swift
28
When switch from objC to swift
28
When switch from objC to swift
transactionReceipt property missing
can only use iOS 7 style receipt
29
iOS 7 receipt
29
iOS 7 receipt
29
iOS 7 receipt
30
iOS 7 receipt
30
iOS 7 receipt
31
iOS 6 vs iOS 7 style transaction receipts
• each transaction has unique iOS 6 style receipt
• iOS 7 style receipt get all receipt data in one query
• base64 encode iOS 7 style receipt is much larger than iOS 6 style
32
Will original_transaction_id change?
purchase cancel purchase
again
A C
renew
a long time
B
32
Will original_transaction_id change?
purchase cancel purchase
again
A C
original_transaction_id in receipt A , B and C keep the same
renew
a long time
B
33
Can I manage auto-renewable subscription in Sandbox ?
No.
In addition,sandbox will auto-renew 5 times.
in the end will get 6 receipt
34
What will user see in iTune Connect If my app have multiple auto-
renewable products( A & B)?
34
What will user see in iTune Connect If my app have multiple auto-
renewable products( A & B)?
https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/
manageSubscriptions


This URL will only work for production accounts to display existing auto-renewing
subscriptions for management
35
purchase
product A in app
cancel
auto-renew A
in iTune
purchase
product B in app
product A
expire
What will user see in iTune Connect If my app have multiple auto-
renewable products( A & B)?
35
purchase
product A in app
cancel
auto-renew A
in iTune
purchase
product B in app
product A
expire
What will user see in iTune Connect If my app have multiple auto-
renewable products( A & B)?
iTune display product A product B
36
You can not do anything If
You have a auto renewable product,also set trial period(Eq:1 month)
But Apple receipt trial period is more than your setting
KKTV happen this few times
37
if your service has
account system + multiple platform + multiple payment
37
if your service has
account system + multiple platform + multiple payment
email
facebook
phone number
iOS
Android
Web
PS4
…
IAP
credit card
mobile payment
POSA card
redeem code
convenient store code
38
Example:
User Apple ID KKTV
iTunes
KKTV
Result:
StoreKit
39
Example:
User Apple ID KKTV
iTunes
KKTV
Result:
receipt server
KKTV
Solution:
receipt Alert
39
Example:
User Apple ID KKTV
iTunes
KKTV
Result:
receipt server
KKTV
Solution:
receipt Alert
40
Example:
user IAP
iTunes IAP
40
Example:
user IAP
iTunes IAP
Result
IAP user
40
Example:
user IAP
iTunes IAP
Result
IAP user
Solution
app/server side user iTunes
41
Example:
user
IAP
..... KKTV
KKTV IAP
41
Example:
user
IAP
Result
AppleID user
..... KKTV
KKTV IAP
42
Financial
• report daily
• report user ID transactionID
• user cancel / refund
•
43
Conclusion
• IAP is unfriendly to Developer. But super easy for user.
• Tracking IAP log help find unexpected problems
• Raise IAP price could be an option
44
Reference
TN2387:In-App Purchase Best Practices
TN2413: In-App Purchase FAQ
In-App Purchase Programming Guide
Receipt Validation Programming Guide
WWDC 2016: Using StoreKit for In-App Purchases with Swift 3
WWDC 2014: Optimizing In-App Purchases
WWDC 2012: Selling Products with Store Kit
WWDC 2013: Using Store Kit for In-App Purchases
WWDC 2012: Managing Subscriptions with In-App Purchase
TN2259: Adding In-App Purchase to your iOS and macOS Applications
https://forums.developer.apple.com/community/system-frameworks/in-app-purchase

More Related Content

What's hot

Dependency injection in Java, from naive to functional
Dependency injection in Java, from naive to functionalDependency injection in Java, from naive to functional
Dependency injection in Java, from naive to functionalMarian Wamsiedel
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right wayThibaud Desodt
 
Application Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The UglyApplication Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The UglyRichard Lord
 
ASPNET_MVC_Tutorial_06_CS
ASPNET_MVC_Tutorial_06_CSASPNET_MVC_Tutorial_06_CS
ASPNET_MVC_Tutorial_06_CStutorialsruby
 

What's hot (6)

Dependency injection in Java, from naive to functional
Dependency injection in Java, from naive to functionalDependency injection in Java, from naive to functional
Dependency injection in Java, from naive to functional
 
Distributed banking system using rmi project
Distributed banking system using rmi projectDistributed banking system using rmi project
Distributed banking system using rmi project
 
Webauthn Tutorial
Webauthn TutorialWebauthn Tutorial
Webauthn Tutorial
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
 
Application Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The UglyApplication Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The Ugly
 
ASPNET_MVC_Tutorial_06_CS
ASPNET_MVC_Tutorial_06_CSASPNET_MVC_Tutorial_06_CS
ASPNET_MVC_Tutorial_06_CS
 

Viewers also liked

SwiftyJSON 慘痛經驗
SwiftyJSON   慘痛經驗SwiftyJSON   慘痛經驗
SwiftyJSON 慘痛經驗Hokila Jan
 
接案公司的日子
接案公司的日子接案公司的日子
接案公司的日子Hokila Jan
 
軟體接案自由職業者 (Freelancer) 意想不到的風險
軟體接案自由職業者 (Freelancer) 意想不到的風險軟體接案自由職業者 (Freelancer) 意想不到的風險
軟體接案自由職業者 (Freelancer) 意想不到的風險Yi-Feng Tzeng
 
恰如其分的 MySQL 設計技巧 [Modern Web 2016]
恰如其分的 MySQL 設計技巧 [Modern Web 2016]恰如其分的 MySQL 設計技巧 [Modern Web 2016]
恰如其分的 MySQL 設計技巧 [Modern Web 2016]Yi-Feng Tzeng
 
快思慢想讀書會Ch9 10
快思慢想讀書會Ch9 10快思慢想讀書會Ch9 10
快思慢想讀書會Ch9 10Hokila Jan
 
第五章 認知放鬆度 第六章_常模_驚訝與原因
第五章 認知放鬆度 第六章_常模_驚訝與原因第五章 認知放鬆度 第六章_常模_驚訝與原因
第五章 認知放鬆度 第六章_常模_驚訝與原因Jimmy Yu
 
Uxpa 2012 Intersection between Accessibility & Plain Language
Uxpa 2012 Intersection between Accessibility & Plain LanguageUxpa 2012 Intersection between Accessibility & Plain Language
Uxpa 2012 Intersection between Accessibility & Plain LanguageSuzi Shapiro
 
THT IAP Certification Presentation Day2 7Dec2010
THT IAP Certification Presentation Day2 7Dec2010THT IAP Certification Presentation Day2 7Dec2010
THT IAP Certification Presentation Day2 7Dec2010Trompenaars Hampden-Turner
 
Pattern Recognition midterm Proposal
Pattern Recognition midterm ProposalPattern Recognition midterm Proposal
Pattern Recognition midterm ProposalWin Yu
 
The Future of Classical Music
The Future of Classical MusicThe Future of Classical Music
The Future of Classical MusicYi-Feng Tzeng
 
2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)
2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)
2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)Yi-Feng Tzeng
 
2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)
2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)
2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)Win Yu
 
談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議
談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議
談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議Yi-Feng Tzeng
 
Lecture 06. iOS Programming. Основи Objective-C
Lecture 06. iOS Programming. Основи Objective-CLecture 06. iOS Programming. Основи Objective-C
Lecture 06. iOS Programming. Основи Objective-CMaksym Davydov
 
資料庫索引數據結構及主鍵設計(b+tree)(part 1)
資料庫索引數據結構及主鍵設計(b+tree)(part 1)資料庫索引數據結構及主鍵設計(b+tree)(part 1)
資料庫索引數據結構及主鍵設計(b+tree)(part 1)Yi-Feng Tzeng
 
Enterprise Architecture Case in PHP (MUZIK Online)
Enterprise Architecture Case in PHP (MUZIK Online)Enterprise Architecture Case in PHP (MUZIK Online)
Enterprise Architecture Case in PHP (MUZIK Online)Yi-Feng Tzeng
 
淺入淺出 MySQL & PostgreSQL
淺入淺出 MySQL & PostgreSQL淺入淺出 MySQL & PostgreSQL
淺入淺出 MySQL & PostgreSQLYi-Feng Tzeng
 
Redis, another step on the road
Redis, another step on the roadRedis, another step on the road
Redis, another step on the roadYi-Feng Tzeng
 
適合資工系畢業生的 一百零一種工作
適合資工系畢業生的  一百零一種工作適合資工系畢業生的  一百零一種工作
適合資工系畢業生的 一百零一種工作鍾誠 陳鍾誠
 

Viewers also liked (20)

SwiftyJSON 慘痛經驗
SwiftyJSON   慘痛經驗SwiftyJSON   慘痛經驗
SwiftyJSON 慘痛經驗
 
接案公司的日子
接案公司的日子接案公司的日子
接案公司的日子
 
軟體接案自由職業者 (Freelancer) 意想不到的風險
軟體接案自由職業者 (Freelancer) 意想不到的風險軟體接案自由職業者 (Freelancer) 意想不到的風險
軟體接案自由職業者 (Freelancer) 意想不到的風險
 
恰如其分的 MySQL 設計技巧 [Modern Web 2016]
恰如其分的 MySQL 設計技巧 [Modern Web 2016]恰如其分的 MySQL 設計技巧 [Modern Web 2016]
恰如其分的 MySQL 設計技巧 [Modern Web 2016]
 
快思慢想讀書會Ch9 10
快思慢想讀書會Ch9 10快思慢想讀書會Ch9 10
快思慢想讀書會Ch9 10
 
第五章 認知放鬆度 第六章_常模_驚訝與原因
第五章 認知放鬆度 第六章_常模_驚訝與原因第五章 認知放鬆度 第六章_常模_驚訝與原因
第五章 認知放鬆度 第六章_常模_驚訝與原因
 
Uxpa 2012 Intersection between Accessibility & Plain Language
Uxpa 2012 Intersection between Accessibility & Plain LanguageUxpa 2012 Intersection between Accessibility & Plain Language
Uxpa 2012 Intersection between Accessibility & Plain Language
 
THT IAP Certification Presentation Day2 7Dec2010
THT IAP Certification Presentation Day2 7Dec2010THT IAP Certification Presentation Day2 7Dec2010
THT IAP Certification Presentation Day2 7Dec2010
 
Pattern Recognition midterm Proposal
Pattern Recognition midterm ProposalPattern Recognition midterm Proposal
Pattern Recognition midterm Proposal
 
The Future of Classical Music
The Future of Classical MusicThe Future of Classical Music
The Future of Classical Music
 
2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)
2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)
2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)
 
In-App Purchase
In-App PurchaseIn-App Purchase
In-App Purchase
 
2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)
2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)
2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)
 
談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議
談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議
談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議
 
Lecture 06. iOS Programming. Основи Objective-C
Lecture 06. iOS Programming. Основи Objective-CLecture 06. iOS Programming. Основи Objective-C
Lecture 06. iOS Programming. Основи Objective-C
 
資料庫索引數據結構及主鍵設計(b+tree)(part 1)
資料庫索引數據結構及主鍵設計(b+tree)(part 1)資料庫索引數據結構及主鍵設計(b+tree)(part 1)
資料庫索引數據結構及主鍵設計(b+tree)(part 1)
 
Enterprise Architecture Case in PHP (MUZIK Online)
Enterprise Architecture Case in PHP (MUZIK Online)Enterprise Architecture Case in PHP (MUZIK Online)
Enterprise Architecture Case in PHP (MUZIK Online)
 
淺入淺出 MySQL & PostgreSQL
淺入淺出 MySQL & PostgreSQL淺入淺出 MySQL & PostgreSQL
淺入淺出 MySQL & PostgreSQL
 
Redis, another step on the road
Redis, another step on the roadRedis, another step on the road
Redis, another step on the road
 
適合資工系畢業生的 一百零一種工作
適合資工系畢業生的  一百零一種工作適合資工系畢業生的  一百零一種工作
適合資工系畢業生的 一百零一種工作
 

Similar to IAP auto renewable in practice

Self checkout application presentation
Self checkout application presentationSelf checkout application presentation
Self checkout application presentationAshwinBicholiya
 
Dropwizard with MongoDB and Google Cloud
Dropwizard with MongoDB and Google CloudDropwizard with MongoDB and Google Cloud
Dropwizard with MongoDB and Google CloudYun Zhi Lin
 
API Security - OWASP top 10 for APIs + tips for pentesters
API Security - OWASP top 10 for APIs + tips for pentestersAPI Security - OWASP top 10 for APIs + tips for pentesters
API Security - OWASP top 10 for APIs + tips for pentestersInon Shkedy
 
App Store Subscriptions - Condensed Edition
App Store Subscriptions - Condensed EditionApp Store Subscriptions - Condensed Edition
App Store Subscriptions - Condensed EditionMark Pavlidis
 
Diving into VS 2015 Day4
Diving into VS 2015 Day4Diving into VS 2015 Day4
Diving into VS 2015 Day4Akhil Mittal
 
Adjust Workshop - PUSHING AND PULLING YOUR DATA
Adjust Workshop - PUSHING AND PULLING YOUR DATA Adjust Workshop - PUSHING AND PULLING YOUR DATA
Adjust Workshop - PUSHING AND PULLING YOUR DATA Adjust
 
Android In-App Billing @ Droidcon 2011
Android In-App Billing @ Droidcon 2011Android In-App Billing @ Droidcon 2011
Android In-App Billing @ Droidcon 2011Robot Media
 
QSDA2022: Qlik Sense Data Architect | Q & A
QSDA2022: Qlik Sense Data Architect | Q & AQSDA2022: Qlik Sense Data Architect | Q & A
QSDA2022: Qlik Sense Data Architect | Q & APalakMazumdar1
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB
 
Android In-App Billing @ Barcelona GTUG
Android In-App Billing @ Barcelona GTUGAndroid In-App Billing @ Barcelona GTUG
Android In-App Billing @ Barcelona GTUGRobot Media
 
Rethinking your mobile tracking strategy by Ekaterina Petrakova
Rethinking your mobile tracking strategy by Ekaterina PetrakovaRethinking your mobile tracking strategy by Ekaterina Petrakova
Rethinking your mobile tracking strategy by Ekaterina PetrakovaEkaterina Petrakova
 
5 Things Every Product Leader Needs to Know About API
5 Things Every Product Leader Needs to Know About API5 Things Every Product Leader Needs to Know About API
5 Things Every Product Leader Needs to Know About APIAmancio Bouza
 
Z101666 best practices for delivering hybrid cloud capability with apis
Z101666 best practices for delivering hybrid cloud capability with apisZ101666 best practices for delivering hybrid cloud capability with apis
Z101666 best practices for delivering hybrid cloud capability with apisTeodoro Cipresso
 
Implémentez une intégration avec AEM presque sans code
Implémentez une intégration avec AEM presque sans codeImplémentez une intégration avec AEM presque sans code
Implémentez une intégration avec AEM presque sans codeFrançois Le Droff
 
Introduction to aop
Introduction to aopIntroduction to aop
Introduction to aopDror Helper
 
Microsoft AZ-204 Exam Dumps
Microsoft AZ-204 Exam DumpsMicrosoft AZ-204 Exam Dumps
Microsoft AZ-204 Exam DumpsStudy Material
 
Thinking Serverless (AWS re:Invent 2019 chalk talk SVS213). Solutions slides.
Thinking Serverless (AWS re:Invent 2019 chalk talk SVS213). Solutions slides.Thinking Serverless (AWS re:Invent 2019 chalk talk SVS213). Solutions slides.
Thinking Serverless (AWS re:Invent 2019 chalk talk SVS213). Solutions slides.James Beswick
 
Preparing_for_PCA_Workbook.pptx
Preparing_for_PCA_Workbook.pptxPreparing_for_PCA_Workbook.pptx
Preparing_for_PCA_Workbook.pptxmambrino
 
Azure APIM Presentation to understand about.pptx
Azure APIM Presentation to understand about.pptxAzure APIM Presentation to understand about.pptx
Azure APIM Presentation to understand about.pptxpythagorus143
 

Similar to IAP auto renewable in practice (20)

Self checkout application presentation
Self checkout application presentationSelf checkout application presentation
Self checkout application presentation
 
PowerBI Embedded in D365 Finance and Operations
PowerBI Embedded in D365 Finance and OperationsPowerBI Embedded in D365 Finance and Operations
PowerBI Embedded in D365 Finance and Operations
 
Dropwizard with MongoDB and Google Cloud
Dropwizard with MongoDB and Google CloudDropwizard with MongoDB and Google Cloud
Dropwizard with MongoDB and Google Cloud
 
API Security - OWASP top 10 for APIs + tips for pentesters
API Security - OWASP top 10 for APIs + tips for pentestersAPI Security - OWASP top 10 for APIs + tips for pentesters
API Security - OWASP top 10 for APIs + tips for pentesters
 
App Store Subscriptions - Condensed Edition
App Store Subscriptions - Condensed EditionApp Store Subscriptions - Condensed Edition
App Store Subscriptions - Condensed Edition
 
Diving into VS 2015 Day4
Diving into VS 2015 Day4Diving into VS 2015 Day4
Diving into VS 2015 Day4
 
Adjust Workshop - PUSHING AND PULLING YOUR DATA
Adjust Workshop - PUSHING AND PULLING YOUR DATA Adjust Workshop - PUSHING AND PULLING YOUR DATA
Adjust Workshop - PUSHING AND PULLING YOUR DATA
 
Android In-App Billing @ Droidcon 2011
Android In-App Billing @ Droidcon 2011Android In-App Billing @ Droidcon 2011
Android In-App Billing @ Droidcon 2011
 
QSDA2022: Qlik Sense Data Architect | Q & A
QSDA2022: Qlik Sense Data Architect | Q & AQSDA2022: Qlik Sense Data Architect | Q & A
QSDA2022: Qlik Sense Data Architect | Q & A
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
 
Android In-App Billing @ Barcelona GTUG
Android In-App Billing @ Barcelona GTUGAndroid In-App Billing @ Barcelona GTUG
Android In-App Billing @ Barcelona GTUG
 
Rethinking your mobile tracking strategy by Ekaterina Petrakova
Rethinking your mobile tracking strategy by Ekaterina PetrakovaRethinking your mobile tracking strategy by Ekaterina Petrakova
Rethinking your mobile tracking strategy by Ekaterina Petrakova
 
5 Things Every Product Leader Needs to Know About API
5 Things Every Product Leader Needs to Know About API5 Things Every Product Leader Needs to Know About API
5 Things Every Product Leader Needs to Know About API
 
Z101666 best practices for delivering hybrid cloud capability with apis
Z101666 best practices for delivering hybrid cloud capability with apisZ101666 best practices for delivering hybrid cloud capability with apis
Z101666 best practices for delivering hybrid cloud capability with apis
 
Implémentez une intégration avec AEM presque sans code
Implémentez une intégration avec AEM presque sans codeImplémentez une intégration avec AEM presque sans code
Implémentez une intégration avec AEM presque sans code
 
Introduction to aop
Introduction to aopIntroduction to aop
Introduction to aop
 
Microsoft AZ-204 Exam Dumps
Microsoft AZ-204 Exam DumpsMicrosoft AZ-204 Exam Dumps
Microsoft AZ-204 Exam Dumps
 
Thinking Serverless (AWS re:Invent 2019 chalk talk SVS213). Solutions slides.
Thinking Serverless (AWS re:Invent 2019 chalk talk SVS213). Solutions slides.Thinking Serverless (AWS re:Invent 2019 chalk talk SVS213). Solutions slides.
Thinking Serverless (AWS re:Invent 2019 chalk talk SVS213). Solutions slides.
 
Preparing_for_PCA_Workbook.pptx
Preparing_for_PCA_Workbook.pptxPreparing_for_PCA_Workbook.pptx
Preparing_for_PCA_Workbook.pptx
 
Azure APIM Presentation to understand about.pptx
Azure APIM Presentation to understand about.pptxAzure APIM Presentation to understand about.pptx
Azure APIM Presentation to understand about.pptx
 

More from Hokila Jan

Tracking Event validator
Tracking Event validatorTracking Event validator
Tracking Event validatorHokila Jan
 
Preparation for wwdc and not waste it
Preparation for wwdc and not waste itPreparation for wwdc and not waste it
Preparation for wwdc and not waste itHokila Jan
 
Third party module strategy
Third party module strategyThird party module strategy
Third party module strategyHokila Jan
 
How to cheat jb detector and detect cheating
How to cheat jb detector and detect cheatingHow to cheat jb detector and detect cheating
How to cheat jb detector and detect cheatingHokila Jan
 
進擊的帳單
進擊的帳單進擊的帳單
進擊的帳單Hokila Jan
 
讓你的App優雅的crash三部曲
讓你的App優雅的crash三部曲讓你的App優雅的crash三部曲
讓你的App優雅的crash三部曲Hokila Jan
 
iOS app security
iOS app security  iOS app security
iOS app security Hokila Jan
 
快思慢想Ch13 14
快思慢想Ch13 14快思慢想Ch13 14
快思慢想Ch13 14Hokila Jan
 
從Scrum到放棄scrum
從Scrum到放棄scrum從Scrum到放棄scrum
從Scrum到放棄scrumHokila Jan
 

More from Hokila Jan (9)

Tracking Event validator
Tracking Event validatorTracking Event validator
Tracking Event validator
 
Preparation for wwdc and not waste it
Preparation for wwdc and not waste itPreparation for wwdc and not waste it
Preparation for wwdc and not waste it
 
Third party module strategy
Third party module strategyThird party module strategy
Third party module strategy
 
How to cheat jb detector and detect cheating
How to cheat jb detector and detect cheatingHow to cheat jb detector and detect cheating
How to cheat jb detector and detect cheating
 
進擊的帳單
進擊的帳單進擊的帳單
進擊的帳單
 
讓你的App優雅的crash三部曲
讓你的App優雅的crash三部曲讓你的App優雅的crash三部曲
讓你的App優雅的crash三部曲
 
iOS app security
iOS app security  iOS app security
iOS app security
 
快思慢想Ch13 14
快思慢想Ch13 14快思慢想Ch13 14
快思慢想Ch13 14
 
從Scrum到放棄scrum
從Scrum到放棄scrum從Scrum到放棄scrum
從Scrum到放棄scrum
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 

Recently uploaded (20)

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

IAP auto renewable in practice

  • 2. 2
  • 3. 3 In App Purchase Users use their Apple ID purchase virtual product(s) Developer use receipt(s) to implement business logic Financial receive simple report
  • 4. 4 step 1~7 get products user can purchase 

  • 5. 5
  • 6. 6 NSSet *productsIDSet = ["product_identifiers1","product_identifiers2"] self.productRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productsIDSet]; productRequest.delegate = self; [productRequest start];
  • 7. 7 SKProductsRequestDelegate - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response { NSLog(@"receive products %@", response.products); NSLog(@"invalidProductIdentifiers %@", response.invalidProductIdentifiers); self.products = response.products; …… } [SKProduct] from productsIDSet
  • 8. 8 step 8 user select product to buy 

  • 9. 9 step 8 user select product to buy 
 - (void)purchaseProduct:(SKProduct *)inProduct { SKPayment *p = [SKPayment paymentWithProduct:inProduct]; [[SKPaymentQueue defaultQueue] addPayment:p]; }
  • 10. 10 step 9 ~11 validate user AppleID/password 

  • 12. 12 SKPaymentTransactionObserver - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { NSMutableArray *purchasedTransactions = [NSMutableArray array]; for (SKPaymentTransaction *t in transactions) { switch (t.transactionState) { case SKPaymentTransactionStatePurchased: [purchasedTransactions addObject:t]; [[SKPaymentQueue defaultQueue] finishTransaction:t]; break; //ignore other case in sample code } } if ([purchasedTransactions count] > 0) { //handle receipts here,continue step 15 } }
  • 13. 13 step 15~19 verify receipt with Apple server / Your server

  • 14. 14 How server validate a receipt 1.Apple API receipt product_id receipt bid receipt duration(auto-renewable) https://sandbox.itunes.apple.com/verifyReceipt https://buy.itunes.apple.com/verifyReceipt 2.DB ensure receipt transaction_id not used
  • 16. 16 Overview (bad side) 3.1.1 In-App Purchase, 3.1.2 Subscriptions: If you want to unlock features or functionality within your app,you must use in-app purchase only verify API, no webhook When user cancel on iTunes ,Server will not get cancel request. Can not know which Apple ID user use Can not know purchase condition until receive receipt
  • 17. 17 A lot of problems we met
  • 18. 18 Receive sandbox receipt on production environment production validate API -> receive 21007 status code -> try sandbox API Solution:
  • 19. 18 Receive sandbox receipt on production environment production validate API -> receive 21007 status code -> try sandbox API Solution: Look like workaround,but it’s spec
  • 20. 19 Critical:Network condition bad When Upload receipt to server
  • 21. 19 Critical:Network condition bad When Upload receipt to server Business logic
 Purchase Manager Purchase Manager StoreKit Purchase ViewController SKProductsRequestDelegate SKPaymentTransactionObserverdelegatedelegate Solution: cache receipts , remove cache after ensure receipt is uploaded
  • 22. 19 Critical:Network condition bad When Upload receipt to server Business logic
 Purchase Manager Purchase Manager StoreKit Purchase ViewController SKProductsRequestDelegate SKPaymentTransactionObserverdelegatedelegate cache receipts Solution: cache receipts , remove cache after ensure receipt is uploaded
  • 23. 19 Critical:Network condition bad When Upload receipt to server Business logic
 Purchase Manager Purchase Manager StoreKit Purchase ViewController SKProductsRequestDelegate SKPaymentTransactionObserverdelegatedelegate cache receipts trigger API remove receipts Solution: cache receipts , remove cache after ensure receipt is uploaded
  • 24. 19 Critical:Network condition bad When Upload receipt to server Business logic
 Purchase Manager Purchase Manager StoreKit Purchase ViewController SKProductsRequestDelegate SKPaymentTransactionObserverdelegatedelegate cache receipts trigger API remove receipts UI Solution: cache receipts , remove cache after ensure receipt is uploaded
  • 25. 20 User purchase on iTunes instead of app case 1 1.touch purchase product on App 2.when validate AppleID, type wrong password more than 3 times 3.StoreKit ask user to change password 4.redirect to iTunes 5.type correct password and user can purchase on iTunes
  • 26. 21 User purchase on iTunes instead of app touch this itms-apps://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptionscase 2
  • 27. 22 User purchase on iTunes instead of app case 2 https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions touch this
  • 28. 23 User purchase on iTunes instead of app Business logic
 Purchase Manager Purchase Manager StoreKit Purchase ViewController SKProductsRequestDelegate SKPaymentTransactionObserverdelegate delegate Solution: init purchase manager at app launch
  • 29. 23 User purchase on iTunes instead of app Business logic
 Purchase Manager Purchase Manager StoreKit Purchase ViewController SKProductsRequestDelegate SKPaymentTransactionObserverdelegate delegate Solution: init purchase manager at app launch AppDelegate init at app launch
  • 30. 24 What is receipt (app side) SKPaymentTransaction @property(nonatomic, readonly, nullable) NSData *transactionReceipt /* base64 encode string */ NSString *receiptString = [receipt base64EncodedStringWithOptions:0];
  • 31. 24 What is receipt (app side) SKPaymentTransaction @property(nonatomic, readonly, nullable) NSData *transactionReceipt /* base64 encode string */ NSString *receiptString = [receipt base64EncodedStringWithOptions:0];
  • 32. 25 What is receipt (server side)
  • 33. 25 What is receipt (server side)
  • 34. 25 What is receipt (server side)
  • 35. 26 Critical: Auto-renew fail but user receive charge mail
  • 36. 26 Critical: Auto-renew fail but user receive charge mail Solution: Trigger Verify API at Next day of expire_date Not the same day
  • 37. 27 When switch from objC to swift
  • 38. 28 When switch from objC to swift
  • 39. 28 When switch from objC to swift transactionReceipt property missing can only use iOS 7 style receipt
  • 45. 31 iOS 6 vs iOS 7 style transaction receipts • each transaction has unique iOS 6 style receipt • iOS 7 style receipt get all receipt data in one query • base64 encode iOS 7 style receipt is much larger than iOS 6 style
  • 46. 32 Will original_transaction_id change? purchase cancel purchase again A C renew a long time B
  • 47. 32 Will original_transaction_id change? purchase cancel purchase again A C original_transaction_id in receipt A , B and C keep the same renew a long time B
  • 48. 33 Can I manage auto-renewable subscription in Sandbox ? No. In addition,sandbox will auto-renew 5 times. in the end will get 6 receipt
  • 49. 34 What will user see in iTune Connect If my app have multiple auto- renewable products( A & B)?
  • 50. 34 What will user see in iTune Connect If my app have multiple auto- renewable products( A & B)? https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/ manageSubscriptions 
 This URL will only work for production accounts to display existing auto-renewing subscriptions for management
  • 51. 35 purchase product A in app cancel auto-renew A in iTune purchase product B in app product A expire What will user see in iTune Connect If my app have multiple auto- renewable products( A & B)?
  • 52. 35 purchase product A in app cancel auto-renew A in iTune purchase product B in app product A expire What will user see in iTune Connect If my app have multiple auto- renewable products( A & B)? iTune display product A product B
  • 53. 36 You can not do anything If You have a auto renewable product,also set trial period(Eq:1 month) But Apple receipt trial period is more than your setting KKTV happen this few times
  • 54. 37 if your service has account system + multiple platform + multiple payment
  • 55. 37 if your service has account system + multiple platform + multiple payment email facebook phone number iOS Android Web PS4 … IAP credit card mobile payment POSA card redeem code convenient store code
  • 56. 38 Example: User Apple ID KKTV iTunes KKTV Result: StoreKit
  • 57. 39 Example: User Apple ID KKTV iTunes KKTV Result: receipt server KKTV Solution: receipt Alert
  • 58. 39 Example: User Apple ID KKTV iTunes KKTV Result: receipt server KKTV Solution: receipt Alert
  • 61. 40 Example: user IAP iTunes IAP Result IAP user Solution app/server side user iTunes
  • 64. 42 Financial • report daily • report user ID transactionID • user cancel / refund •
  • 65. 43 Conclusion • IAP is unfriendly to Developer. But super easy for user. • Tracking IAP log help find unexpected problems • Raise IAP price could be an option
  • 66. 44 Reference TN2387:In-App Purchase Best Practices TN2413: In-App Purchase FAQ In-App Purchase Programming Guide Receipt Validation Programming Guide WWDC 2016: Using StoreKit for In-App Purchases with Swift 3 WWDC 2014: Optimizing In-App Purchases WWDC 2012: Selling Products with Store Kit WWDC 2013: Using Store Kit for In-App Purchases WWDC 2012: Managing Subscriptions with In-App Purchase TN2259: Adding In-App Purchase to your iOS and macOS Applications https://forums.developer.apple.com/community/system-frameworks/in-app-purchase