いまさらだけど「良い通知」について考えてみた

4c6ec167a614173c5b31aaf4d1defa19?s=47 Hiroki Matsue
February 23, 2018

 いまさらだけど「良い通知」について考えてみた

「ROPPONGI.swift 第1回」で使った資料です。
https://visits.connpass.com/event/78975/

4c6ec167a614173c5b31aaf4d1defa19?s=128

Hiroki Matsue

February 23, 2018
Tweet

Transcript

  1. ͍·͞Β͚ͩͲ ʮྑ͍௨஌ʯʹ͍ͭͯߟ͑ͯΈͨ Hiroki Matsue Housmart Inc. Feb 23, 2018 ROPPONGI.swift

    ୈ1ճ
  2. Hiroki Matsue (@macs_6) Swift/Ruby/Docker !

  3. None
  4. ͜Μͳ͜ͱ͋Γ·ͤΜ͔

  5. ΞϓϦϢʔβʔʰ௨஌ΛࢭΊ͍ͨΜͰ͕͢ʱ

  6. Ͳ͏ͨ͠Βʮྑ͍௨஌ʯʹͰ͖Δͷ

  7. ྑ͘ͳ͍௨஌ʁ ! • རݾతʁ • ԡ͠ചΓʁ

  8. ڵຯͷແ͍΋ͷ͕සൟʹདྷͨΒݏ

  9. Ϣʔβʔ͸ʮ˓˓͍ͨ͠ʯ͔Β ΞϓϦΛೖΕͯ͘ΕͯΔ

  10. ʮ঎඼Λങ͍͍ͨʯ =>ʮൃചͨ͠Β஌Γ͍ͨʯ ͱ͔ ʮμΠΤοτ͍ͨ͠ʯ =>ʮه࿥Λ๨Εͳ͍Α͏ʹ͍ͨ͠ʯ

  11. ڵຯͷ͋ΔਓʹૹΔ

  12. ڵຯ͕͋ͬͨͷ͔֬ೝ͢Δ ܭଌ΋େࣄ

  13. ௨஌ɺܭଌͷ࣮૷͸஍ຯ

  14. ϓογϡ௨஌ΛૹΔϢʔβʔΛߜΔ + ܭଌ SDKΛೖΕͯɺϢʔβʔ৘ใΛΠϯϙʔτͯ͠ɺ ͳΔ΂ָ͘ʹղܾ !

  15. ΋͠σεΫτοϓͰ΋࢖͑ΔαʔϏεͩͱʁ

  16. [࣭໰] ୲౰͍ͯ͠ΔαʔϏε͕WebͱωΠ ςΟϒΞϓϦʹରԠ͍ͯ͠Δํʁ

  17. Ϣʔβʔ͕ΫϩεσόΠεͰ࢖͏ ʮ௨஌ʯ͸2ͭ

  18. • ϓογϡ௨஌ • ϝʔϧ (͋ͱWebϓογϡ)

  19. PMʰϝʔϧ͔Β΋ΞϓϦΛ։͚ΔΑ͏ʹ σΟʔϓϦϯΫͷ࣮૷Λ͓ئ͍͠·͢ʱ

  20. σΟʔϓϦϯΫ

  21. iOSͷ2ͭͷσΟʔϓϦϯΫ • Custom URL Scheme example:// • Universal Links https://example.com/

  22. ϝʔϧʹexample://Λ࢖͏ͱ σεΫτοϓ͔Β։͚ͳ͍

  23. ͳͷͰUniversal LinksΛ࢖͏

  24. ৼΓฦΓ • ʮྑ͍௨஌ʯ͸ૹΔର৅͕ߜΒΕ͍ͯΔ • ʮྑ͍௨஌ʯ͸ܭଌʹΑΓࢧ͑ΒΕ͍ͯΔ

  25. ʮྑ͍௨஌ʯͷͨΊʹ ͪΌΜͱܭଌͯ͠PDCAճ͍ͨ͠

  26. ࠓ·ͰͷWeb։ൃͳΒ • Mailgun • Sendgrid πʔϧΛೖΕͯΫϦοΫܭଌΛ༗ޮʹͯ͠׬ྃ

  27. ͱࢥ͍͖΍ɾɾ ΫϦοΫܭଌʹผυϝΠϯΛ࢖͏ͱ Universal Links͕ൃಈ͠ͳ͍

  28. ࢓ํͳ͍ͷͰ ΍ͬͺΓCustom URL Scheme?

  29. ྫ͑͹ɺϝϧΧϦͷݕࡧ৚݅อଘͨ࣌͠ͷϝʔϧ WebΛ։͍ͯɺ௚ޙʹ Custom URL SchemeͰΞϓϦʹભҠ

  30. Custom URL Scheme + ܭଌ Pros • طଘͷWebܭଌͰղܾग़དྷΔ Cons •

    WebϖʔδΛҰ౓։͘ඞཁ͕͋Δ • ભҠલʹ֬ೝΞϥʔτ͕ग़ΔͷͰλοϓ͕૿͑Δ • ϝʔϧʹ໭ΔͱWebը໘͕࢒ͬͯΔ
  31. None
  32. ΞϓϦΛ։͘εςοϓ͕গͳ͍ํ͕ʮྑ͍௨஌ʯ

  33. • ʮྑ͍௨஌ʯ͸ૹΔର৅͕ߜΒΕ͍ͯΔ • ʮྑ͍௨஌ʯ͸ܭଌʹΑΓࢧ͑ΒΕ͍ͯΔ • ʮྑ͍௨஌ʯ͸ͳΊΒ͔ʹΞϓϦʹભҠͰ͖Δ

  34. ʮྑ͍௨஌ʯͷͨΊʹ ΍ͬͺΓUniversal LinksΛ࢖͍͍ͨ

  35. Universal Links + ܭଌ Pros • Ϣʔβʔ͸ϫϯλοϓͰର৅ΞϓϦΛ։͚Δ • Կ͔͸։͚Δ(Πϯετʔϧ͞Ε͍ͯͳ͚Ε͹Web൛΁) Cons

    • ୹ॖURL౳ͰυϝΠϯ͕ҟͳΔͱൃಈ͠ͳ͍ • ܭଌ͢Δʹ͸ࣗ෼ͷυϝΠϯ಺ͰରԠ͕ඞཁ
  36. ϝʔϧ௨஌͕ඞཁͳ৔߹ͷΫϦοΫܭଌ • αʔόʔαΠυ: URLʹύϥϝʔλΛ෇༩ • iOSΞϓϦ: URLʹؚ·ΕΔύϥϝʔλΛղऍͯ͠ه࿥ • AndroidΞϓϦ: URLʹؚ·ΕΔύϥϝʔλΛղऍͯ͠ه࿥

    ΋͠σʔλͷอଘઌ͕·ͩແ͍ͳΒKeen IO΋Φεεϝ
  37. iOSͰܭଌ͢Δ৔߹ func trackEmailClick(url: URL) -> URL { var properties =

    [String: Any]() properties["url"] = url.absoluteString properties["category"] = category properties["position"] = position properties = appendGlobalProperties(properties: properties) // Send to somewhere return removeTrackingParameters(url: url) }
  38. RailsͰϝʔϧૹΔ৔߹ class ApplicationMailer < ActionMailer::Base include MailClickTracker end module MailClickTracker

    def mail(*args, &block) mail = super category = category(mail) new_body_source = '' position = 0 mail.body.raw_source.each_line do |line| url_match = line.match(/href\s*=\s*["|'](#{Settings.site_url}[^"^']*)["|']/) new_body_source << line and next if url_match.blank? url_str = url_match[1].to_s new_url_str = set_params(url_str, category) new_body_source << line.sub(url_str, new_url_str) end mail.body.raw_source.replace(new_body_source) mail end end
  39. σʔλͷεΩʔϚྫ { "category": "string", "position": "string", "url": "string", "app_version": "string",

    "device_name": "string", "created_at": "datetime", "os_version": "string", "platform": "string", "user_id": "num" }
  40. Universal Linksͷॲཧ࣌ʹ ه࿥͢Δ͚ͩͳͷͰγϯϓϧ

  41. ʮྑ͍௨஌ʯͷͨΊͷܭଌͱભҠ

  42. ϚʔέλʔɺΞϓϦɺαʔόʔαΠυͰڠྗ͢Δ ͱʮྑ͍௨஌ʯʹۙͮ͘ (·ͨ͸৭ʑ΍ΔϚϯ) https://speakerdeck.com/jumbo_ken/liang-osyarumantoiuxuan-ze

  43. ·ͱΊ

  44. ·ͱΊ • ʮྑ͍௨஌ʯ͸ૹΔର৅͕ߜΒΕ͍ͯΔ • ʮྑ͍௨஌ʯ͸ܭଌʹΑΓࢧ͑ΒΕ͍ͯΔ • ʮྑ͍௨஌ʯ͸ͳΊΒ͔ʹΞϓϦʹભҠͰ͖Δ ܭଌͯ͠ɺUniversal LinksΛద੾ʹ࢖͓͏

  45. Custom URL Scheme Universal Links ΞϓϦભҠ࣌ͷ֬ೝ Ξϥʔτ͕ෆཁ × ◦ URL୹ॖͰͷܭଌ

    - × <=ରԠͰ͖Δ ΞϓϦ͕ͳͯ͘΋ಈ ࡞͢Δ × ◦
  46. Thanks