vigour-io / packer-server

Asset manager for native wrapped application
0 stars 1 forks source link

[UA] map user agent to specific build #2

Closed andrepadez closed 8 years ago

andrepadez commented 8 years ago

right now, through the user-agent string, we're getting info like:

{ browser: 'safari',
  version: 531.2,
  prefix: 'webkit',
  platform: 'samsung',
  device: 'tv' }
or
{ browser: 'chrome',
  version: 46,
  prefix: 'webkit',
  platform: 'mac',
  device: 'desktop' } 

we need a reliable and generalised way to map this information to the different build "keys" that will be generated by the VigourNative build process: samsungtv, web, lgtv, ios, android...

@jimdebeer @renancarvalho @shawninder @youzi

andrepadez commented 8 years ago

for now i'm using this:

switch(ua.platform){
    case 'ios': 
        return 'ios'
        break
    case 'android': 
        return 'android'
        break
    case 'samsung':
        return 'samsungtv'
        break
    case 'lg':
        return 'lg'
        break
    default:
        return 'web'
        break
}

but we can change it as we see fit

vigourbot commented 8 years ago

this will need discussion and more specification so i won't add a due date. there's a temporary solution in place already

[--- Commented from Asana.com

commenter André Alçada Padez

---[aa]

shawninder commented 8 years ago

We could have the native builds request the app with a special query parameter indicating which "platform" they are running (the key you mention). Something like http://5thdimension.vigour.io?platform=ios. Perhaps using ua.platform is good enough, but this seems pretty bulletproof.

Thoughts?

shawninder commented 8 years ago

I asked @avdwerff and @michielibiza to have the webviews provide extra info in the user-agent string to help us with this