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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
370
Deep Linksをはじめよう
ymnder
0
460
Introduction to Wear OS Application Development
ymnder
0
560
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.7k
社内向けライブラリを設計・運用する話
ymnder
0
1.2k
What’s new in Google Play Billing
ymnder
2
2.2k
Other Decks in Programming
See All in Programming
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
AgentCoreとHuman in the Loop
har1101
5
210
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
950
CSC307 Lecture 07
javiergs
PRO
0
530
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
180
Oxlintはいいぞ
yug1224
5
1.2k
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
0
800
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
220
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
570
SourceGeneratorのススメ
htkym
0
170
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
180
Vibe codingでおすすめの言語と開発手法
uyuki234
0
210
Featured
See All Featured
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
0
100
Navigating Team Friction
lara
192
16k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
130
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Paper Plane
katiecoart
PRO
0
46k
Into the Great Unknown - MozCon
thekraken
40
2.2k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
420
Navigating Weather and Climate Data
rabernat
0
82
Being A Developer After 40
akosma
91
590k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Designing Experiences People Love
moore
144
24k
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