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

react-native-unimodulesを用いてのApp内課金実装

 react-native-unimodulesを用いてのApp内課金実装

react-native-unimodulesを用いてのApp内課金実装についてです

254ef4587f3c010fc0c52517ff5514c2?s=128

Yu Watanabe

March 04, 2021
Tweet

Transcript

  1. 2021/03/04 Θͨͳ΂Ώ͏ REACT-NATIVE-UNIMODULESΛ༻͍ͯͷ APP಺՝࣮ۚ૷

  2. ▸ ExpoΛ࢖͍ͬͯΔ ▸ APP಺՝ۚ(αϒεΫ)Λ࣮૷͠ͳ͍ͱ͍͚ͳ͍ਓ ຊεϥΠυͷλʔήοτ

  3. ▸ ࣗݾ঺հ ▸ APP಺՝ۚʹ͍ͭͯ ▸ expo-in-app-purchaseΛ༻͍ͯAPP಺՝ۚΛ࣮૷͢Δ ▸ ՝ۚεςʔλεͷ֬ೝʹ͍ͭͯ ▸ ΞϓϦΛ։͍ͨͱ͖ͳͲखಈͰ֬ೝΛ͢Δ

    ▸ webhookΛ༻͍ͯϢʔβଆͰεςʔλεมߋͨ͠ࡍʹ֬ೝ͢Δ ▸ ·ͱΊ ໨࣍
  4. ࣗݾ঺հ(1) Θͨͳ΂Ώ͏ ▸ ॴଐ ▸ גࣜձࣾg&h CTO ▸ Web /

    ΞϓϦΛझຯͰެ։ ▸ ࢓ࣄ಺༰ ▸ αʔό / ϑϩϯτ / ΞϓϦ / Web / શ෦ ▸ ΞΧ΢ϯτ ▸ Twitter : @hmktsu ▸ Github : @watanabeyu
  5. ࣗݾ঺հ(2) ▸ https://www.gandh.jp ▸ 6໊(ΤϯδχΞ͸1ਓ) ▸ ετϦʔτΧϧνϟʔ × ITͳμϯεαʔϏεΛӡӦ ▸

    https://dancewith.jp ▸ ετϦʔτμϯεͷΦϯϥΠϯϨοεϯΞϓϦ ▸ react-native + firebase + TypeScript + bitrise + NextJS ▸ prisma + GraphQL + Electron + ffmpeg ▸ TypeScriptͰ౷Ұͯ͠ۀ຿ޮ཰Խ ▸ εχʔΧʔؔ܎ͷΞϓϦͷཪଆͰճͯ͠ΔγεςϜ ▸ TypeScript + Node + puppeteer + firebaseͰ࡞੒ ▸ ΞϓϦ಺Ұ෦ػೳΛผΞϓϦͱͯ͠react-nativeͰ࡞੒த
  6. ຊ೔ͷςʔϚ react-native-unimodules(bare workflow)Λ༻͍ͯͷ APP಺՝࣮ۚ૷

  7. REACT-NATIVE-UNIMODULES(BARE WORKFLOW)Λ༻͍ͯͷAPP಺՝࣮ۚ૷ APP಺՝ۚʹ͍ͭͯ

  8. APP಺՝ۚʹ͍ͭͯ(1) ʙDANCE WITHʹ͓͚Δ࣮૷ʙ ▸ ੍ֹ݄ͷαϒεΫ(୯ൃ՝ۚ͸࣮૷͓ͯ͠Βͣ) ▸ DANCE WITH͸࠷ॳ͸iOS/Androidͱ΋ʹStripeʹ࣮ͯ૷ ▸ 2020೥8݄ʙ11݄຤·Ͱ͸OK͕ͩͬͨ12݄͔ΒϦδΣΫτ

    ߋ৽Ͱ͖ͳ͘ͳΔͷ͸ࠔΔͷͰ ͜ΕΛػʹApp಺՝ۚʹมߋ ͪͳΈʹStripeͷ࣮૷࣌1ൃ໨ͷ৹ࠪͰམͱ͞Ε͚ͨͲ ಈըετϦʔϛϯάͰແྉίϯςϯπ΋े෼͋Δ͔Β ͬͯ͜ͱͰ৹ࠪ௨͚ͬͨͲɺ12݄͔Β͸ͦΕͰ΋ԡ͠௨ͤͣ…
  9. APP಺՝ۚʹ͍ͭͯ(2) ʙREACT NATIVEʹ͓͚Δ࣮૷ʙ https://github.com/dooboolab/react-native-iap https://docs.expo.io/versions/latest/sdk/in-app-purchases/ DANCE WITHͰ͸ Bare WorkflowΛಋೖ͍ͯͨ͠ͷͰ expo-in-app-purchaseͰ࣮૷

  10. APP಺՝ۚʹ͍ͭͯ(3) ʙEXPO(MANAGED WORKFLOW)Ͱͷ࣮૷ʙ ▸ StripeͰαϒεΫ࣮૷Λͯ͠΋ޙ͔Β৹ࠪͰམͱ͞ΕΔՄೳੑ͕͋Δ ▸ NetflixΈ͍ͨʹձһొ࿥ͳͲશͯWebͰ΍Δʹ΋DXͱ͔࣮૷ίετ͕໰୊ʹͳΔ ▸ react-native-iap΋expo-in-app-purchase΋ExpoͰ͸࢖༻Ͱ͖ͣ(ཁeject) ▸

    ExpoΛeject͢ΔͱࣗಈͰBare WorkflowͱͳΔͷͰexpo-in-app-purchaseʹ͢Δͷ͕Α͍ ▸ ※ͪͳΈʹ྆ऀͱ΋Native෦෼Λ͍͡Δ͜ͱ͸ͳ͍ͷͰ࣮ࡍ͸ͲͪΒͰ΋ߏΘͳ͍ EjectΛ࣮ͯ͠૷͢Δඞཁ͕͋Δ
  11. REACT-NATIVE-UNIMODULES(BARE WORKFLOW)Λ༻͍ͯͷAPP಺՝࣮ۚ૷ expo-in-app-purchaseΛ༻͍ͯAPP಺՝ۚΛ࣮૷͢Δ

  12. EXPO-IN-APP-PURCHASEΛ༻͍ͯAPP಺՝ۚΛ࣮૷͢Δ(1)

  13. EXPO-IN-APP-PURCHASEΛ༻͍ͯAPP಺՝ۚΛ࣮૷͢Δ(2) ՝ۚϖʔδΛ։͍ͨͱ͖ͷॳظԽॲཧ

  14. EXPO-IN-APP-PURCHASEΛ༻͍ͯAPP಺՝ۚΛ࣮૷͢Δ(3) ߪೖ͕׬ྃͨ͠ࡍͷॲཧ + อଘ͢Δσʔλ

  15. EXPO-IN-APP-PURCHASEΛ༻͍ͯAPP಺՝ۚΛ࣮૷͢Δ(4) ՝ۚϞʔμϧΛग़ͨ͢Ίͷؔ਺

  16. REACT-NATIVE-UNIMODULES(BARE WORKFLOW)Λ༻͍ͯͷAPP಺՝࣮ۚ૷ ՝ۚεςʔλεͷ֬ೝ

  17. ՝ۚεςʔλεͷ֬ೝ(1) ʙΞϓϦ಺ʙ ▸ ΞϓϦ্ཱͪ͛࣌΍εςʔλε͕֬ೝͰ͖Δը໘ ▸ Homeը໘ͳͲແྉ/༗ྉͰग़͠Θ͚͕͞ΕΔը໘ͳͲ ▸ جຊతʹ͸ΞϓϦ্ཱ͚ͪ͛࣌ͩͰେৎ෉

  18. ՝ۚεςʔλεͷ֬ೝ(2) ʙΞϓϦ಺͔Β໰͍߹Θͤ͢Δίʔυʙ

  19. ՝ۚεςʔλεͷ֬ೝ(3) ʙWEBHOOKܦ༝Ͱͷεςʔλε֬ೝʙ ▸ ϢʔβଆͷαϒεΫղআ΍ϓϥϯมߋΛݕ஌ ▸ ΞϓϦ֎ͷڍಈ͕มΘΔͳΒ͹࣮૷͢Δඞཁ͋Γ ▸ ϓογϡ௨஌͕ແྉ/༗ྉͰมΘΔ ▸ WebΞϓϦͷํʹ΋൓өͤ͞Δඞཁ͕͋ΔͳͲ

    ▸ ΞϓϦ಺ͷڍಈ͕มΘΔ͙Β͍͔͠ͳ͍ͷͰ͋Ε͹ඞཁ ͳ͍
  20. ՝ۚεςʔλεͷ֬ೝ(4) ʙWEBHOOKͰΞοϓσʔτ͢Δίʔυʙ

  21. REACT-NATIVE-UNIMODULES(BARE WORKFLOW)Λ༻͍ͯͷAPP಺՝࣮ۚ૷ ·ͱΊ

  22. ·ͱΊ ▸ ExpoΛ࢖͍ͬͯͯAPP಺՝ۚΛ͍ͨ͠ͳΒ͹Bare workflowʹ͢Δ ▸ StripeͰڐ͞ΕΔύλʔϯ΋͋Δ͚Ͳ΋جຊతʹ͸ڐ͞Εͳ͍ͱࢥ͏΂͖ ▸ ՝ۚͷॲཧ͸ωΠςΟϒ͍͡Βͳ͍͠ҙ֎ͱ؆୯ ▸ αϒεΫͷ՝ۚεςʔλεΛ֬ೝ͢Δͷ͸ҎԼͷ2ͭ

    ▸ ΞϓϦΛ։͍ͨͱ͖΍ɺϢʔβεςʔλεΛ֬ೝ͢ΔͳͲͳͲ ▸ webhookͰϢʔβଆͷαϒεΫղ໿ͳͲΛݕ஌ αϒεΫΛ࡞Γ͍ͨͷͰ͋Ε͹ආ͚ͯ͸௨Εͳ͍ͷͰ ࢥ͍੾ͬͯeject࣮ͯ͠૷͠·͠ΐ͏
  23. ͓ΘΓ