Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

Widget Suggestions 対応と
ヤフーの新OS対応

Widget Suggestions 対応と
ヤフーの新OS対応

ヤフー × LINE iOS Meetup
https://line.connpass.com/event/228428/
#iOS_meetup

Tatsuya Tanaka

November 02, 2021
Tweet

More Decks by Tatsuya Tanaka

Other Decks in Programming

Transcript

  1. ©︎ 2021 Yahoo Japan Corporation All rights reserved. Widget SuggestionsରԠͱ

    
 Ϡϑʔͷ৽OSରԠ Tatsuya Tanaka / ాத ୡ໵ Ϡϑʔ × LINE iOS Meetup #iOS_meetup
  2. ©︎ 2021 Yahoo Japan Corporation All rights reserved. ాத ୡ໵

    / ͨͳͨͭ • Ϡϑʔגࣜձࣾ ɹɾiOSΞϓϦͷԣஅత։ൃ΍ٕज़త՝୊ͷղܾ ɹɾiOSΞϓϦࠇଳ @tattn @tanakasan2525 @tattn ※ࠇଳ੍౓ͱ͸ɿ֤ྖҬʹ͓͍ͯಥग़ͨ͠ઐ໳ੑΛ࣋ͭࣾһΛࠇଳͱͯ͠೚໋͠ɺࣾ಺֎ʹ͓͚Δ׆ಈΛձࣾͱͯ͠ࢧԉ͢Δ੍౓
  3. ©︎ 2021 Yahoo Japan Corporation All rights reserved. γεςϜʹΑΔΞϓϦͷϨίϝϯυ Siri͔ΒͷఏҊͱͯ͠ΞϓϦͷػೳૌٻ͕Ͱ͖Δ

    ϩοΫը໘ͰͷSiri͔ΒͷఏҊ ΫΠοΫϝϞ (Quick Note) εϙοτϥΠτͰͷ 
 Siri͔ΒͷఏҊ
  4. ©︎ 2021 Yahoo Japan Corporation All rights reserved. ΢ΟδΣοτͱγεςϜͷ࿈ܞ Smart

    Rotate ಛఆͷ࣌ؒʹ 
 εϚʔτελοΫΛճసͤͯ͞ 
 ΢ΟδΣοτΛදࣔ͢Δ (iOS 14)
  5. ©︎ 2021 Yahoo Japan Corporation All rights reserved. ΢ΟδΣοτͱγεςϜͷ࿈ܞ Widget

    Suggestions εϚʔτελοΫʹ 
 ઃஔ͞Ε͍ͯͳ͍΢ΟδΣοτΛ 
 ͓͢͢Ίͱͯ͠Ծઃஔ͢Δ (iOS 15)
  6. ©︎ 2021 Yahoo Japan Corporation All rights reserved. ΢ΟδΣοτͱγεςϜͷ࿈ܞ Widget

    Suggestions (iOS 15) Smart Rotate (iOS 14) "EEJOUFMMJHFODFUPZPVSXJEHFUT88%$7JEFPT IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXED Apple͸͜ΕΒΛIntelligence (஌ੑ) ͱݺΜͰ͍Δ
  7. ©︎ 2021 Yahoo Japan Corporation All rights reserved. Widget Suggestions

    (΢ΟδΣοτͷఏҊ) εϚʔτελοΫʹઃஔ͞Ε͍ͯͳ͍΢ΟδΣοτΛ 
 ͓͢͢Ίͱͯ͠Ծઃஔ͢Δ ΢ΟδΣοτͷఏҊʹΑͬͯදࣔ͞Εͨ΢ΟδΣοτʹ͸ 
 ಛผͳϝχϡʔ͕௥Ճ͞ΕΔ
  8. ©︎ 2021 Yahoo Japan Corporation All rights reserved. Widget Suggestionsͷ࣮૷ํ๏

    ࣮૷ํ๏͸2ͭ ɾINRelevantShortcut 
 ɾINInteraction
  9. ©︎ 2021 Yahoo Japan Corporation All rights reserved. INInteraction Intent

    is eligible for Siri SuggestionsͷνΣοΫ͕ඞਢ
  10. ©︎ 2021 Yahoo Japan Corporation All rights reserved. INInteraction let

    intent = ConfigurationIntent() intent.ϓϩύςΟ = දࣔʹඞཁͳ஋Λઃఆ let interaction = INInteraction(intent: intent, response: nil) interaction.donate { error in } Ҏ্ɺͱͯ΋؆୯ʂ 
 γεςϜֶ͕शΛͯ͠ɺద੾ͳλΠϛϯάͰαδΣετͯ͘͠ΕΔ
  11. ©︎ 2021 Yahoo Japan Corporation All rights reserved. INInteraction ←ͷΑ͏ʹγϣʔτΧοτͷఏҊ΍

    
 Siri Watch FaceͳͲʹදࣔ͞ΕΔͷͰ஫ҙ 
 (ඞཁʹԠͯ͡ϧʔςΟϯάͷ࣮૷͕ඞཁ)
  12. ©︎ 2021 Yahoo Japan Corporation All rights reserved. INRelevantShortcut (IntentCon

    fi guration) let intent = ConfigurationIntent() intent.ϓϩύςΟ = දࣔʹඞཁͳ஋Λઃఆ let shortcut = INShortcut(intent: intent) let relevantShortcut = INRelevantShortcut(shortcut: shortcut) relevantShortcut.shortcutRole = .information relevantShortcut.widgetKind = "AwesomeWidget" // ର৅ͷ΢ΟδΣοτͷKindΛઃఆ͢Δ // ۭͷ഑ྻʹͨ͠৔߹͸ΞϓϦͷར༻ঢ়گ͔ΒγεςϜ͕Α͠ͳʹαδΣετλΠϛϯάΛܾΊΔ relevantShortcut.relevanceProviders = [ INDateRelevanceProvider(start: Date(), end: Date(timeIntervalSinceNow: 60 * 30)), ] INRelevantShortcutStore.default.setRelevantShortcuts([relevantShortcut]) { error in } ͲͷظؒʹαδΣετ͢Δ͔Λઃఆ͢Δ
  13. ©︎ 2021 Yahoo Japan Corporation All rights reserved. INRelevantShortcut (StaticCon

    fi guration) let activity = NSUserActivity(activityType: "sample.WidgetSuggestions.suggest") activity.title = "Widget suggestions app" let shortcut = INShortcut(userActivity: activity) let relevantShortcut = INRelevantShortcut(shortcut: shortcut) NSUserActivity͔ΒINShortcutΛͭ͘Δ
  14. ©︎ 2021 Yahoo Japan Corporation All rights reserved. INRelevanceProviderͷ੍໿ let

    relevantShortcut = INRelevantShortcut(shortcut: shortcut) relevantShortcut.relevanceProviders = [ INDateRelevanceProvider(start: Date(), end: Date(timeIntervalSinceNow: 60 * 30)), ] ↓ଞʹ΋ศརͦ͏ͳ΋ͷ͕ఏڙ͞Ε͍ͯ·͕͢ɺ 
 ͜ΕΒ͸WatchͷͨΊͷػೳͰɺ΢ΟδΣοτʹ͸࢖͑·ͤΜɻ 
 ΞϯυΩϡϝϯτͰWWDCͷηογϣϯͰͷΈݴٴ͞Ε͍ͯΔͷͰ஫ҙ͠·͠ΐ͏ INDailyRoutineRelevanceProvider(situation: .morning), INLocationRelevanceProvider(region: CLCircularRegion( center: CLLocationCoordinate2D(latitude: 35.652832, longitude: 139.839478), radius: 1000, identifier: "Tokyo, Japan") ) IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXED
  15. ©︎ 2021 Yahoo Japan Corporation All rights reserved. ࣾ಺WWDCใࠂձ ֤෼໺ͷઐ໳Ո΍

    
 ৽ػೳʹڵຯͷ͋ΔΤϯδχΞ͕ 
 ര଎Ͱࣾ಺ใࠂձΛ։࠵ 
 
 (σϞͳͲΛަ࣮͑ͨફతͳ಺༰) ࣌ؒ τϐοΫ ɹ 4XJGU$PODVSSFODZ ɹ 6*,JU ɹ 4XJGU6* ɹ 8JEHFU ɹ 4IBSF1MBZ ɹ 4BGBSJ&YUFOTJPO ɹ 9DPEF ɹ ௨஌ ɹ $PSF.-$SFBUF.- ɹ 7JTJPO ɹ ηΩϡϦςΟϩάΠϯ ɹ ϓϥΠόγʔ ɹ "QQ4UPSF ࠓ೥͸3࣌ؒʂʂ
  16. ©︎ 2021 Yahoo Japan Corporation All rights reserved. #ios15νϟϯωϧ /

    ԣஅ։ൃνʔϜ φϨοδ͕νʔϜͰด͡ͳ͍Α͏ʹ 
 #ios15νϟϯωϧͰࢼͨ͜͠ͱ΍٧·ͬͨ͜ͱͳͲԣల։ 
 
 ͞Βʹ৽ػೳͷ։ൃϦιʔεΛิ͏ͨΊɺ 
 ԣஅ։ൃνʔϜ͕αϯϓϧίʔυΛ࡞੒ͨ͠Γɺ 
 ϖΞϓϩͳͲͰ։ൃͷαϙʔτΛ͢Δମ੍
  17. ©︎ 2021 Yahoo Japan Corporation All rights reserved. ·ͱΊ ɾγεςϜͱͷ࿈ܞ͸େ੾Ͱ͢

    ɾWidget Suggestions͸ҙ֎ͱ؆୯ʹରԠͰ͖·͢ ɾͨͩ͠ɺϢʔβʔ͕ݟͨ͘ͳ͍৘ใ͸දࣔ͠ͳ͍౳ͷ 
 ɹɹΠϯΫϧʔγϒσβΠϯͷҙࣝ͸େࣄ