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
firebase勉強会資料
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
gupuru
October 03, 2016
Programming
790
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
firebase勉強会資料
https://github.com/gupuru/firebase-hands-on
gupuru
October 03, 2016
More Decks by gupuru
See All by gupuru
fukuoka_kt_1
gupuru
0
110
ng-fukuoka-meetup-1
gupuru
0
440
AngularとAzureのCustom Vision Serviceを使って 画像認識サイトを作ってみた
gupuru
0
680
紙について少し詳しくなる10分間
gupuru
0
410
make bot, fun bot
gupuru
0
340
iOS and Android SVG
gupuru
0
380
Firebaseについて
gupuru
1
230
BLEを使って、すれ違い通信をやってみるよー
gupuru
0
2.3k
HiyokoDeveloperMeeting
gupuru
1
150
Other Decks in Programming
See All in Programming
AHC070解法紹介
eijirou
0
120
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.7k
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
340
新卒PdEのリアル
ryu1013
1
500
Are APIs Still Relevant in the AI Era?
soyuka
0
220
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
210
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
190
WebMCP Challenge に星空観察アプリで参加した話
okajun35
0
170
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
280
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
280
What We Talk About When We Talk About XP
m_seki
2
630
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
2.9k
Featured
See All Featured
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
460
Deep Space Network (abreviated)
tonyrice
0
310
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
540
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
520
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
330
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
660
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Balancing Empowerment & Direction
lara
6
1.3k
Everyday Curiosity
cassininazir
0
320
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
520
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Marketing to machines
jonoalderson
1
5.8k
Transcript
None
About me ৽ݟ ߊฏ גࣜձࣾηϑϦͱ͍͏ձࣾͰɺYAMAPͷAndroidΞϓϦΛ࡞͍ͬͯΔ iOSΤϯδχΞͰ͢ɻ ࠷ۙɺTensorFlow, Docker, Angular2ͳͲ͍ͬͯͯiOSશવ Ͱ͖ͯͳ͍ʢٽʣ
» Twitter: @gupuru » GitHub: gupuru
ηϑϦɺͲΜͳاۀ͔ͱݴ͏ͱ…͕ࣾݘͰ͢ʂ
FirebaseͬͯɺԿʁ
Firebase » mBaaS » ΞϓϦWeb։ൃʹඞཁͳػೳ͕ଟ͘ఏڙ͞Ε͍ͯΔ » Google͕ӡӦ͍ͯ͠ΔαʔϏε » 2011ελʔτ(2014ޙʹGoogle͕ങऩ) »
ແྉͰ͔ͭ͑Δͷ͕ଟ͍
None
None
͕࣌ؒڐ͢ݶΓɺհ͍ͯ͘͠Αʔ
Analytics
Analytics » ϞόΠϧΞϓϦʹಛԽͨ͠ Google ΞφϦςΟΫεΈ͍ͨͳͷ » Πϕϯτܕੳπʔϧ » ແྉ »
iOS, Android
iOSͷಋೖ pod 'Firebase/Core' import UIKit import Firebase @UIApplicationMain class AppDelegate:
UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { //Ճ FIRApp.configure() return true } }
Androidͷಋೖ compile 'com.google.firebase:firebase-core:9.6.1' public class MainActivity extends AppCompatActivity { private
final MainActivity self = this; private FirebaseAnalytics mFirebaseAnalytics; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mFirebaseAnalytics = FirebaseAnalytics.getInstance(this); } }
None
Cloud Messaging
Cloud Messaging » ϓογϡ௨ » iOS, Android, Web » ແྉ
» Notification MessageͱData Messageͷ̎छྨ
Notification Message { "to" : "HHwgIpoDKCIZvvDMExUdFQ3P1...", "notification" : { "body"
: "΅Ͱ͍", "title" : "͍ͨͱΔ", "icon" : "myicon" } } curl --header "Authorization: key=...guQidTc7xzs8" \ --header Content-Type:"application/json" \ https://fcm.googleapis.com/fcm/send \ -d "{\"to\": \"...ifS-oaJevN_VwU0Y\",\"priority\":\"high\",\"notification\": {\"title\": \"this is title\", \"body\": \"this is body\"}}"
Data Message { "to" : "xUdFQ3P1...", "data" : { "name"
: "fox", "body" : "neko", "Place" : "horaana" }, } curl --header "Authorization: key=...guQidTc7xzs8" \ --header Content-Type:"application/json" \ https://fcm.googleapis.com/fcm/send \ -d "{\"to\": \"...aJevN_VwU0Y\",\"priority\":\"high\",\"data\": {\"custom_title\": \"this is custom title\", \"custom_body\": \"this is custom body\", \"icon\": \"ic_stat_ic_notification\"}}"
Androidͷಋೖ compile 'com.google.firebase:firebase-messaging:9.6.1'
tokenऔಘ FirebaseInstanceId.getInstance().getToken();
௨ͷϋϯυϦϯά public class MyFirebaseMessagingService extends FirebaseMessagingService { public void onMessageReceived(RemoteMessage
remoteMessage) { Log.d(TAG, "From: " + remoteMessage.getFrom()); if (remoteMessage.getData() != null) { //data } if (remoteMessage.getNotification() != null) { //notification } } } <service android:name=".MyFirebaseMessagingService"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT"/> </intent-filter> </service>
Notifications
Notifications » ϓογϡ௨ » Webίϯιʔϧ͔Β͏(ίʔυΛॻ͘ඞཁͳ͠) » ແྉ » iOS, Android
None
Authentication
Authentication » ϩάΠϯपΓ » ϝΞυ, ಗ໊ΞΧϯτ, Google, Facebook, Twitter, GitHubͳͲʹରԠ
» ແྉ » FirebaseUIΛ͑ɺuiͳͲ؆୯ʹ࣮Ͱ͖Δ » iOS, Android, Web
None
Androidͷಋೖ(firebase UI) compile 'com.firebaseui:firebase-ui-auth:0.6.0' FirebaseAuth auth = FirebaseAuth.getInstance(); if (auth.getCurrentUser()
!= null) { //ϩάΠϯࡁΈ } else { startActivityForResult( AuthUI.getInstance().createSignInIntentBuilder().build(), RC_SIGN_IN); } protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == RC_SIGN_IN) { if (resultCode == RESULT_OK) { // ϩάΠϯޭ } } }
Webͷ߹ <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Firebase ui sample</title>
<!-- firebaseͷ͋ΕΛషͬͯ͜͜ʹ --> <script src="https://www.gstatic.com/firebasejs/ui/live/0.5/firebase-ui-auth.js"></script> <link type="text/css" rel="stylesheet" href="https://www.gstatic.com/firebasejs/ui/live/0.5/firebase-ui-auth.css" /> <script type="text/javascript"> // FirebaseUI config. var uiConfig = { 'signInSuccessUrl': 'ޭޙͷurl', 'signInOptions': [ firebase.auth.FacebookAuthProvider.PROVIDER_ID, firebase.auth.EmailAuthProvider.PROVIDER_ID ], }; var ui = new firebaseui.auth.AuthUI(firebase.auth()); ui.start('#firebaseui-auth-container', uiConfig); </script> </head> <body> <div id="firebaseui-auth-container"></div> </body> </html>
None
Realtime Database
Realtime Database » NoSQL JSON σʔλϕʔε » ϦΞϧλΠϜಉظ(ΦϑϥΠϯରԠ) » iOS,
Android, Web » ༗ྉ(ແྉ͋Γ)
iOSͷಋೖ pod 'Firebase/Database' import UIKit import Firebase @UIApplicationMain class AppDelegate:
UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { //Ճ FIRApp.configure() return true } }
import UIKit import FirebaseDatabase class ViewController: UIViewController { let rootRef
= FIRDatabase.database().reference() override func viewDidLoad() { super.viewDidLoad() //ಡΈࠐΈ rootRef.observe(.value, with: { snapshot in print("\(snapshot.key) -> \(snapshot.value)") }) //ॻ͖ࠐΈ rootRef.child("food").setValue("ΓΜ͝͞·") } }
None
Storage
Storage » ετϨʔδ(S3ʹ͍͔ۙ) » ը૾, ಈը, ԻͳͲͷμϯϩʔυ, Ξοϓϩʔυ » iOS,
Android, Web » ༗ྉ(ແྉ͋Γ)
iOSͷಋೖ pod 'Firebase/Storage' import UIKit import Firebase @UIApplicationMain class AppDelegate:
UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { //Ճ FIRApp.configure() return true } }
Ξοϓϩʔυ import FirebaseStorage class ViewController: UIViewController { let storage =
FIRStorage.storage() override func viewDidLoad() { super.viewDidLoad() let storageRef = storage.reference(forURL: "gs://fir-handson-ce2a8.appspot.com") if let data = UIImagePNGRepresentation(UIImage(named: "ie")!) { let riversRef = storageRef.child("images/ie.png") riversRef.put(data, metadata: nil, completion: { metaData, error in print(metaData) print(error) }) } } }
None
μϯϩʔυ import FirebaseStorage class ViewController: UIViewController { let storage =
FIRStorage.storage() override func viewDidLoad() { super.viewDidLoad() let storageRef = storage.reference(forURL: "gs://fir-handson-ce2a8.appspot.com") let ieRef = storageRef.child("images/hogehoge.png") ieRef.data(withMaxSize: 1 * 1024 * 1024) { (data, error) -> Void in if (error != nil) { print(error) } else { let image: UIImage! = UIImage(data: data!) } } } }
None
Hosting
Hosting » WebαΠτެ։ » HTTP/2, SSL » ༗ྉ(ແྉ͋Γ) » ಠࣗυϝΠϯՄೳ(ແྉ)
ಋೖ npm install -g firebase-tools ॳظԽ firebase init
None
ެ։ firebase deploy ֬ೝ firebase open
Crash Reporting
Crash Reporting » ΫϥογϡϨϙʔτ » ϕʔλ » ແྉ » iOS,
Android
Androidͷಋೖ compile 'com.google.firebase:firebase-crash:9.6.1'
None
Remote Config
Remote Config » ΫϥυͰϞόΠϧΞϓϦͷઃఆΛཧͰ͖ΔαʔϏε » iOS, Android » ແྉ
Androidͷಋೖ compile 'com.google.firebase:firebase-config:9.6.1'
σϑΥϧτͷઃఆ <?xml version="1.0" encoding="utf-8"?> <defaultsMap> <entry> <key>test</key> <value>ͯ͢</value> </entry> </defaultsMap>
FirebaseRemoteConfig remoteConfig; remoteConfig = FirebaseRemoteConfig.getInstansce(); //σϕϩούʔϞʔυࢦఆ FirebaseRemoteConfigSettings configSettings = new
FirebaseRemoteConfigSettings.Builder() .setDeveloperModeEnabled(BuildConfig.DEBUG) .build(); remoteConfig.setConfigSettings(configSettings); //σϑΥϧτͷΛಡΈࠐΉ remoteConfig.setDefaults(R.xml.remote_config_defaults); remoteConfig.fetch(43200) .addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { //Λө remoteConfig.activateFetched(); } else { //fetchࣦഊ } } });
None
App Indexing
App Indexing » ΣϒαΠτͱΞϓϦΛඥ͚Δ » ແྉ » iOS, Android
ɹσΟʔϓϦϯΫͷઃఆ(Andoirdͷ߹) <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.VIEW" /> <data android:scheme="https" android:host="fir-sample-51a1e.firebaseapp.com" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> </intent-filter> </activity>
ςετ adb shell am start -a android.intent.action.VIEW -d "url" com.example.hoe
Dynamic Links
Dynamic Links » ΞϓϦͷΠϯετʔϧଅਐ » ແྉ » iOS, Android
Androidͷಋೖ compile 'com.google.firebase:firebase-invites:9.6.1'
None
Invites
Invites » γΣΞػೳ » ແྉ » iOS, Android
Androidͷಋೖ compile 'com.google.firebase:firebase-invites:9.6.1' ※Dynamic Linksͷ༗ޮ͕ඞཁ
ট Intent intent = new AppInviteInvitation.IntentBuilder(getString(R.string.invitation_title)) .setMessage(getString(R.string.invitation_message)) .setDeepLink(Uri.parse(getString(R.string.invitation_deep_link))) .setCustomImage(Uri.parse(getString(R.string.invitation_custom_image))) .setCallToActionText(getString(R.string.invitation_cta))
.build(); startActivityForResult(intent, REQUEST_INVITE); ݁Ռ @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_INVITE) { if (resultCode == RESULT_OK) { String[] ids = AppInviteInvitation.getInvitationIds(resultCode, data); for (String id : ids) { Log.d(TAG, "onActivityResult: sent invitation " + id); } } } }
ड৴ @Override protected void onCreate(Bundle savedInstanceState) { mGoogleApiClient = new
GoogleApiClient.Builder(this) .addApi(AppInvite.API) .enableAutoManage(this, this) .build(); boolean autoLaunchDeepLink = true; AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, autoLaunchDeepLink) .setResultCallback( new ResultCallback<AppInviteInvitationResult>() { @Override public void onResult(AppInviteInvitationResult result) { if (result.getStatus().isSuccess()) { Intent intent = result.getInvitationIntent(); String deepLink = AppInviteReferral.getDeepLink(intent); String invitationId = AppInviteReferral.getInvitationId(intent); } } }); }
·ͱΊ
Firebaseศརͩͧ(ŋТŋ)b
࠷ޙʹݴ͍Εͨ͜ͱ͕...
ࣾͷ໊લɺϋφͪΌΜͰ͢ʢসʣ
͝ਗ਼ௌɺ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ