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
Native Moduleの作り方 / Creating Native Module in R...
Search
Tatsuya Kitagawa
February 26, 2020
Programming
790
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Native Moduleの作り方 / Creating Native Module in React Native
https://ducklings.connpass.com/event/164844/
の発表資料です。
Tatsuya Kitagawa
February 26, 2020
More Decks by Tatsuya Kitagawa
See All by Tatsuya Kitagawa
LiveData with RxJava2
yatatsu
0
800
Other Decks in Programming
See All in Programming
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
470
WebMCP Challenge に星空観察アプリで参加した話
okajun35
0
190
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
120
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
510
Java 27新機能 / Java 27 new features
kishida
2
170
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
220
Webの地図
yosuke_furukawa
PRO
6
4.7k
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
130
Are APIs Still Relevant in the AI Era?
soyuka
0
300
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
270
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
150
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.9k
Featured
See All Featured
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.8k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
550
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.6k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
500
Optimising Largest Contentful Paint
csswizardry
37
4k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
340
Joys of Absence: A Defence of Solitary Play
codingconduct
1
530
Faster Mobile Websites
deanohume
310
32k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
Transcript
Native Module ͷ࡞Γํ React Native Tech Blog meetup#1 2020-02-26
About me? • ୡʢTatsuya KITAGAWAʣ • PAY.JP • https:#//github.com/yatatsu
• https:#//twitter.com/tatsuyakit
About PAY.JP • https:#//pay.jp/ • γϯϓϧͰΘ͔Γ͍͢APIΛఏڙ͢ΔܾࡁαʔϏε • ڝ߹ͷαʔϏεͱͯ͠StripeͳͲ͕͋Γ·͢ • React
Native͚ͷSDKϓϥάΠϯΛެ։͠·ͨ͠ http:#//payjp-announce.hatenablog.com/entry/2020/02/14/113211
Native Modules? (1/2) • ඪ४Ͱଟ͘ͷωΠςΟϒͷػೳ͕ར༻Ͱ͖Δ • Alert.alert(…)ͰΞϥʔτ͕දࣔ͞ΕΔͱ͔ • ඪ४Ͱ༻ҙ͞Ε͍ͯͳ͍ωΠςΟϒͷػೳΛར༻͍ͨ͠ •
ಉ͡Α͏ʹJS͔Βར༻Ͱ͖ΔΑ͏ʹ͢ΔΈ
Native Modules? (2/2) • react-native-community/react-native-webview • react-native-community/react-native-maps • ϥΠϒϥϦͱͯ͠ఏڙ͞Ε͍ͯΔͷ͕ଟ •
͜ΕΒΛ࡞ΔଆͷΛ͠·͢
CLI tools (1/3) • brodybits/create-react-native-module • react-native-community/bob • frostney/react-native-create-library •
peggyrayzis/react-native-create-bridge
CLI tools (2/3) • ެࣜυΩϡϝϯτͰcreate-react-native-module • “To get set up
with the basic project structure for a native module we will use a third party tool create-react-native-module” • ͓͢͢Ί࠷খݶͷߏ͕΄͍͠ͳΒ "-> create-react-native-module • LinterFormatterͳͲͷॳظઃఆ·Ͱ͓·͔ͤ "-> react-native-community/bob
CLI tools (3/3) • `npx create-react-native-module MyLibrary` • ϓϩδΣΫτͷܗ͕࡞͞ΕΔ
react-native-my-library/ "## README.md "## android $ "## README.md $ "##
build.gradle $ &## src $ &## main $ "## AndroidManifest.xml $ &## java $ &## com $ &## reactlibrary $ "## MyLibraryModule.java $ &## MyLibraryPackage.java "## index.js "## ios $ "## MyLibrary.h $ "## MyLibrary.m $ "## MyLibrary.xcodeproj $ $ &## project.pbxproj $ &## MyLibrary.xcworkspace $ &## contents.xcworkspacedata "## package.json &## react-native-my-library.podspec
Auto Linking (1/2) • RN 0.60ΑΓಋೖ͞ΕͨAutoLinking • `react-native config`ͰಘΒΕΔ ϓϩδΣΫτͷϝλใΛར༻ͯ͠Link͢Δ
• https:#//github.com/react-native-community/ cli/blob/master/docs/autolinking.md
Auto Linking (2/2) • σΟϨΫτϦߏσϑΥϧτͷconfigʹҰக • *.podspec͕ϓϩδΣΫτԼʹ͋Δ etc. • มߋ͢Δ߹
react-native.config.js ΛՃ
react-native.config.js const path = require('path'); module.exports = { dependency: {
platforms: { ios: { podspecPath: path.join(#__dirname, 'ios', 'my.podspec') } } } };
tips:1 Xcode (1/4) • iOSωΠςΟϒͷ։ൃ͢Δͱ͖Xcode͕ศར • ͔͠͠ϥΠϒϥϦͷϓϩδΣΫτΛͦͷ··ಡΈࠐΉͱ…
tips:1 Xcode (2/4) • iOSωΠςΟϒͷ։ൃ͢Δͱ͖Xcode͕ศར • ͔͠͠ϥΠϒϥϦͷϓϩδΣΫτΛͦͷ··ಡΈࠐΉͱ…
tips:1 Xcode (3/4) • example/ios/example.xcworkspace Λ։͘ ʢpod install͔ͯ͠Βʣ
tips:1 Android Studio (4/4) • example/android/build.gradle Λ։͘
tips:2 Sync modules (1/2) • ios/ android/ Λมߋͯ͠ • ಈ࡞֬ೝexampleҎԼͰ͓͜ͳ͏
• ຖճ yarn install ͢͠ͷ͕͔͔࣌ؒΔ
tips:2 Sync modules (2/2) "scripts": { "dev-sync": "cp -r *podspec
android ios example/ node_modules/react-native-my-library/“ }, • ରͷίʔυ͚ͩࠩ͠ସ͑Δ • react-native-community/react-native-share
·ͱΊ • Native ModuleΛ։ൃ͢ΔࡍCLIπʔϧ͕ศར • XcodeAndroid StudioͰ։ൃ͢Δ • ࡉ͔͍։ൃͷTipsଞͷOSS͕ࢀߟʹͳΔ •
ಛʹ react-native-community ͕๛
Blog • Native Moduleͷ࡞Γํ - React Native Tech Blog https:#//tech.maricuru.com/entry/2020/02/20/052054