ATOM is the protocol to add, update and delete data into PIXEE application. For that purpose, send to MILPIX Team your ATOM feed URL and in return you'll be attributed a layer name layer_name.
GET parameters published-min, start-index and max-results, as well as OpenSearch parameters totalResults, startIndex and itemsPerPage, MUST be implemented following GDATA specifications.
Only the ATOM tags <id>, <updated>, <content type=“xhtml“> and <link rel="alternate"> are used by PIXEE.
| Page title | <h1> | Required | //h1[1] |
| Page description (summary) | <p> | Required | //p[1] |
| Page icon | <img class=“icon“ src=““ /> or <a class=“icon“ href=““ /> | JPEG. | //img[@class="icon"][1] |
| Images to recognize | <img class=“mx“ src=““ /> or <a class=“mx“ href=““ /> | JPEG. Best possible quality. Size >= 200x200 | //img[@class="mx"] |
| Action (redirection) | <a class=“url-redirect“ href=““ /> | Required action (web and web mobile). | //a[@class="redirect"][1] |
| Category | <span class="category">film</span> | Tag a category | //span[@class="category"] |
| Language | <span class="language">fr</span> | Set current page language | //span[@class="language"] |
| Specification version | <span class=“version“>1.0<span> | Required | //span[@class="version"][1] |
| Places | <div class="vcard"> | //div[@class="vcard"] | |
| Events | <div class="vevent"> | //div[@class="vevent"] |
Icon image can be indexed by PIXEE search engine if you write <a class=“icon mx“ href=““ />
<div class="vcard"> <span class="fn org">L'Adresse Musée de La Poste</span><br /> <div class="adr"> <span class="type">Work :</span><br /> <div class="street-address">34 boulevard de Vaugirard</div> <span class="locality">Paris</span><br /> <span class="postal-code">75015</span><br /> <div class="country-name">France</div> </div> <div class="tel"> <span class="type">Work :</span><br /> Téléphone : <div class="value">+33 1 49 54 73 73</div> </div> <div class="geo"> Latitude : <div class="latitude">48.8430093</div><br/> Longitude : <div class="longitude">48.8430093</div><br/> </div> <div class="note">Cela est un exemple</div> </div>
<div class="vevent"> <h3 class="summary">Madame Grès</h3> <span class="category">museum</span><br /> <div class="location vcard"> <span class="fn org">L'Adresse Musée de La Poste</span><br /> <div class="adr"> <span class="type">Work :</span><br /> <div class="street-address">34 boulevard de Vaugirard</div> <span class="locality">Paris</span><br /> <span class="postal-code">75015</span><br /> <div class="country-name">France</div> </div> </div> Début : <abbr class="dtstart" title="2011-03-24 23:55:00"> 2011-03-24 23:55:00</abbr><br /> Répétition : <abbr class="rrule" title="FREQ=DAILY; \\ until=20120324T184800Z">2012-03-24 18:48:00</abbr><br /> Fin : <abbr class="dtend" title="2012-03-24 18:48:00"> 2012-03-24 18:48:00</abbr><br /> </div>
Any other tag can be used to send to Milpix other data for web or web mobile rendering, except the following reserved class : status, layer, source.
| Translations | <ul class="languages"><li id="urn:uuid:c4517411-1a15-41f1-97d0-b48c8713d865">en</li></ul> | Page translation for id matching Atom Id | //ul[@class="languages"] |
| Web-only Redirection | <a class=“url-redirect-web“ href=““ /> | ||
| Mobile-Web-only Redirection | <a class=“url-redirect-mobile“ href=““ /> | ||
| ... with phone parameters as GET params (*) | <a class=“url-redirect-mobile-with-params“ href=““ /> | ||
| Default Web rendering (**) | <a href=".xsl" alt="xsl" title="web">default<a> | ||
| Default Mobile-Web rendering (**) | <a href=".xsl" alt="xsl" title="mobile">default<a> | ||
| Any other rendering (**) | <a href=".xsl" alt="xsl" title="web">test<a> | when URL is in ?xsl=test for this example |
(*) GET parameters are GPS location (or selected location), (selected) date, UDID, phone and PIXEE version, and selected user language, as follow: location=48.8567,2.35099&address=Paris&date=2010-07-31T12:35Z&udid=00000000-0000-1000-8000-0016CBC97727&pixee=iphone_v3.3&lang=fr
(**) XSL references MUST be local and XSL files sent to Milpix for set-up.
To delete a page, update the entry with <content> tag empty.
<?xml version="1.0"?> <a:feed xmlns:a="http://www.w3.org/2005/Atom" xmlns="http://www.w3.org/1999/xhtml" \\ xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"> <a:id>urn:uuid:9d25c239-d94d-aea7-2a56-9e6c1316369b</a:id> <a:title>MY ATOM FEED</a:title> <a:updated>2011-03-13T22:43:16+01:00</a:updated> <a:author> <a:name>Milpix</a:name> <a:email>info@milpix.com</a:email> </a:author> <openSearch:totalResults>1</openSearch:totalResults> <openSearch:startIndex>0</openSearch:startIndex> <openSearch:itemsPerPage>10</openSearch:itemsPerPage> <a:entry> <a:title>MY ENTRY TITLE</a:title> <a:id>urn:uuid:2c35975c-b680-45e0-b3cc-e201fec15dfe</a:id> <a:link rel="alternate" href="http://www.pixee.com/product/\\ 2c35975c-b680-45e0-b3cc-e201fec15dfe"/> <a:updated>2011-03-13T22:43:16+01:00</a:updated> <a:content type="xhtml"> <span class="version">1.0</span> <span class="language">fr</span> <h1>BONOBO</h1> <p>FULL LIVE BAND</p> <img class="mx icon" alt="caption text" \\ src="http://www.milpix.com/image/18386aa6-64b8-499d-b2f3-f41c96365f5c"/> <img class="mx" alt="caption text" \\ src="http://www.milpix.com/image/d2a7470c-8363-45d1-aab6-71a421b01bb5"/> <a class="url-redirect" href="http://www.lemonde.fr">la page résultat</a> <span class="category">film</span> <span class="category">spectacle</span> </a:content> </a:entry> </a:feed>
URL : http://www.pixee.com/fr/layer_name
?q=
?uri=, or BINARY POST of the image, or MULTIPART POST with image in fname parameter.
-all_load in Other Linker Flags MilpixSDK.h either in the project .pch file or in each file calling the SDK classes. Is called to get a unique instance of the search manager.
[PXSearchManager sharedSearchManager];
This is done by calling the pxStartPicSearchFromCameraWithFilters method. Filters can be set to choose the language and the layer to search in.
pxStartPicSearchFromCameraWithFilters:(NSDictionary*)filters delegate:(id<PXSearchDelegate>)delegate
Search results are returned as an array through the given delegate. If the camera is not available an alert pop-up is displayed and the gallery is started for the user to choose an existing picture.
Parameters
filters : a dictionary that contain the following search parameters :
delegate : the PXDelegate used to receive the search results.
NSArray* layers = [NSArray arrayWithObject:@"myLayer"]; NSDictionary* filters = [NSDictionary dictionaryWithObjectsAndKeys:@"fr",@"language",layers,@"layers",nil]; PXSearchManager* searchManager = [PXSearchManager sharedSearchManager]; [searchManager pxStartPicSearchFromCameraWithFilters:filters delegate:self];
Choosing default camera
You can choose the intially used camera (front or rear camera) by changing useFrontalCamera value.
PXSearchManager* searchManager = [PXSearchManager sharedSearchManager]; searchManager.useFrontalCamera = NO;
Choosing default Zoom Level
A float that can be changed with the defaultZoomLevel property of the sharedSearchManager.
Its value must be between 1 and 4.
PXSearchManager* searchManager = [PXSearchManager sharedSearchManager]; searchManager.defaultZoomLevel = 2.5;
Choosing default flashMode
A value from PXFlashSelectionModeOFF, PXFlashSelectionModeON or PXFlashSelectionModeAUTO to define the default used flash mode. It can be changed with the defaultFalshMode property of the sharedSearchManager.
PXSearchManager* searchManager = [PXSearchManager sharedSearchManager]; searchManager.defaultFalshMode = PXFlashSelectionModeON;
Choosing Timer Mode
A value from PXTimerViewDurationOFF, PXTimerViewDuration3Sec or PXTimerViewDuration6Sec to define the default used flash mode. It can be changed with the defaultTimerDuration property of the sharedSearchManager.
PXSearchManager* searchManager = [PXSearchManager sharedSearchManager]; searchManager.defaultTimerDuration = PXTimerViewDurationOFF;
Use GPS coordinates with Milpix SDK requests
In order to let the Milpix SDK use your location in image scan request, You should save coordinates as following:
[[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithFormat:@"%.6f",longitude] forKey:@"PXLastStoredLocationLongitude"];
[[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithFormat:@"%.6f",latitude] forKey:@"PXLastStoredLocationLatitude"];
[[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithFormat:@"%.6f",radius] forKey:@"PXLastStoredLocationRadius"];
where latitude, longitude and radius can be abtained from a CLLocation object (here location):
latitude = location.coordinate.latitude;
longitude = location.coordinate.longitude;
radius = location.horizontalAccuracy;
pxStartPicSearchFromGalleryWithFilters method. The usage is the same as the pxStartPicSearchFromCameraWithFilters method.
pxStartSearchFromImage:withFilters:delegate: method. The usage is the same as the pxStartPicSearchFromCameraWithFilters method.
The method pxSearchEndedWithResults is called when a search has completed successfully.
PxSearchEndedWithResults:(NSArray*)results
If search fails, the method pxSearchFailed is called.
pxSearchFailed
The structure of the result object is defined by Milpix SA. Be careful to catch the possible absence of some fields depending on the returned object type.
User interface can be customized by calling pxSetTheme:andColor method.
pxSetTheme:(PXTheme)theme andColor:(UIColor*)colorOrNil
Theme can be any of these two values :
The color argument is a ting applied to the toolbar. Be careful to set a color that will display correctly according to the chosen theme.
If no color is provided the toolbar will take a default color depending on the chosen theme.
Texts used in the SDK are prepared for localization. You can customize these texts simply with adding these texts in Localizable.strings file. You can see an example in our demo project.
Download SDK versioning
Download demo project
We hope the SDK will deliver the best for your business and we deeply thank you for your interest in our products. Do not hesitate to contact us via the help button on the right side.