Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Androidアプリ内課金のテスト
Search
takuaraki
March 01, 2019
Technology
500
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Androidアプリ内課金のテスト
takuaraki
March 01, 2019
More Decks by takuaraki
See All by takuaraki
2021/02/03 発覚の COCOA Android版 不具合について
takuaraki
0
69
GASでSlackBot
takuaraki
1
580
Material Design Guideline: Dialogs, Dividers
takuaraki
0
450
Material Design Guideline: Bottom components
takuaraki
0
540
App Shortcuts
takuaraki
0
410
[関モバ#18] SQLBrite&SQLDelight
takuaraki
0
500
A/B testing GTM&GA vs Firebase
takuaraki
1
3k
【関モバ#12】Google Tag ManagerでモバイルアプリのABテストをする
takuaraki
1
690
Other Decks in Technology
See All in Technology
猫でもわかるKiro Web
kentapapa
1
140
営業オントロジーの作り方と、エージェントからの辿り方 ── ナレッジワークの現場から
kworkdev
PRO
1
170
【データ横丁主催】AI Agentがコンテキストを使って仕事をした後、何が残るのか― 組織の経験を次の判断に引き継ぐ「Agent Memory」
shisyu_gaku
2
160
VS Code × GitHub Copilot での Fabric 開発
ryomaru0825
1
110
Harness Engineering on Rails
joelq
0
700
メルカリにおけるAI時代の高速プロトタイピング基盤「Arca」
ryotarai
17
13k
Databricksメトリクスビューはじめてのもくもく会
taka_aki
0
110
Terraformを用いたJamf Pro構成のIaC, GitOps化への挑戦
yukun
0
110
AWS FinOps Agent 結局何が得意なの?
siromi
0
220
Snowflake Horizon Catalog と Apache Iceberg で作る オープンなデータ基盤
kitagawaz
0
270
「どのログを見ればいい?」 から始めた サーバーレス障害解析
y_waka1
1
160
Oracle Cloud Infrastructure(OCI):Onboarding Session(はじめてのOCI/Oracle Supportご利⽤ガイド)
oracle4engineer
PRO
3
21k
Featured
See All Featured
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
360
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Tell your own story through comics
letsgokoyo
1
1.1k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
700
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
310
Balancing Empowerment & Direction
lara
6
1.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
540
Transcript
ΞϓϦ՝ۚͷςετ 2019/03/01 @ara_tack
ʢߥʣ !BSB@UBDL '63:6$PSQPSBUJPO
͜ͷൃදʹ͍ͭͯ • Androidͷ՝ۚͷجૅ • ՝ۚͷಓͷΓ • ্ख͘՝͕ۚͰ͖ͳ͍ͱ͖ʁ • Play StoreΛΘͣʹಈ࡞֬ೝ
(billingx) • ৄࡉͳ՝ۚͷ࣮ʹ͍ͭͯ͞ͳ͍
AndroidΞϓϦ՝ۚ Google Play ΞϓϦͱΓऔΓ͍ͯ͠Δ (PPHMF1MBZ "QQ .Z"QQ 8SBQQFS 1MBZ#JMMJOH-JCSBSZ *O"QQ#JMMJOH"1*
ߪೖͰ͖Δͷछྨ • One-time products: 1ճ͚ͩߪೖͰ͖Δ • Subscriptions: ఆظߪೖ
One-time products • 1ճ͚ͩߪೖͰ͖Δ • ΞΠςϜػೳΛߪೖ͢Δͷʹ͍͍ͯΔ
Subscriptions • ఆظߪೖΞΠςϜ • Ұఆظؒ͝ͱʹࢧ͍͕ൃੜ͢Δ • ձһαʔϏεͳͲʹΘΕΔ
՝ۚͷಓͷΓ • Developerొ • ΞϓϦΛPlay ConsoleʹΞοϓϩʔυ͢Δ • Play ConsoleͰΞΠςϜͷొΛ͢Δ
Developerొ • GoogleΞΧϯτΛ༻ҙ͢Δ • $25͏ • Google Play Console͕͑ΔΑ͏ʹͳΔ
ΞϓϦΛPlay Consoleʹ্͛Δ • ϦϦʔεϏϧυͷΞϓϦ͕ඞཁ • ূ໌ॻϦϦʔε࣌ͷͷΛར༻ • Billingͷύʔϛογϣϯ͕ඞཁ • ެ։͕ඞཁʢΫϩʔζ൛ͰΑ͍ʣ
ΞϓϦΛPlay Consoleʹ্͛Δ ςετ༻ͷΞϓϦʹ͍ͭͯ • ΞϓϦέʔγϣϯIDূ໌ॻΛϦϦʔε༻ͱ ߹ΘͤΔ • ςετ༻ͷผΞϓϦͱͯ͠Play Consoleʹ͋ ͛ΔͷOK
ΞϓϦΛPlay Consoleʹ্͛Δ // flavorDimensionsলུ productFlavors { product { applicationId =
APPLICATION_ID_PRODUCT } billingTest { applicationId = APPLICATION_ID_PRODUCT } develop { applicationId = APPLICATION_ID_STAGING } } sourceSets { // resΛςετܥͷͷʹ͢Δ!ςετܥͷAPIΛ͑ΔΑ͏ʹ͢Δ billingTest.res.srcDirs = ["src/develop/res"] }
ͷొΛ͢Δ
ͷొΛ͢Δ • ID: มߋෆՄ • λΠτϧͱઆ໌จɿมߋՄೳ • Ձ֨ɿมߋՄೳ • ٻରظؒɿSubscriptionsͷΈɻมߋෆՄɻि
ؒɺ݄ผɺ3͔݄ɺ6͔݄ɺؒ • εςʔλεɿ༗ޮʹ͢ΔͱআͰ͖ͳ͘ͳΔ
None
ςετΞΧϯτ • Google Play ConsoleͰςετΞΧϯτ͕ొ Ͱ͖Δ • ςετΞΧϯτͰແྉͰ՝ۚͰ͖Δ • ࣮ࡍͷPlay
StoreͰͷߪೖͱѻ͍Ұॹɻߪೖ ใಉ͡ɻஈͱߪಡظ͚͕ؒͩҟͳΔɻ
ςετΞΧϯτ Subscriptions ͷߪಡظؒ https://developer.android.com/google/play/billing/billing_testing ΑΓҾ༻
ςετΞΧϯτ
্ख͘՝͕ۚͰ͖ͳ͍ͱ͖ʁ • ΞϓϦʹBillingͷύʔϛογϣϯ͕ͳ͍ • Play Consoleʹ্͕͍ͬͯͳ͍ • ΞϓϦͷূ໌ॻ͕Play Consoleʹ্͍͛ͯΔͷͱ ҟͳΔ
• ͕༗ޮʹͳ͍ͬͯͳ͍ • σϕϩούʔΞΧϯτͳͷͰ՝ۚͰ͖ͳ͍
Play StoreΛΘͣʹςετ Play StoreͷϞοΫϨεϙϯεΛఏڙ͢Δ ϥΠϒϥϦ • pixiteapps/billingx • NYTimes/Register
billingx • Play Billing LibraryΛϞοΫԽͰ͖Δ • DebugBillingClientΛBillingClientͱͯ͠͏
billingx ༻ྫʣBillingClientFactoryΛ࡞ͬͯDI͢Δ // BillingClient ͷϑΝΫτϦΛఆٛ interface BillingClientFactory { fun createBillingClient(activity:
Activity, updateListener: PurchasesUpdatedListener): BillingClient }
billingx ༻ྫʣBillingClientFactoryΛ࡞ͬͯDI͢Δ // ຊ൪༻ Play Billing Library ͷ BillingClient Λฦ͢
class ReleaseBillingClientFactory : BillingClientFactory { override fun createBillingClient(activity: Activity, updateListener: PurchasesUpdatedListener): BillingClient { return BillingClient .newBuilder(activity) .setListener(updateListener) .build() } }
billingx ༻ྫʣBillingClientFactoryΛ࡞ͬͯDI͢Δ // σόοά༻ DebugBillingClient Λฦ͢ class DebugBillingClientFactory : BillingClientFactory
{ override fun createBillingClient(activity: Activity, updateListener: PurchasesUpdatedListener): BillingClient { initializeData(activity) return DebugBillingClient(activity, updateListener) } } private fun initializeData(activity: Activity) { // ϞοΫσʔλΛ४උʢ࣍εϥΠυࢀরʣ }
billingx ༻ྫʣBillingClientFactoryΛ࡞ͬͯDI͢Δ private fun initializeData(activity: Activity) { BillingStore.defaultStore(activity) .clearProducts() .addProduct(
SkuDetailsBuilder( sku = BillingManager.SKU_SUBS, type = BillingClient.SkuType.SUBS, price = "$9.99", priceAmountMicros = 9990000, priceCurrencyCode = "USD", title = "Premium Access", description = "Get all the super cool features.", subscriptionPeriod = "p1m", freeTrialPeriod = "p1w" ).build() ) }
billingx ༻ྫʣBillingClientFactoryΛ࡞ͬͯDI͢Δ @Module class BillingClientFactoryModule { @Provides fun provideBillingClientFactory(): BillingClientFactory
{ return if (BuildConfig.DEBUG) { DebugBillingClientFactory() } else { ReleaseBillingClientFactory() } } }
·ͱΊ • ՝ۚͷͨΊʹPlay Consoleͷઃఆ͕ඞཁ • ՝ۚςετ࣌ʹϋϚΓϙΠϯτ͕ଟ͍ • Play Storeແ͠Ͱಈ࡞֬ೝ͢Δํ๏͋Δ