[aerogear-dev] UPS: deviceType semantics

Matthias Wessendorf matzew at apache.org
Thu Nov 5 07:45:18 EST 2015


On Thu, Nov 5, 2015 at 1:33 PM, Ron Smeral <rsmeral at redhat.com> wrote:

> Hi Matthias,
>
> thanks for the explanation, let me clarify my intentions :)
>
> All of what you describe is mostly clear to me. I was trying to point at
> the fact that it might not be clear to a new user.
>
> I'll try to rephrase:
> I see two major problems with the *design*:
>
> 1) We say "deviceType is the raw type of the device", but in reality, it
> currently is "a completely arbitrary string where you can stuff anything on
> registration and then filter by it when sending a notification".
>

Ok


>
> 2) Since we do have the "deviceType" field as part of the model, it should
> be there for a reason. So then, what's its purpose - what is a "device
> type"? Is it the form factor - tablet, phone? Is it the OS - "Android
> Lollipop", "iOS 7"? Or is it the model - "iPhone", "iPod", "Nexus",
> "Galaxy"? Something else?
>

the model - and, well mainly introduced for iOS. I am sure it's not really
used at all


>
> So again, I think we should either:
> * decide on what the field actually means, and document an enumeration of
> possible values, and have the SDKs always set the value automatically
> (possibly overridable),
>

updating the documenation sounds best - I doubt it makes sense to touch the
SDKs here (e.g. for iOS we need UIKit dependency etc.) -1 on doing that
automatically.
We can show, in the app how to send the UIDevice metadata (like we do).

Thats enough


> * OR just get rid of the field (and let the developer set some arbitrary
> array/object of values on registration, to use for filtering when sending).
>
> On 3.11.2015 08:57, Matthias Wessendorf wrote:
> > Hi Ron,
> >
> > thanks for the mail - let me try to bring some light into the dark
> >
> > On Mon, Nov 2, 2015 at 8:38 PM, Ron Smeral <rsmeral at redhat.com <mailto:
> rsmeral at redhat.com>> wrote:
> >
> >     Hi all,
> >
> >     I noticed the "deviceType" field in UPS seems to be used
> inconsistently between Server and the SDKs, and is perhaps underspecified.
> >
> >     The docs only say this much:
> >     https://aerogear.org/docs/unifiedpush/client-registration/
> >     * "deviceType: The device type of the device or the user agent."
> >     - what does "device type of the device" mean? "Type" in what sense?
> >
> >
> >
> > like here:
> >
> https://github.com/aerogear/aerogear-push-ios-demo/blob/master/PushTest/AGAppDelegate.m#L82
> >
> > the iOS API read the type of the device (eg. iPod, iPad, iPhone) etc.
> >
> > It's stored on the server's metadata. Presented to the user, on the
> admin UI, when browsing the registered devices for a Variant. Below is an
> example from our users doc:
> >
> https://aerogear.org/docs/unifiedpush/ups_userguide/index/#_importing_device_metadata
> >
> >
> >
> >     https://aerogear.org/docs/unifiedpush/push-message-format/
> >     * "deviceType: A list of raw device types that should receive the
> message (e.g. Coupon only for iPad and AndroidTablets). The deviceType
> needs to be stored when the device is registering itself with the server."
> >     - what's a "raw device type"?
> >     - "needs to be stored" - who needs to do that? Store where?
> >
> >
> > This API is to actually sent the message to the registered devices -
> device type here is a filter.
> > Example: you have a generic iOS variant, and have a few iPods, a few
> iPhone and a few iPads, this filter allows you to just sent messages to all
> iPhones, by specifiying iphone.
> >
> >
> >
> >
> >
> >     When trying to use the Sender API, the obvious question is: what's
> the list of possible values? The docs don't answer that.
> >
> >
> > here is our current version of the doc:
> >
> https://aerogear.org/docs/specs/aerogear-unifiedpush-rest/sender/index.html#POST
> >
> >
> > but we have a new online in a few days (after the 1.1.0.Finall is out)
> >
> >
> >
> >     Another missing piece of information:
> >     * Is the deviceType an arbitrary string set by the user during
> registration?
> >
> >
> > usually that's done by the application (develoiper), not the directly
> the end user of the phone
> >
> >
> >     * Or, is it somehow automatically set by the client SDKs?
> >
> >
> > yeah :-) but not enforced
> >
> >
> >
> >     After a bit of digging through the SDKs and APIs, I can see this
> (not necessarily 100% correct):
> >
> >     * The Sender API accepts arbitrary values
> >
> >     * Android SDK - has deviceType in model, sets to "ANDROID" by default
> >     * Windows SDK - doesn't even have deviceType in model
> >     * iOS SDK - has deviceType in model, doesn't set to any default value
> >
> >     * Cordova Android - doesn't set, so uses "ANDROID"
> >     * Cordova WP8 - not in model, not set
> >     * Cordova iOS - sets UIDevice.model (I can't really read ObjC, just
> a guess by looking at the code)
> >
> >
> >     Can we come up with clearer semantics for the deviceType field?
> >
> >
> > Looks like on Windows it is missing - perhaps we should add that.
> > On Android, I agree the SDK should not set any default here - but I am
> not sure if there is an equivalent API around like UIDevice, which would
> the app developer allow to specifiy the actual device type.
> >
> > Mind filing a few JIRAs against: AGDROID, AGWIN to get the functionality
> baked into the native SDKs, and against AGCORDOVA to get this into there as
> well, once the native bits are done.
> >
>
> I will happily file some JIRAs and make documentation PRs, *once we are
> clear on what the deviceType really is*.
>
> > Great find, Ron!
> >
> >
> >
> >     Thanks,
> >     Ron
> >
> >     --
> >     Ron Smeral
> >     Technical Writer, FeedHenry
> >     Red Hat
> >     Brno
> >     _______________________________________________
> >     aerogear-dev mailing list
> >     aerogear-dev at lists.jboss.org <mailto:aerogear-dev at lists.jboss.org>
> >     https://lists.jboss.org/mailman/listinfo/aerogear-dev
> >
> >
> >
> >
> > --
> > Matthias Wessendorf
> >
> > blog: http://matthiaswessendorf.wordpress.com/
> > sessions: http://www.slideshare.net/mwessendorf
> > twitter: http://twitter.com/mwessendorf
> >
> >
> > _______________________________________________
> > aerogear-dev mailing list
> > aerogear-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/aerogear-dev
> >
>
> --
> Ron Smeral
> Technical Writer, FeedHenry
> Red Hat
> Brno
>
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20151105/81e6c350/attachment-0001.html 


More information about the aerogear-dev mailing list