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

iOS Live Activity: Opportunities & Challenges

LINE Developers Taiwan
October 27, 2024
84

iOS Live Activity: Opportunities & Challenges

Speaker: QC Li
Event: MOPCON 2024

LINE Developers Taiwan

October 27, 2024
Tweet

More Decks by LINE Developers Taiwan

Transcript

  1. QC Li Senior iOS Developer 2020- : Sr. iOS Developer

    @ LINE (TW) 2018-20: iOS Developer @ Booking.com (NL) 2014-17: Sr. Mobile App Developer @ Yahoo (TW)
  2. 01 02 03 04 What is Live Activity? All variants

    of Live Activity UI presentations Challenges during implementing Live Activity Presentations Implementation LINE Shopping App’s experiences Case Study Live Activity CONTENT
  3. Live Activity • View the progress of events or tasks

    at a glance. • Always on Lock Screen, separated from other push notifications. • Can be created, updated without app alive. • No permission needed in advance.
  4. Supporting OS versions for Live Activity features OS Versions 18.0

    Apple Watch 16.1 17.0 17.2 Remote creation iPad Live Activity
  5. Devices that support Live Activity Devices 18.0 Apple Watch 16.1

    17.0 iPad iPhone Dynamic Island Lock Screen Smart Stack
  6. Limitations about Live Activity Restrictions Can NOT access location 8+4

    hrs. lifetime Can NOT access network At most 5 Live Activities on a device Payload 4KB
  7. Lifecycle Create Update End Create Update End Local Remote •

    Push Notification permission needed • PushToStartToken needed • iOS 17.2+ • Push Notification permission needed • PushToken needed • Push Notification permission needed • PushToken needed
  8. Dynamic Island • Dynamic island is supported on iPhone 14

    Pro/Pro Max, all iPhone 15 and 16 models • 3 UI presentations • Compact • Minimal • Expended Compact Minimal Expanded Minimal in Stand By Mode
  9. Content (Medium) • Support on all models of iPhone (iOS

    16.1+) and iPad (iOS 17+) • Lock Screen • Notification Center • Banner • For device doesn’t have dynamic island • Alert is set in config • Stand By (iOS 17+)
  10. Permission Request UI Note that there will be NO bottom

    corner radius when requesting permission of Live Activity System UI Live Activity UI
  11. Content (Small) • Apple Watch (iOS 18+) • Automatically support

    • Default style will be used if there is no customization • Smart Stack • Default Style • Dynamic island’s compact leading and trailing Leading Trailing App Name Default Style
  12. Recap Presentation\Place Dynamic Island Lock Screen Banner Stand By Smart

    Stack Dynamic Island (Compact) (default) Dynamic Island (Minimal) Dynamic Island (Expended) (alert) Content (Medium) (alert) Content (Small) (customized)
  13. Activity Attributes • Needs to be included by both host

    app and app extension Client ActivityAttributes.swift Host App App Extension (Widget)
  14. Define Live Activity UI • All presentations (content, dynamic island)

    should be defined Client Content Dynamic island Expanded Compact Minimal
  15. Activity Families • It’s not as simple as I thought

    • Activity families is only available for iOS 18.0+, but we should support old versions at the same time Client iOS 18+
  16. Activity Families • Provide 2 activity configurations could resolve this

    issue • Extract existing ActivityConfiguration as variable • Use if-else to check OS version Client iOS 18+
  17. Remote Operations • Start (iOS 17.2+), Update and End •

    Push Notification permission required • Key file (.p8) required • Call APNs API Server
  18. Remote Operations • $ACTIVITY_PUSH_TOKEN • Start (iOS 17.2+) • Push-to-start

    token, unique to device • Update, End • Push token, unique to Live Activity instance Server Client
  19. Issues we met during implementing Live Activity Challenges Existing push

    services doesn’t support it At most 5 Live Activities on a device Can NOT access network Token upload failed
  20. Live Activity can NOT access network Networking Assets needed can

    not be download from the Internet Pre-download in host app Share within App Group Prepare default assets Issue Solution
  21. Remote updating relies on push tokens Remote Updating Failure Push

    tokens upload fails It happens all the time Plan and Design in advance Issue Solution
  22. At most 5 Live Activities on a device. Live Activity

    Count Limitation Can NOT request new Live Activity if reaches the limit Check status when possible Manage it remotely and locally Issue Solution
  23. After releasing Live Activity feature 1.5x CVR% than other type

    of notifications Observations Clicks ++ Orders ++ GMV ++