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

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

Hiroki Matsue
February 23, 2018

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

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

Hiroki Matsue

February 23, 2018
Tweet

More Decks by Hiroki Matsue

Other Decks in Technology

Transcript

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

    WebϖʔδΛҰ౓։͘ඞཁ͕͋Δ • ભҠલʹ֬ೝΞϥʔτ͕ग़ΔͷͰλοϓ͕૿͑Δ • ϝʔϧʹ໭ΔͱWebը໘͕࢒ͬͯΔ
  2. Universal Links + ܭଌ Pros • Ϣʔβʔ͸ϫϯλοϓͰର৅ΞϓϦΛ։͚Δ • Կ͔͸։͚Δ(Πϯετʔϧ͞Ε͍ͯͳ͚Ε͹Web൛΁) Cons

    • ୹ॖURL౳ͰυϝΠϯ͕ҟͳΔͱൃಈ͠ͳ͍ • ܭଌ͢Δʹ͸ࣗ෼ͷυϝΠϯ಺ͰରԠ͕ඞཁ
  3. 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) }
  4. 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
  5. σʔλͷεΩʔϚྫ { "category": "string", "position": "string", "url": "string", "app_version": "string",

    "device_name": "string", "created_at": "datetime", "os_version": "string", "platform": "string", "user_id": "num" }