Slide 1

Slide 1 text

Introducing Firebase Analytics to an Existing Project @ikesyo ؔ੢ϞόΠϧΞϓϦݚڀձ #15, 2016-06-22 Wed #ؔϞό

Slide 2

Slide 2 text

@ikesyo • ͍͚͠ΐʔʗ஑ా ᠳ • ͸ͯͳ@ژ౎ • https://twitter.com/ikesyo • https://github.com/ikesyo

Slide 3

Slide 3 text

✨ Contributions ✨ • ReactiveCocoa • Carthage (Commandant, ReactiveTask) • Result • Himotoki • 2.1.0 is released today with Swift 2.3/Xcode 8 compatibility ✨ • APIKit

Slide 4

Slide 4 text

Firebase

Slide 5

Slide 5 text

Products • Analytics • Auth • Database • Hosting • Remote Config • Test Lab • Crash • Notifications • Dynamic Links • AdMob • ...

Slide 6

Slide 6 text

Firebase Analytics with Google TagManager

Slide 7

Slide 7 text

Getting Started • Get Started with Firebase Analytics for iOS | Firebase • Tag Manager + Firebase: Getting Started | Google Tag Manager for iOS | Google Developers

Slide 8

Slide 8 text

Firebase Analytics • GoogleTagManager v5͸ FirebaseAnalytics ʹґଘ͢ΔΑ ͏ʹ import FirebaseAnalytics ... // Previously: // TAGManager.instance().dataLayer.push(["event": "eventName", "foo": "bar"]) // This sends the event to Google TagManager too. FIRAnalytics.logEventWithName("eventName", parameters: ["foor": "bar"])

Slide 9

Slide 9 text

Google TagManagerͷηοτΞοϓ

Slide 10

Slide 10 text

Google TagManagerͷηοτΞοϓ • ৽͍͠ίϯςφͷ༻ҙ • طଘͷίϯςφʢैདྷ൛ʣ͸FirebaseͰ͸࢖͑ͳ͍ • λάɺτϦΨʔɺม਺Λ࠶౓௥Ճ • ैདྷ൛ίϯςφͰΤΫεϙʔτͨ͠JSONϑΝΠϧ͸Firebase൛ίϯςφͰΠϯϙʔτ Ͱ͖ͳ͍ • ઃఆϑΝΠϧͷஔ͖׵͑ • όΠφϦ͔ΒJSONʹϑΥʔϚοτ͕มߋ • λʔήοτʹcontainerͱ͍͏folder referenceΛ௥Ճ͠ɺͦͷϑΥϧμ௚ԼʹJSON ϑΝΠϧΛઃஔ

Slide 11

Slide 11 text

Firebase AnalyticsͷηοτΞοϓ

Slide 12

Slide 12 text

Firebase AnalyticsͷηοτΞοϓ • https://console.firebase.google.com ͔Β • “৽نϓϩδΣΫτΛ࡞੒” • “GoogleϓϩδΣΫτΛΠϯϙʔτ” • Google Sign-InΛར༻͍ͯ͠ΔϓϩδΣΫτͰ͋Ε͹ޙऀΛબͿ • طଘͷOAuth 2.0 ΫϥΠΞϯτIDΛҾ͖ܧ͛Δ • ΫϥΠΞϯτIDʹొ࿥ࡁΈͷόϯυϧIDͰFirebaseϓϩδΣΫτʹࣗಈతʹϞόΠϧΞϓϦ͕௥Ճ͞Ε Δ • ಉҰΞϓϦͷAndroid൛͕͋Ε͹ɺ༧ΊΫϥΠΞϯτIDΛҠ؅ͯ͠GoogleϓϩδΣΫτΛ1ͭʹ·ͱΊ͓ͯ ͘ͷΛ͓͢͢Ί • Firebaseίϯιʔϧͷ֘౰ϞόΠϧΞϓϦ͔ΒGoogleService-Info.plistΛμ΢ϯϩʔυ͠ɺϓϩδΣΫτ ʹ௥ՃʢطଘϑΝΠϧͷஔ͖׵͑ʣ

Slide 13

Slide 13 text

Firebase AnalyticsͷηοτΞοϓ // AppDelegate.swift import UIKit import FirebaseAnalytics class AppDelegate: UIResponder, UIApplicationDelegate { func application(application: UIApplication, didFinishLaunchingWithOptions... { // No more TAGContainerOpener.openContainerWithId( // _:tagManager:openType:timeout:notifier: // ) FIRApp.configure() return true } }

Slide 14

Slide 14 text

Within App Extensions • ॳظԽϙΠϯτ: ΤϯτϦʔϙΠϯτͷVCͷviewDidLoad() • ෳ਺ճͷExtensionͷىಈͰಉҰϓϩηε͕࢖༻͞Ε͏ΔͨΊ FIRApp.configure()Λෳ਺ճݺ͹ͳ͍Α͏ʹ஫ҙ͢Δ • Today Extension: ϝϞϦෆ଍ͰFIRApp.configure()ΛݺͿ͚ͩͰΫϥογϡ͢Δ ! func viewDidLoad() { super.viewDidLoad() if FIRApp.defaultApp() == nil { FIRApp.configure() } }

Slide 15

Slide 15 text

!" Happy Firebase!! "!

Slide 16

Slide 16 text

Thank you❗"