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

旅行アプリにおけるLive Activitiesを用いたフライト追跡

yoshikei
September 03, 2023

旅行アプリにおけるLive Activitiesを用いたフライト追跡

yoshikei

September 03, 2023
Tweet

More Decks by yoshikei

Other Decks in Programming

Transcript

  1. © 2023 Reiwa Travel, Inc. 2 | Keisuke Yoshida @y

    0 shikei_ 🏢 NEWT App Unit 🧑💻 / iOS NEWT NEWT iOS ...
  2. © 2023 Reiwa Travel, Inc. 1 . Live Activities |

    7 iOS 16 . 1 ActivityKit Framework https://developer.apple.com/documentation/activitykit
  3. © 2023 Reiwa Travel, Inc. 1 . Live Activities |

    9 Widget 🔐 Screen dimensions Lock Screen 430x932 408x84-160 393x852 371x84-160 っ 160pt View https://developer.apple.com/design/human-interface-guidelines/live-activities#iOS-Live-Activity-dimensions
  4. © 2023 Reiwa Travel, Inc. Expanded Dynamic Island 1 .

    Live Activities | 10 Dynamic Island 🏝 Screen dimensions Expanded 430x932 408x84-160 393x852 371x84-160 っ View https://developer.apple.com/design/human-interface-guidelines/live-activities#iOS-Live-Activity-dimensions
  5. © 2023 Reiwa Travel, Inc. Compact Live Activity 1 Dynamic

    Island 🏝 1 . Live Activities | 11 Screen dimensions Compact leading Compact trailing 430x932 62.33x36.67 62.33x36.67 393x852 52.33x36.67 52.33x36.67 っ Dynamic Island 2 View https://developer.apple.com/design/human-interface-guidelines/live-activities#iOS-Live-Activity-dimensions
  6. © 2023 Reiwa Travel, Inc. Minimal Live Activity Dynamic Island

    🏝 1 . Live Activities | 12 Screen dimensions Expanded 430x932 408x84-160 393x852 371x84-160 っ Activity detached ( ) Activity attached ( ) https://developer.apple.com/design/human-interface-guidelines/live-activities#iOS-Live-Activity-dimensions
  7. © 2023 Reiwa Travel, Inc. 1 . Live Activities |

    Push Activity 14 https://developer.apple.com/documentation/activitykit/activity/request(attributes:content:pushtype:)#discussion Live Activity 🚀 Activity
  8. © 2023 Reiwa Travel, Inc. 1 . Live Activities |

    15 https://developer.apple.com/documentation/activitykit/activity/update(_:) Live Activity ♻ 1 . App API 2 . BackgroundTasks ( ) 3. Push Backend App Push
  9. © 2023 Reiwa Travel, Inc. 1 . Live Activities |

    16 https://developer.apple.com/documentation/activitykit/updating-and-ending-your-live-activity-with-activitykit-push-notifications#Overview Push 🔔 Push Push Token Push Server Push Payload ( 4 KB ) Push Token Push Server
  10. © 2023 Reiwa Travel, Inc. 1 . Live Activities |

    17 📱 1 5 5 (6 ) 2 Push Dynamic Island 1 ( 築 )
  11. © 2023 Reiwa Travel, Inc. 1 . Live Activities |

    18 📱 LiveActivity 8 8 4 Dynamic Island
  12. © 2023 Reiwa Travel, Inc. 1 . Live Activities |

    19 https://developer.apple.com/documentation/activitykit/displaying-live-data-with-live-activities OS API ⛔ iOS 16 . 2 iOS 16 . 1 iOS 16 . 2 API 頻 Deprecated
  13. © 2023 Reiwa Travel, Inc. 2. | 22 Widget Extension

    📦 File > New > Target Widget Extension Live Activity
  14. © 2023 Reiwa Travel, Inc. 2. | 23 Widget Extension

    📦 Widget Extension Live Activity
  15. © 2023 Reiwa Travel, Inc. 2. | 24 Widget Extension

    📦 Include Live Activity Widget WidgetBundle LiveActivity Live Activity
  16. © 2023 Reiwa Travel, Inc. 2. | 25 Widget Extension

    📦 LiveActivity 🎉 Live Activity
  17. © 2023 Reiwa Travel, Inc. 2. | 26 Live Activity

    ✅ [ ] NSSupportsLiveActivities YES [ ] NSSupportsLiveActivitiesFrequentUpdates YES (iOS 16 . 2 +) App info.plist
  18. © 2023 Reiwa Travel, Inc. 2. | 29 Widget 🎯

    ActivityAttributes ContentState
  19. © 2023 Reiwa Travel, Inc. 2. | 30 Widget 🎯

    ActivityAttributes ⚠ ActivityAttributes App Target Membership App
  20. © 2023 Reiwa Travel, Inc. 2. | Live Activity 32

    Live Activity 🎨 View Widget
  21. © 2023 Reiwa Travel, Inc. 2. | Live Activity 33

    Live Activity 🎨 View Widget ActivityViewContext<Attribute> View
  22. © 2023 Reiwa Travel, Inc. 2. | Live Activity 34

    Live Activity 🎨 View Widget LiveActivityView Attributes Attributes context View context.state context.attributes
  23. © 2023 Reiwa Travel, Inc. 2. | Live Activity 35

    Live Activity 🎨 View Widget Dynamic Island ActivityViewContext<Attribute>
  24. © 2023 Reiwa Travel, Inc. 2. | Live Activity 36

    Live Activity 🎨 View Widget Dynamic Island
  25. © 2023 Reiwa Travel, Inc. 2. | Live Activity 37

    Live Activity 🎨 View Widget Expanded View View DynamicIslandExpandedRegion
  26. © 2023 Reiwa Travel, Inc. 2. | Live Activity 38

    Live Activity 🎨 View Widget Compact / Minimal View compactLeading Leading View compactTrailing Trailing View minimal Minimal View
  27. © 2023 Reiwa Travel, Inc. 2. | Live Activity 39

    Live Activity 🎨 View Widget Dynamic Island URL (DeepLink) https://developer.apple.com/documentation/WidgetKit/DynamicIsland/widgetURL(_:)
  28. © 2023 Reiwa Travel, Inc. 2. | Live Activity 41

    Live Activity request/update/end 🎮 Live Activity 3 https://developer.apple.com/documentation/activitykit/activity/update(_:alertconfiguration:) https://developer.apple.com/documentation/activitykit/activity/request(attributes:content:pushtype:) https://developer.apple.com/documentation/activitykit/activity/end(_:dismissalpolicy:)
  29. © 2023 Reiwa Travel, Inc. 2. | Live Activity 42

    Live Activity request 🚀 Live Activity
  30. © 2023 Reiwa Travel, Inc. 2. | Live Activity 43

    Live Activity request 🚀 Live Activity LiveActivity Live Activity
  31. © 2023 Reiwa Travel, Inc. 2. | Live Activity 44

    Live Activity request 🚀 Live Activity request LiveActivity
  32. © 2023 Reiwa Travel, Inc. 2. | Live Activity 45

    Live Activity request 🚀 Live Activity request っ attributes: Attributes ActivityAttributes
  33. © 2023 Reiwa Travel, Inc. 2. | Live Activity 46

    Live Activity request 🚀 Live Activity request っ state: State ActivityAttributes.ContentState っ staleDate: Date? Activity 築 っ relevanceScore: Double (= 0 . 0 ) Activity ( ) 築
  34. © 2023 Reiwa Travel, Inc. 2. | Live Activity 47

    Live Activity request 🚀 Live Activity request っ pushType: PushType? (= nil) Push Push .token
  35. © 2023 Reiwa Travel, Inc. 2. | Live Activity 48

    Live Activity update ♻ Live Activity
  36. © 2023 Reiwa Travel, Inc. 2. | Live Activity 49

    Live Activity update ♻ Live Activity LiveActivity update
  37. © 2023 Reiwa Travel, Inc. 2. | Live Activity 50

    Live Activity update ♻ Live Activity っ ActivityContent <Activity<Attributes>.ContentState> request state: State staleDate: Date? relevanceScore: Double Activity update
  38. © 2023 Reiwa Travel, Inc. 2. | Live Activity 51

    Live Activity update ♻ Live Activity っ alertConfiguration: AlertConfiguration? (= nil) Live Activity update
  39. © 2023 Reiwa Travel, Inc. 2. | Live Activity 52

    Live Activity end 🚫 Live Activity
  40. © 2023 Reiwa Travel, Inc. 2. | Live Activity 53

    Live Activity end 🚫 Live Activity end LiveActivity
  41. © 2023 Reiwa Travel, Inc. 2. | Live Activity 54

    Live Activity end 🚫 Live Activity end っ ActivityContent state: State staleDate: Date? relevanceScore: Double
  42. © 2023 Reiwa Travel, Inc. 2. | Live Activity 55

    Live Activity end 🚫 Live Activity end っ dismissalPolicy: ActivityUIDismissalPolicy (= .default) Live Activity default: (4 ) immediate: after(Date): ( 4 )
  43. © 2023 Reiwa Travel, Inc. 2. | Live Activity 56

    Push Live Activity 📨 Live Activity request pushToken request pushToken push server request
  44. © 2023 Reiwa Travel, Inc. 2. | Live Activity 57

    Push Live Activity 📨 Live Activity request pushToken pushToken JSON payload events: "update" / "end" content-state: Activity.ContentState https://developer.apple.com/documentation/activitykit/updating-and-ending-your-live-activity-with-activitykit-push-notifications#Construct-the-ActivityKit-push-notification-payload
  45. © 2023 Reiwa Travel, Inc. 2. | Live Activity 58

    Push Live Activity 📨 Live Activity request pushToken apns-push-type: liveactivity apns-topic: <bundle ID>.push-type.liveactivity authorization: bearer $AUTHENTICATION_TOKEN APNs https://developer.apple.com/documentation /usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns https://developer.apple.com/documentation/activitykit/updating-and-ending-your-live-activity-with-activitykit-push-notifications#Construct-the-ActivityKit-push-notification-payload
  46. © 2023 Reiwa Travel, Inc. 3. | 71 AeroAPI NEWT

    Backend Cloud Messaging NEWT App 🔰 Push FCM ... PushToken Push
  47. © 2023 Reiwa Travel, Inc. 3. | 72 AeroAPI NEWT

    Backend Cloud Messaging NEWT App 🔰 Push FCM ... 🙅 PushToken Push
  48. © 2023 Reiwa Travel, Inc. 1 . Live Activities |

    73 https://github.com/firebase/firebase-ios-sdk/issues/10047 FCM LiveActivity 🙅 Issue ...(2023 9 )
  49. © 2023 Reiwa Travel, Inc. 3. | 74 Customer Engagement

    Platform Braze SDK https://www.braze.com/docs/developer_guide/platform_integration_guides/swift/live_activities/live_activities/#example
  50. © 2023 Reiwa Travel, Inc. 3. | 75 AeroAPI NEWT

    Backend Braze SDK NEWT App 💫 Braze PushToken Push
  51. © 2023 Reiwa Travel, Inc. っ pushTokenTag: String Tag Tag

    (Backend ) 3. | Braze SDK 77 request Braze SDK 📦 Live Activity request launchActivity
  52. © 2023 Reiwa Travel, Inc. 3. | Braze SDK 78

    Braze Live Activity application(_: didFinishLaunchingWithOptions:) Braze SDK 📦 resumeActivities OK👌
  53. © 2023 Reiwa Travel, Inc. Braze Live Activity ♻ Backend

    POST API /message/live_activity/update 3. | Braze SDK 79 https://www.braze.com/docs/api/endpoints/messaging/live_activity/update/
  54. © 2023 Reiwa Travel, Inc. Braze Live Activity ♻ Backend

    POST API /message/live_activity/update 3. | Braze SDK 80 Example request
  55. © 2023 Reiwa Travel, Inc. Braze Live Activity ♻ Backend

    POST API /message/live_activity/update 3. | Braze SDK 81 Example request っ app_id: String Braze っ activity_id: String launchActivity pushTokenTag
  56. © 2023 Reiwa Travel, Inc. Braze Live Activity ♻ Backend

    POST API /message/live_activity/update 3. | Braze SDK 82 Example request っ content_state: Object ContentState ⚠
  57. © 2023 Reiwa Travel, Inc. Braze Live Activity ♻ Backend

    POST API /message/live_activity/update 3. | Braze SDK 83 Example request っ end_activity: Boolean true Live Activity (Optional)
  58. © 2023 Reiwa Travel, Inc. Braze Live Activity ♻ Backend

    POST API /message/live_activity/update 3. | Braze SDK 84 Example request っ dismissal_date: Datetime Live Activity UI 築 (Optional) っ stale_date: Datetime Activity 築 (Optional)
  59. © 2023 Reiwa Travel, Inc. Braze Live Activity ♻ Backend

    POST API /message/live_activity/update 3. | Braze SDK 85 Example request っ notification: Object Live Activity
  60. © 2023 Reiwa Travel, Inc. ⚠ 築 content_state UnixTime dismissal_date

    / stale_date ISO- 8 60 1 string content_state Apple Braze 3. | Braze SDK 87
  61. © 2023 Reiwa Travel, Inc. 92 1 . Live Activities

    Live Activity Live Activity 2. Braze SDK 3.