Upgrade to Pro — share decks privately, control downloads, hide ads and more …

運用から学ぶPlay Billing Library

ymnder
April 10, 2019

運用から学ぶ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

More Decks by ymnder

Other Decks in Programming

Transcript

  1. whoami twitter:@ymnd, github:@ymnder Application Engineer Android Android [ -02] Nikkei

    Development Book VOL 2 [ -08] hifumi https://riconken.bitbucket.io/hifumi/ 2
  2. 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) } //… } } } } }
  3. 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) } //… } } } } }
  4. 18

  5. 19

  6. 22

  7. Nikkei Development Book VOL 2 Android / iOS ✕ /

    [ -02] https://techbookfest.org/event/tbf06/circle/40320001 25
  8. 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