FirebaseでPush通知を送る

73e80d16abc7cc65e08d430c2eae811b?s=47 taminif
October 02, 2016

 FirebaseでPush通知を送る

73e80d16abc7cc65e08d430c2eae811b?s=128

taminif

October 02, 2016
Tweet

Transcript

  1. FirebaseͰPush௨஌ ΛૹΔ ؔ੢ϞόΠϧΞϓϦݚڀձ #18 2016/09/28 େౡ ޫو

  2. ࣗݾ঺հ • ΢ΣϒϦΦגࣜձࣾ • WEBΤϯδχΞ • ΞϓϦΤϯδχΞ
 ʢࣗশʣ • 8݄ʹΞϓϦΛ


    ϦϦʔε͠·ͨ͠ʂ
  3. Firebaseͱ͸

  4. Firebaseͱ͸ • Google͕ఏڙ͢ΔmBaas • Analytics, Database, Notifications etc • ࠓ೥6݄ʹGoogleαʔϏεͱ౷߹

    • ແྉʂʂ
  5. ຊ೔͸ͦͷதͰ΋ɺ Firebase NotificationsΛ

  6. Firebase Notifications • GUI(ίϯιʔϧ)ͰPush௨஌͕ૹΕΔ • ؆қతͳϝοηʔδ͔͠ૹΕͳ͍ • த਎͸FCM
 (Firebase Cloud

    Messaging)
  7. ඞཁͳ΋ͷ

  8. 1. Firebase Project

  9. Firebase Project • GoogleΞΧ΢ϯτͰFirebase ConsoleʹϩάΠϯ • ϓϩδΣΫτΛ࡞੒ • ΋͘͠͸ɺGoogleϓϩδΣΫτ͔ΒΠϯϙʔτ •

    ίϯιʔϧ಺ͰGoogleService-Info.plistΛμ΢ϯ ϩʔυ͠ɺXcodeϓϩδΣΫτʹஔ͘
  10. 2. APNs

  11. APNs • Apple Push Notification service Certificates • Apple Developer͔Βμ΢ϯϩʔυՄೳ

    • Push NotificationΛONʹͨ͠΋ͷ • FirebaseެࣜͷGUIDES͕ࢀߟʹͳΓ·͢
  12. 3. Firebase Messaging SDK

  13. Firebase Messaging SDK • CocoaPodsͰΠϯετʔϧՄೳ • Firebase/Core • Firebase/Messaging •

    AppDelegate.swiftͰfirebaseΛimport͠ɺ
 ConfigureΛηοτ
 -> ࣍ͷϖʔδ
  14. Source Code(Swift3) func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?)

    -> Bool { // Override point for customization after application launch. // Use Firebase library to configure APIs FIRApp.configure() return true }
  15. Push௨஌ͷ࣮ߦ

  16. ίϯιʔϧ͔Β ௨஌ʹදࣔ͢Δϝοηʔδ Ұཡʹදࣔ͢Δϥϕϧ ૹ৴λΠϛϯά ૹ৴ର৅

  17. ·ͱΊ

  18. ·ͱΊ • ͍͔ͭ͘༻ҙ͢Δ΋ͷ͸͋Δ͕؆୯ʹPush௨஌͕
 ࢖༻Ͱ͖Δɻ • ແྉʂʂ • iOS10Ͱ࣮૷͞ΕͨΧελϚΠζͰ͖Δ௨஌͸࣍ճ Ҏ߱ɾɾɾ

  19. ͋Γ͕ͱ͏͍͟͝·ͨ͠