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

徹底解説!Communication Notification / How to handle Communication Notification.

徹底解説!Communication Notification / How to handle Communication Notification.

徹底解説!!Communication Notification!!

まつじ (松本淳之介)/LINE株式会社 iOS/Android エクスペリエンスチーム
奈良出身。20卒の新卒としてLINEに入社。Early Bird TFなどiOS特有の機能を取り入れるチームでLINE iOSの開発を担当。業務の前後に行っている個人開発ではAppStore無料総合ランキング1位を (一瞬) 記録。その時の2位はLINE。趣味は囲碁で囲碁友達募集中。

※この資料は以下のイベントで発表した内容です。
https://line.connpass.com/event/228428/

LINE Developers

November 02, 2021
Tweet

More Decks by LINE Developers

Other Decks in Technology

Transcript

  1. */1FSTPOͷ४උ let sender = INPerson( personHandle: .init(value: "[email protected]", type: .emailAddress),

    nameComponents: nil, displayName: "まつじ", image: image, contactIdentifier: nil, customIdentifier: "xxxxxxxx", isContactSuggestion: false, suggestionType: .socialProfile )
  2. */1FSTPOͷ४උ let sender = INPerson( personHandle: .init(value: "[email protected]", type: .emailAddress),

    nameComponents: nil, displayName: "まつじ", image: image, contactIdentifier: nil, customIdentifier: "xxxxxxxx", isContactSuggestion: false, suggestionType: .socialProfile ) 4JSJ͕ೝࣝͰ͖Δࣝผࢠ Ϣʔβʔ͔Βݟ͑ΔͷͰ஫ҙ • ి࿩൪߸ • ϝʔϧΞυϨε • ͦͷଞ
  3. */1FSTPOͷ४උ let sender = INPerson( personHandle: .init(value: "[email protected]", type: .emailAddress),

    nameComponents: nil, displayName: "まつじ", image: image, contactIdentifier: nil, customIdentifier: "xxxxxxxx", isContactSuggestion: false, suggestionType: .socialProfile ) ௨஌ͷλΠτϧʹදࣔ͞ΕΔૹ৴ऀ໊
  4. */1FSTPOͷ४උ let sender = INPerson( personHandle: .init(value: "[email protected]", type: .emailAddress),

    nameComponents: nil, displayName: "まつじ", image: image, contactIdentifier: nil, customIdentifier: "xxxxxxxx", isContactSuggestion: false, suggestionType: .socialProfile ) ૹ৴ऀͷΞΠίϯ
  5. */1FSTPOͷ४උ let sender = INPerson( personHandle: .init(value: "[email protected]", type: .emailAddress),

    nameComponents: nil, displayName: "まつじ", image: image, contactIdentifier: nil, customIdentifier: "xxxxxxxx", isContactSuggestion: false, suggestionType: .socialProfile ) ΞϓϦଆͰॲཧͰ͖Δࣝผࢠ
  6. */4FOE.FTTBHF*OUFOUͷ४උ let intent = INSendMessageIntent( recipients: nil, outgoingMessageType: .outgoingMessageText, content:

    "通知の内容", speakableGroupName: nil, conversationIdentifier: "xxxxx", serviceName: nil, sender: sender, attachments: nil )
  7. */4FOE.FTTBHF*OUFOUͷ४උ let intent = INSendMessageIntent( recipients: nil, outgoingMessageType: .outgoingMessageText, content:

    "通知の内容", speakableGroupName: nil, conversationIdentifier: "xxxxx", serviceName: nil, sender: sender, attachments: nil ) ͖ͬ͞༻ҙͨ͠*/1FSTPO
  8. */4FOE.FTTBHF*OUFOUͷ४උ let intent = INSendMessageIntent( recipients: nil, outgoingMessageType: .outgoingMessageText, content:

    "通知の内容", speakableGroupName: nil, conversationIdentifier: "xxxxx", serviceName: nil, sender: sender, attachments: nil ) ௨஌ͷຊจʹදࣔ͞ΕΔ಺༰
  9. */4FOE.FTTBHF*OUFOUΛ࢖ͬͯ௨஌Λߋ৽ var content: UNNotificationContent = UNMutableNotificationContent() let updatedContent = try!

    content.updating(from: intent) // notification service extension contentHandler(updatedcontent) // local notification let request = UNNotificationRequest( identifier: UUID().uuidString, content: updatedcontent, trigger: nil ) UNUserNotificationCenter.current().add(request)
  10. (SPVQ$PNNVOJDBUJPO/PUJGJDBUJPO let intent = INSendMessageIntent( recipients: nil, outgoingMessageType: .outgoingMessageText, content:

    "通知の内容", speakableGroupName: INSpeakableString(spokenPhrase: "グループ名"), conversationIdentifier: "xxxxx", serviceName: nil, sender: sender, attachments: nil ) intent.setImage(groupImage, forParameterNamed: ¥.speakableGroupName)
  11. (SPVQ$PNNVOJDBUJPO/PUJGJDBUJPO let intent = INSendMessageIntent( recipients: nil, outgoingMessageType: .outgoingMessageText, content:

    "通知の内容", speakableGroupName: INSpeakableString(spokenPhrase: "グループ名"), conversationIdentifier: "xxxxx", serviceName: nil, sender: sender, attachments: nil ) intent.setImage(groupImage, forParameterNamed: .speakableGroupName) αϒλΠτϧʹग़͢άϧʔϓ໊
  12. (SPVQ$PNNVOJDBUJPO/PUJGJDBUJPO let intent = INSendMessageIntent( recipients: nil, outgoingMessageType: .outgoingMessageText, content:

    "通知の内容", speakableGroupName: INSpeakableString(spokenPhrase: "グループ名"), conversationIdentifier: "xxxxx", serviceName: nil, sender: sender, attachments: nil ) intent.setImage(groupImage, forParameterNamed: .speakableGroupName) άϧʔϓͷΞΠίϯ
  13. (SPVQ$PNNVOJDBUJPO/PUJGJDBUJPO let intent = INSendMessageIntent( recipients: nil, outgoingMessageType: .outgoingMessageText, content:

    "通知の内容", speakableGroupName: INSpeakableString(spokenPhrase: "グループ名"), conversationIdentifier: "xxxxx", serviceName: nil, sender: sender, attachments: nil ) intent.setImage(groupImage, forParameterNamed: ¥.speakableGroupName)
  14. (SPVQ$PNNVOJDBUJPO/PUJGJDBUJPO let intent = INSendMessageIntent( recipients: nil, outgoingMessageType: .outgoingMessageText, content:

    "通知の内容", speakableGroupName: INSpeakableString(spokenPhrase: "グループ名"), conversationIdentifier: "xxxxx", serviceName: nil, sender: sender, attachments: nil ) intent.setImage(groupImage, forParameterNamed: ¥.speakableGroupName)
  15. (SPVQ$PNNVOJDBUJPO/PUJGJDBUJPO let intent = INSendMessageIntent( recipients: [personA, personB], outgoingMessageType: .outgoingMessageText,

    content: "通知の内容", speakableGroupName: INSpeakableString(spokenPhrase: "グループ名"), conversationIdentifier: "xxxxx", serviceName: nil, sender: sender, attachments: nil ) intent.setImage(groupImage, forParameterNamed: .speakableGroupName) άϧʔϓͷଞͷड৴ऀ ࣗ෼͸ؚΊͳ͍ ࣗ෼͕ड৴ऀͳͷ͸ࣗ໌ͳͷͰؚΊͯ΋ແࢹ͞ΕΔ ʂ ஫ҙ
  16. ิ଍ */1FSTPOʹ͓͚Δʮࣗ෼ʯͱ͸ʁ let me = INPerson( personHandle: .init(value: "[email protected]", type:

    .emailAddress), nameComponents: nil, displayName: "まつじ", image: image, contactIdentifier: nil, customIdentifier: "xxxxxxx", isMe: true, suggestionType: .none )
  17. ิ଍ */1FSTPOʹ͓͚Δʮࣗ෼ʯͱ͸ʁ let me = INPerson( personHandle: .init(value: "[email protected]", type:

    .emailAddress), nameComponents: nil, displayName: "まつじ", image: image, contactIdentifier: nil, customIdentifier: "xxxxxxx", isMe: true, suggestionType: .none ) σϑΥϧτ͸GBMTF
  18. (SPVQ$PNNVOJDBUJPO/PUJGJDBUJPO let intent = INSendMessageIntent( recipients: [personA, personB], outgoingMessageType: .outgoingMessageText,

    content: "通知の内容", speakableGroupName: INSpeakableString(spokenPhrase: "グループ名"), conversationIdentifier: "xxxxx", serviceName: nil, sender: sender, attachments: nil ) intent.setImage(groupImage, forParameterNamed: .speakableGroupName)
  19. (SPVQ$PNNVOJDBUJPO/PUJGJDBUJPO let intent = INSendMessageIntent( recipients: [personA, personB], outgoingMessageType: .outgoingMessageText,

    content: "通知の内容", speakableGroupName: INSpeakableString(spokenPhrase: "グループ名"), conversationIdentifier: "xxxxx", serviceName: nil, sender: sender, attachments: nil ) intent.setImage(groupImage, forParameterNamed: .speakableGroupName) ड৴ऀ͕ଟ͍৔߹ɺϝϞϦͷ৺഑͕
  20. @available(iOS 15.0, *) open class INSendMessageIntentDonationMetadata : INIntentDonationMetadata { open

    var mentionsCurrentUser: Bool open var isReplyToCurrentUser: Bool open var notifyRecipientAnyway: Bool open var recipientCount: Int public init() }
  21. @available(iOS 15.0, *) open class INSendMessageIntentDonationMetadata : INIntentDonationMetadata { open

    var mentionsCurrentUser: Bool open var isReplyToCurrentUser: Bool open var notifyRecipientAnyway: Bool open var recipientCount: Int public init() } ࣗ෼͕ϝϯγϣϯ͞Ε͍ͯΔ͔Ͳ͏͔
  22. @available(iOS 15.0, *) open class INSendMessageIntentDonationMetadata : INIntentDonationMetadata { open

    var mentionsCurrentUser: Bool open var isReplyToCurrentUser: Bool open var notifyRecipientAnyway: Bool open var recipientCount: Int public init() } ࣗ෼ͷϝοηʔδʹฦ৴͔ͨ͠Ͳ͏͔
  23. @available(iOS 15.0, *) open class INSendMessageIntentDonationMetadata : INIntentDonationMetadata { open

    var mentionsCurrentUser: Bool open var isReplyToCurrentUser: Bool open var notifyRecipientAnyway: Bool open var recipientCount: Int public init() } ڧ੍తʹ௨஌͢Δϝοηʔδ͔Ͳ͏͔
  24. @available(iOS 15.0, *) open class INSendMessageIntentDonationMetadata : INIntentDonationMetadata { open

    var mentionsCurrentUser: Bool open var isReplyToCurrentUser: Bool open var notifyRecipientAnyway: Bool open var recipientCount: Int public init() } ड৴ऀͷ਺ ࠓճ͸͜ΕΛ࢖͏
  25. */4FOE.FTTBHF*OUFOU%POBUJPO.FUBEBUB let intent = INSendMessageIntent( recipients: nil, ... ) let

    metadata = INSendMessageIntentDonationMetadata() metadata.recipientCount = 2 intent.donationMetadata = metadata
  26. */4FOE.FTTBHF*OUFOU%POBUJPO.FUBEBUB let intent = INSendMessageIntent( recipients: nil, ... ) let

    metadata = INSendMessageIntentDonationMetadata() metadata.recipientCount = 2 intent.donationMetadata = metadata ͜ͷ஋͕Ҏ্ͳΒ (SPVQ$PNNVOJDBUJPO/PUJGJDBUJPOʹʂ