O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Billing Library 2.0 Overview

751 visualizações

Publicada em

Shibuya.apk #34での登壇内容です!

Publicada em: Engenharia
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • Seja a primeira pessoa a gostar disto

Billing Library 2.0 Overview

  1. 1. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ Billing Library 2.0 Overview 2019/05/17 Shibuya.apk #34 Namito Satoyama
  2. 2. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ Community Video Market Corporation 執⾏役員 VP of Engineering /ProductManager Twitter: @ns_twt Writing Namito Satoyama Profile ⿊帯エンジニアが教えるプロの技術 Android開発の教科書 (共著︓SB Creative) ステップバイステップで⼒がつく Googleアシスタント アプリ開発⼊⾨ (共著︓ソシム) Speaker Developers Summit 2017/2019 Interop Tokyo Conference 2018 Android Bazaar and Conference 2018a / 2017a / 2018s GDG DevFest Tokyo 2016
  3. 3. 7⽉にFlutterアプリ(iOS版)を出します Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌
  4. 4. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ Billing Library 2.0
  5. 5. n Pending Transactions n New Surface Interface(out-of-app subscriptions) n Acknowledge all purchases n Consistent Offers n Faster purchase experience n Revamped Developer Payload n Improved error codes for easier debugging n Predictable Releases & Support 主な変更点 Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌
  6. 6. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ https://www.youtube.com/watch?v=N4004Set4F8 ProfilePending Transactions n クレジットカード決済のよ うな即時取引完了となるフ ローとは異なる n いくつかのステップを踏む 遅延取引を実現 n 現⾦⽀払い(店舗⽀払)や 銀⾏振り込み n ⽇本とメキシコから開始 (っぽい) https://www.youtube.com/watch?v=N4004Set4F8
  7. 7. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ ProfilePending Transactions n 購⼊ボタンの代わりに⽀払 いコードが与えられる n 購⼊が承認されると、サー ビス側でアイテムの付与な どを⾏う https://www.youtube.com/watch?v=N4004Set4F8
  8. 8. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ ProfilePending Transactions 実装ステップ 1.アプリ起動時に PendingTransaction を有効化 var playStoreBillingClient = BillingClient .newBuilder(application.applicationContext) .enablePendingPurchases() .setListener(this).build()
  9. 9. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ ProfilePending Transactions 実装ステップ 2.購⼊状態の変化を PurchasesUpdatedListenerの onPurchasesUpdatedで観測 override fun onPurchasesUpdated( responseCode: Int, purchasesList: List<Purchase>?) { when (responseCode) { BillingClient.BillingResponse.OK -> { if (purchasesList == null) { // 購⼊情報なし } else { // PurchasesStateを確認 } } ・・・ }
  10. 10. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ ProfilePending Transactions 実装ステップ 3.PurchaseResultから Purchaseのインスタンスの PurchaseStateを確認 purchasesResult.forEach { purchase -> if (purchase.purchaseState == Purchase.PurchaseState.PURCHASED) { // 購⼊内容の確認 -> 購⼊商品の付与 } else if (purchase.purchaseState == Purchase.PurchaseState.PENDING) { // 遅延⽀払いが未完了 } }
  11. 11. https://www.youtube.com/watch?v=N4004Set4F8 Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ ProfileNew purcase surfaces n インストールとサブスクリ プションを同時に⾏う n つまりアプリ外でサブスク リプションを⾏う https://www.youtube.com/watch?v=N4004Set4F8
  12. 12. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ ProfileAcknowledge all purchases n すべての購⼊でアイテムが正しくユーザに 届けられたかをGoogle Playに知らせるた め、購⼊承認処理が必要になった n 購⼊が成功してから3⽇以内に知らせない 場合は購⼊が取り消しとなり、ユーザに返 ⾦される n Pending TransactionによるPENDING 状態の⽀払い状態のうちは3⽇間ルールは 適⽤されない n 消費アイテムについては消費 (consumeAsync())時に⾃動的に 処理される(ので考慮不要) TrivialDriveKotlin:BillingRepository.kt private fun acknowledgeNonConsumablePurchasesAsync( nonConsumables: List<Purchase>) { nonConsumables.forEach { purchase -> val params = AcknowledgePurchaseParams.newBuilder() .setPurchaseToken(purchase.purchaseToken) .build() playStoreBillingClient.acknowledgePurchase(params) { billingResult -> when (billingResult.responseCode) { BillingClient.BillingResponseCode.OK -> { disburseNonConsumableEntitlement(purchase) } else -> Log.d(LOG_TAG, "acknowledgeNonConsumablePurchasesAsync response is ${billingResult.debugMessage}") } } } }
  13. 13. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ ProfileConsistent Offers n 元の価格と割引前の価格を 得ることができ、ユーザに 割引を受けていることを提 ⽰できる n SkuDetailsに価格に関する 2つのメソッドが追加 • getOriginalPriceAmountMicros() 元の価格(フォーマット前) • getOriginalPrice() 特定の通貨でフォーマットされた元の価格 https://www.youtube.com/watch?v=N4004Set4F8 現在テスト中
  14. 14. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ ProfileFaster purchase experience n 購⼊画⾯のレンダリングを 最適化し、購⼊画⾯の表⽰ 速度が向上 https://www.youtube.com/watch?v=N4004Set4F8
  15. 15. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ ProfileRevamped Developer Payload n Billing Libraryで deprecatedだった Developer Payloadが刷新 n アプリ外購⼊を含めたすべて の購⼊に対応 n A/Bテスト識別⼦や購⼊検証 のための識別⼦を⼊れたりす るのが想定される https://www.youtube.com/watch?v=N4004Set4F8
  16. 16. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ ProfileRevamped Developer Payload n 今までのAIDLの購⼊フロー開 始時に指定する形とは異なる n 消費/承認時に指定する https://developer.android.com/google/play/billing/billing_library_overview // 消費 val consumeParams = ConsumeParams.newBuilder() .setPurchaseToken(/* token */) .setDeveloperPayload(/* payload */) .build() client.consumeAsync(consumeParams, listener) // 承認(Acknowledge) val acknowledgePurchaseParams = AcknowledgePurchaseParams.newBuilder() .setPurchaseToken(/* token */) .setDeveloperPayload(/* payload */) .build() client.acknowledgePurchase( acknowledgePurchaseParams, listener)
  17. 17. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ ProfileImproved error codes for easier debugging n エラーコードとエラーメッ セージを詳細化 https://www.youtube.com/watch?v=N4004Set4F8
  18. 18. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ ProfilePredictable Release & Support n Major Releaseを毎年の Google I/Oで公開 https://www.youtube.com/watch?v=N4004Set4F8 n Major Release毎に 2年間のサポート期間 n AIDL / BL1.x deprecated
  19. 19. Predictable Release & Support Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ https://www.youtube.com/watch?v=N4004Set4F8
  20. 20. Kotlin版はもうすぐ Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ https://www.youtube.com/watch?v=N4004Set4F8
  21. 21. n 購⼊フローの中にPENDING状態を作ることで アプリ外での課⾦⼿段を実現した n 課⾦完了まで、より⾮同期的になるため、サービス内で課⾦完了 承認(Acknowledge)する仕組みが必須化 n 様々な課⾦⼿段/タイミングができることでのトラブル防⽌の ために払い戻しの仕組みも⽤意 まとめ、というか所感 Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌
  22. 22. n Google Play Billing Library release notes https://developer.android.com/google/play/billing/billing_library_releases_notes n Use the Google Play Billing Library https://developer.android.com/google/play/billing/billing_library_overview n GitHub(android-play-billing) https://github.com/googlesamples/android-play-billing n Whatʻs New with Google Play Billing (Google I/Oʼ19) Youtube https://www.youtube.com/watch?v=N4004Set4F8 参考資料 Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌
  23. 23. Copyright (C) 2019 Namito.Satoyama. All Rights Reserved. 無断引⽤・転載禁⽌ Thanks︕

×