I'm working on a proof of concept using the SDL Mobile Context Engine Cartridge. We're using a wrapper ontop of the Context Engine - so we're not directly communicating with the ADF directly (through the claims store). The POC is for an adaptive site where we are looking to make a decision based on device widths (the groupings are defined in our own custom vocabulary) in the Spring request interceptor, so that we may redirect users to the appropriate view (hence adaptive).
The way I understand it is that the Context Engine uses two main resolvers for discovery; the HTTP requests user-agent pattern matching (against the device DB etc), and cookies which are set in the discover-min.js file (consumed by the Context Engine). The issue is the scenario where the initial request comes in and the javascript file has not been loaded, and thus no cookies have been set. Specifically, we're imagining links included in email newsletters where the user hasn't visited the site yet and no cookies are stored.
So far, we've discussed coming up with some fallback rules if the cookies are set (use the device / tablet properties as fallback, grouped in the vocabulary). The initial request would use the fallback, and subsequent requests would leverage the cookies which have now been set. We'll have to think about how to implement this as it doesn't seem as though we could do it OOTB in the vocabulary as we've no clean way to see if a property is actually set, or is just the fallback property value. Hopefully I am wrong here and we can define these fallbacks, although I've scoured the documentation and nothings popped out.
The business requirements for the POC involve the detection based around a set of specific device width ranges (for mobile, tablet & desktop) - or else we would have used the device / tablet / desktop properties provided OOTB. I think our best solution is going to be the fallback on these properties (however we decide to implement it), but I am interested to hear what everyone else has done.
Has anyone else encountered this problem? If so, how did you manage to work around it? If relying on the fallback properties is the answer, is the only solution to check if the cookies are set (and the properties aren't the fallback values) through some custom code; ie it can't be done in the vocabulary? I greatly appreciate any feedback!