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

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. 3.
  2. 30.

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

    WebϖʔδΛҰ౓։͘ඞཁ͕͋Δ • ભҠલʹ֬ೝΞϥʔτ͕ग़ΔͷͰλοϓ͕૿͑Δ • ϝʔϧʹ໭ΔͱWebը໘͕࢒ͬͯΔ
  3. 31.
  4. 35.

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

    • ୹ॖURL౳ͰυϝΠϯ͕ҟͳΔͱൃಈ͠ͳ͍ • ܭଌ͢Δʹ͸ࣗ෼ͷυϝΠϯ಺ͰରԠ͕ඞཁ
  5. 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) }
  6. 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
  7. 39.

    σʔλͷεΩʔϚྫ { "category": "string", "position": "string", "url": "string", "app_version": "string",

    "device_name": "string", "created_at": "datetime", "os_version": "string", "platform": "string", "user_id": "num" }
  8. 43.
  9. 46.