Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
運用から学ぶPlay Billing Library
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
ymnder
April 10, 2019
Programming
2
770
運用から学ぶPlay Billing Library
In-tamachi Billing Night, 2019/04/10 20:00-20:10
https://billing-night.connpass.com/event/125510/
ymnder
April 10, 2019
Tweet
Share
More Decks by ymnder
See All by ymnder
What’s new in Google Play's billing system
ymnder
1
390
Deep Linksをはじめよう
ymnder
0
470
Introduction to Wear OS Application Development
ymnder
0
580
CircleCIを使ったAndroidの開発フローの効率化とtips
ymnder
1
1.4k
Introduction to new features of Google Play Billing
ymnder
2
340
What’s new in Google Play Billing v1.2
ymnder
0
750
詳解定期購入
ymnder
7
6.8k
社内向けライブラリを設計・運用する話
ymnder
0
1.2k
What’s new in Google Play Billing
ymnder
2
2.2k
Other Decks in Programming
See All in Programming
SourceGeneratorのマーカー属性問題について
htkym
0
200
モダンOBSプラグイン開発
umireon
0
150
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
300
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3.4k
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
230
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
15
8.9k
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.3k
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
400
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
150
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
8.1k
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
260
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
190
Featured
See All Featured
Ruling the World: When Life Gets Gamed
codingconduct
0
180
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
250
The untapped power of vector embeddings
frankvandijk
2
1.6k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
110
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
290
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
210
Color Theory Basics | Prateek | Gurzu
gurzu
0
250
Paper Plane
katiecoart
PRO
0
48k
A Modern Web Designer's Workflow
chriscoyier
698
190k
What's in a price? How to price your products and services
michaelherold
247
13k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Transcript
Play Billing Library In-tamachi Billing Night, 2019/04/10 20:00-20:10
whoami twitter:@ymnd, github:@ymnder Application Engineer Android Android [ -02] Nikkei
Development Book VOL 2 [ -08] hifumi https://riconken.bitbucket.io/hifumi/ 2
Otemachi.swift#3 iOS App by ikai https://nikkei.connpass.com/event/123343/ 3
Today s menu 4
None
: Google Play Billing Library Google Play Store In-app Billing
API wrap 6
: startConnection isReady querySkuDetailsAsync 7
: startConnection querySkuDetailsAsync launchBilling ow PurchasesUpdatedListener 8
: 9 SFNPUF MPDBM SFQPTJUPSZ VTFDBTF QSFTFOUFS WJFX
: Remote Local Repository interface RxJava Single Completable Remote BillingClient
DroidKaigi 2019 10
Repository 11 class PlayBillingRepositoryImpl @Inject constructor( private val remote: RemotePlayBilling
) : PlayBillingRepository { override fun startSubscription(activity: Activity, skuId: String): Observable<PurchaseResponse> { return remote.connect() .flatMapObservable { remote.querySkuDetailsAsync(skuId).flatMapObservable { response -> remote.launchBillingFlow(activity, response.skuDetailsList.first()) .flatMapObservable { remote.observePurchasesUpdated() .flatMap { if (it.result != BillingClient.BillingResponse.OK) { return@flatMap Observable.error<PurchasesUpdatedResponse>(…) } return@flatMap Observable.just(it) } //… } } } } }
Repository 12 class PlayBillingRepositoryImpl @Inject constructor( private val remote: RemotePlayBilling
) : PlayBillingRepository { override fun startSubscription(activity: Activity, skuId: String): Observable<PurchaseResponse> { return remote.connect() .flatMapObservable { remote.querySkuDetailsAsync(skuId).flatMapObservable { response -> remote.launchBillingFlow(activity, response.skuDetailsList.first()) .flatMapObservable { remote.observePurchasesUpdated() .flatMap { if (it.result != BillingClient.BillingResponse.OK) { return@flatMap Observable.error<PurchasesUpdatedResponse>(…) } return@flatMap Observable.just(it) } //… } } } } }
13 billing.startSubscription(this@BillingActivity, skuId) .subscribe({ //ߪೖॲཧ͕ޭͨ͠ }, { //ߪೖॲཧ͕ࣦഊͨ͠ Toast.makeText(this@BillingActivity, it.message,
Toast.LENGTH_SHORT).show() })
:BillingActivity Activity 14
: 15
None
BillingClient BillingClient 17
18
19
BillingClient API queryPurchaseHistoryAsync 20
queryPurchaseHistoryAsync ID 1 21
22
BillingClient API Purchases.subscriptions API 23
Google Play Billing Library Purchases.subscriptions API Real-time developer noti cations
24
Nikkei Development Book VOL 2 Android / iOS ✕ /
[ -02] https://techbookfest.org/event/tbf06/circle/40320001 25
Subscription :)
https://speakerdeck.com/ymnder/xiang-jie-ding-qi-gou-ru What's new in Google Play Billing v1.0 -> v1.1
https://speakerdeck.com/ymnder/whats-new-in-google-play-billing What's new in Google Play Billing v1.2 v1.1 -> v1.2 https://speakerdeck.com/ymnder/whats-new-in-google-play-billing-v1-dot-2 27