Class: LinkIO::PendingLinksController

Inherits:
ApplicationController show all
Defined in:
app/controllers/linkio/pending_links_controller.rb

Overview

Retrieves pending links for deferred deep linking.

Instance Method Summary collapse

Instance Method Details

#by_deviceObject

GET /pending-link/:device_id



7
8
9
10
# File 'app/controllers/linkio/pending_links_controller.rb', line 7

def by_device
  deep_link = linkio_client.pending_link(params[:device_id])
  respond_with_deep_link(deep_link)
end

#by_fingerprintObject

GET /pending-link (matched by client IP fingerprint)



13
14
15
16
17
18
19
20
21
# File 'app/controllers/linkio/pending_links_controller.rb', line 13

def by_fingerprint
  ip = LinkIO::Utils.client_ip(
    forwarded_for: request.headers["X-Forwarded-For"],
    ip: request.remote_ip,
    remote_address: request.remote_addr
  )
  deep_link = linkio_client.pending_link_by_fingerprint(ip, request.user_agent)
  respond_with_deep_link(deep_link)
end