Since there are many different types of mobile devices with different display sizes and resolutions, implementers may want to be able to return a different property based on the type of device that made the request. CRS-IUA demonstrates an example of how this can be achieved using a combination of derived properties and the BrowserTyper
.
Information about derived properties can be found in the ATG Repository Guide while information about the BrowserTyper
can be found in the ATG Commerce Programming Guide.
The /atg/commerce/catalog/custom/customCatalog
component has been extended to provide device-specific property values based on device type for a small set of devices, in this case iOS devices. This set of devices can be expanded. Examples are included for returning promotional content items of different sizes and their corresponding image text, based on the type of the requesting device.
In these examples, devices that match the BrowserTyper
/atg/dynamo/servlet/pipeline/BrowserTypes/iPhoneRetina
receive a higher resolution promotional content image.
The ATGRestManager
provides methods to determine the type of device from which a request originated by examining various properties of the device (through the UIDevice
object). Devices match the iPhoneRetina
BrowserType
above if they originate from a device that the ATGRestManager
determines to be ATGMobileCommerce.*HiRes
.
Similarly, devices match the iOS BrowserType
if they originate from a device that the ATGRestManager
determines to be ATGMobileCommerce.*LowRes
. Such devices receive a lower resolution image in order to conserve bandwidth. These matching criteria can be modified to meet specific business needs. The method of the ATGRestConstants
of interest for this purpose is:
-(NSString*) getUserAgent;
For more detail on mobile-specific derived properties see the section Performance Considerations.