Design flow for enabling push and the various status that go with it

This commit is contained in:
Jason Zimdars
2025-07-21 18:27:31 -05:00
parent 5fb0353660
commit c3b946c961
16 changed files with 361 additions and 51 deletions
+25
View File
@@ -15,6 +15,14 @@ class ApplicationPlatform < PlatformAgent
user_agent.browser.match? /Chrome/
end
def edge?
user_agent.browser.match? /Edg/
end
def firefox?
user_agent.browser.match? /Firefox|FxiOS/
end
def safari?
user_agent.browser.match? /Safari/
end
@@ -26,4 +34,21 @@ class ApplicationPlatform < PlatformAgent
def desktop?
!mobile?
end
def windows?
operating_system == "Windows"
end
def operating_system
case user_agent.platform
when /Android/ then "Android"
when /iPad/ then "iPad"
when /iPhone/ then "iPhone"
when /Macintosh/ then "macOS"
when /Windows/ then "Windows"
when /CrOS/ then "ChromeOS"
else
os =~ /Linux/ ? "Linux" : os
end
end
end