Slide 1

Slide 1 text

LiveActivities @y 0 shikei_ iOSDC Japan 20 2 3 Day 2 1 1 : 0 0 ~ Track A

Slide 2

Slide 2 text

© 2023 Reiwa Travel, Inc. 2 | Keisuke Yoshida @y 0 shikei_ 🏢 NEWT App Unit 🧑💻 / iOS NEWT NEWT iOS ...

Slide 3

Slide 3 text

AGENDA © 2023 Reiwa Travel, Inc. 3 1 .Live Activities 2 . 3 .

Slide 4

Slide 4 text

© 2023 Reiwa Travel, Inc. 1 . Live Activities

Slide 5

Slide 5 text

© 2023 Reiwa Travel, Inc. 1 . Live Activities

Slide 6

Slide 6 text

© 2023 Reiwa Travel, Inc. 1 . Live Activities | 6 Dynamic Island

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

© 2023 Reiwa Travel, Inc. 1 . Live Activities

Slide 9

Slide 9 text

© 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

Slide 10

Slide 10 text

© 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

Slide 11

Slide 11 text

© 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

Slide 12

Slide 12 text

© 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

Slide 13

Slide 13 text

© 2023 Reiwa Travel, Inc. 1 . Live Activities

Slide 14

Slide 14 text

© 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

Slide 15

Slide 15 text

© 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

Slide 16

Slide 16 text

© 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

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

© 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

Slide 20

Slide 20 text

© 2023 Reiwa Travel, Inc. 2. Live Activity Live Activity

Slide 21

Slide 21 text

© 2023 Reiwa Travel, Inc. 2. Live Activity Live Activity

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

© 2023 Reiwa Travel, Inc. 2. | 26 Live Activity ✅ [ ] NSSupportsLiveActivities YES [ ] NSSupportsLiveActivitiesFrequentUpdates YES (iOS 16 . 2 +) App info.plist

Slide 27

Slide 27 text

© 2023 Reiwa Travel, Inc. 2. | 27 Widget 🎯 ActivityAttributes

Slide 28

Slide 28 text

© 2023 Reiwa Travel, Inc. 2. | 28 Widget 🎯 ActivityAttributes

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

© 2023 Reiwa Travel, Inc. 2. | 30 Widget 🎯 ActivityAttributes ⚠ ActivityAttributes App Target Membership App

Slide 31

Slide 31 text

© 2023 Reiwa Travel, Inc. 2. Live Activity Live Activity

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

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

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

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

Slide 37

Slide 37 text

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

Slide 38

Slide 38 text

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

Slide 39

Slide 39 text

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

Slide 40

Slide 40 text

© 2023 Reiwa Travel, Inc. 2. Live Activity Live Activity

Slide 41

Slide 41 text

© 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:)

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

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

Slide 44

Slide 44 text

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

Slide 45

Slide 45 text

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

Slide 46

Slide 46 text

© 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 ( ) 築

Slide 47

Slide 47 text

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

Slide 48

Slide 48 text

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

Slide 49

Slide 49 text

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

Slide 50

Slide 50 text

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

Slide 51

Slide 51 text

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

Slide 52

Slide 52 text

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

Slide 53

Slide 53 text

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

Slide 54

Slide 54 text

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

Slide 55

Slide 55 text

© 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 )

Slide 56

Slide 56 text

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

Slide 57

Slide 57 text

© 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

Slide 58

Slide 58 text

© 2023 Reiwa Travel, Inc. 2. | Live Activity 58 Push Live Activity 📨 Live Activity request pushToken apns-push-type: liveactivity apns-topic: .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

Slide 59

Slide 59 text

© 2023 Reiwa Travel, Inc. 3. Braze SDK

Slide 60

Slide 60 text

© 2023 Reiwa Travel, Inc. ...

Slide 61

Slide 61 text

© 2023 Reiwa Travel, Inc. 61

Slide 62

Slide 62 text

© 2023 Reiwa Travel, Inc. 62 Mission

Slide 63

Slide 63 text

© 2023 Reiwa Travel, Inc. 63 2022 4 🔥

Slide 64

Slide 64 text

© 2023 Reiwa Travel, Inc. 64 UX

Slide 65

Slide 65 text

© 2023 Reiwa Travel, Inc. 65

Slide 66

Slide 66 text

© 2023 Reiwa Travel, Inc. Live Activity ...

Slide 67

Slide 67 text

© 2023 Reiwa Travel, Inc. 3. Braze SDK

Slide 68

Slide 68 text

© 2023 Reiwa Travel, Inc. 3. | 68 ✈

Slide 69

Slide 69 text

© 2023 Reiwa Travel, Inc. 3. Braze SDK

Slide 70

Slide 70 text

© 2023 Reiwa Travel, Inc. 3. | 70 FlightAware AeroAPI

Slide 71

Slide 71 text

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

Slide 72

Slide 72 text

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

Slide 73

Slide 73 text

© 2023 Reiwa Travel, Inc. 1 . Live Activities | 73 https://github.com/firebase/firebase-ios-sdk/issues/10047 FCM LiveActivity 🙅 Issue ...(2023 9 )

Slide 74

Slide 74 text

© 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

Slide 75

Slide 75 text

© 2023 Reiwa Travel, Inc. 3. | 75 AeroAPI NEWT Backend Braze SDK NEWT App 💫 Braze PushToken Push

Slide 76

Slide 76 text

© 2023 Reiwa Travel, Inc. 3. Braze SDK

Slide 77

Slide 77 text

© 2023 Reiwa Travel, Inc. っ pushTokenTag: String Tag Tag (Backend ) 3. | Braze SDK 77 request Braze SDK 📦 Live Activity request launchActivity

Slide 78

Slide 78 text

© 2023 Reiwa Travel, Inc. 3. | Braze SDK 78 Braze Live Activity application(_: didFinishLaunchingWithOptions:) Braze SDK 📦 resumeActivities OK👌

Slide 79

Slide 79 text

© 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/

Slide 80

Slide 80 text

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

Slide 81

Slide 81 text

© 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

Slide 82

Slide 82 text

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

Slide 83

Slide 83 text

© 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)

Slide 84

Slide 84 text

© 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)

Slide 85

Slide 85 text

© 2023 Reiwa Travel, Inc. Braze Live Activity ♻ Backend POST API /message/live_activity/update 3. | Braze SDK 85 Example request っ notification: Object Live Activity

Slide 86

Slide 86 text

© 2023 Reiwa Travel, Inc. ⚠ Push Notification Settings Debug Push 3. | Braze SDK 86

Slide 87

Slide 87 text

© 2023 Reiwa Travel, Inc. ⚠ 築 content_state UnixTime dismissal_date / stale_date ISO- 8 60 1 string content_state Apple Braze 3. | Braze SDK 87

Slide 88

Slide 88 text

© 2023 Reiwa Travel, Inc. 3. Braze SDK

Slide 89

Slide 89 text

© 2023 Reiwa Travel, Inc. 3. | 89 Live Activity 🎉

Slide 90

Slide 90 text

© 2023 Reiwa Travel, Inc. Appendix. | (PDF ) 90

Slide 91

Slide 91 text

© 2023 Reiwa Travel, Inc.

Slide 92

Slide 92 text

© 2023 Reiwa Travel, Inc. 92 1 . Live Activities Live Activity Live Activity 2. Braze SDK 3.

Slide 93

Slide 93 text

© 2023 Reiwa Travel, Inc. / NEWT iOS 🔥 https://www.reiwatravel.co.jp/recruit

Slide 94

Slide 94 text

© 2023 Reiwa Travel, Inc. https://potatotips.connpass.com/event/294378/