podigee/device_detector

Detect iOS Android devices

Closed this issue · 1 comments

How to detect iOS devices (iPhone, Tablets) and Andorid devices ?

Thank you

    user_agent = request.env['HTTP_USER_AGENT']
    client = DeviceDetector.new(user_agent)

    case client.os_name
    when 'iOS'
      render :ios
    when 'Android'
      render :android
    else
      render :other
    end