SlideShare a Scribd company logo
Use the mobile SDK to create personalized
cross-platform apps leveraging the xDB
Presented by // Mark vanAalst
12 june 2015
Sitecore Mobile SDK Family
Mobile SDK for Xamarin
Mobile SDK for .NET
Mobile SDK for iOS
Mobile SDK for Android
Sitecore Mobile SDK for Xamarin
Powered by the Mobile SDK for .NET portable class library (PCL)
Currently consistent features
Single package on NuGet
Xamarin SDK expected to grow
Sitecore Mobile SDKs for mobile content delivery
Manage in-app content directly from Sitecore
Content marketing and updates without the traditional app update process
Sitecore provides the client/serverAPIs, you provide the app
One JSON REST-like web services server API – ItemWeb API
Many native web service clients
Clients de-serialize JSON (JavaScript) into strongly typed objects
Asynchronous -Thread friendly / non-blocking
5
What’s the
difference?
6
Why Xamarin?
Build native iOS and Android apps inVisual Studio
Write C#. Run on 2.6 billion devices
Share Code and UI
Use NuGet and the Xamarin Component Store
Xamarin Advantages
Where does the SDK fit in?
8
Sitecore Mobile SDK for XamarinShared C# App Logic
Platform Specific C# Platform Specific C#Platform Specific C#
Diving into the Mobile SDK
9
10
What is the SDK
ItemWebAPI
Request Builder
WebApiRequest
ScApiSession
Sitecore MobileC# SDK
Item Objects Response
HTTP Request
HTTP Response
Item Objects Request
Advantages
Build requests using native methods
Wraps ItemWebAPI requests
Deserializes response in to strong typed objects
Setting up a session
12
Use SitecoreWebApiSessionBuilder class
Security
• Anonymous
Session
• Authenticated
Session
Permissions
• Read-only
• Read/Write
Endpoint
• Instance URL
• Credentials
• Context Site
• Wep API version
Item Source
• Default Database
• Default Language
Media Library
Parameters
• Media Root item
• Media Prefix
• Default Extension
• Resizing strategy
var session =SitecoreWebApiSessionBuilder.AuthenticatedSessionWithHost(“http://my-host.com”)
.Credentials(loginAndPasswordProvider)
.Site("/sitecore/shell")
.WebApiVersion("v1")
.DefaultDatabase("web")
.DefaultLanguage("en")
.MediaLibraryRoot("/sitecore/media library")
.MediaPrefix("~/media/")
.DefaultMediaResourceExtension("ashx")
.MediaResizingStrategy(DownloadStrategy.Plain)
.BuildSession();
Building sessions
13
The Mobile SDK provides the following builder methods:
BuildReadonlySession()
BuildSession()
Warning: If you use a read-only session but your code contains methods that
change/create content, the application will not compile.
SitecoreWebApiSessionBuilder.AnonymousSessionWithHost(“http://my-host.com”).BuildReadonlySession();
SitecoreWebApiSessionBuilder.AnonymousSessionWithHost(“http://my-host.com”).BuildSession();
Configuring your request
14
• Create, Read, Update and Delete functionality
• RequestBuilder syntax is the same, scope may vary
The Mobile SDK provides a set of methods to define the following properties:
Database Language Version Payload Fields Scope Paging
Usage
Configure the database to get items from
Mobile SDK method: Database(string)
ItemWeb API param: sc_database
Optional: Yes
Item Request Parameters - Database
15
Database Language Version Payload Fields Scope Paging
Usage
Define the item language
Mobile SDK method: Language(string)
ItemWeb API param: language
Optional: Yes
Item Request Parameters - Language
16
Database Language Version Payload Fields Scope Paging
Usage
Define the specific version. Do not invoke for the latest version
Mobile SDK method: Version(int?)
ItemWeb API param: sc_itemversion
Optional: Yes
Item Request Parameters -Version
17
Database Language Version Payload Fields Scope Paging
Usage
Use payload type enumerator (content, default, full, min) to define the field
list returned
Mobile SDK method: Payload(PayloadType)
ItemWeb API param: payload
Optional: Yes
Item Request Parameters - Payload
18
Database Language Version Payload Fields Scope Paging
Usage
Use as an alternative for payload. Set the fields returned explicitly.
Mobile SDK method: AddFieldsToRead(string), AddFieldsToRead(Ilist<string>)
ItemWeb API param: fields
Optional: Yes
Item Request Parameters - Fields
19
Database Language Version Payload Fields Scope Paging
Usage
Retrieve additional content from parent or child items
Mobile SDK method: AddScope(ScopeType),AddScope(IEnummerable<ScopeType>)
ItemWeb API param: scope
Optional: Yes
Item Request Parameters - Scope
20
Database Language Version Payload Fields Scope Paging
Usage
Get paginated data in case of large result sets
Mobile SDK method: ItemsPerPage(int) PageNumber(int)
ItemWeb API param: perPage page
Optional: Yes Yes
Item Request Parameters - Paging
21
Database Language Version Payload Fields Scope Paging
22
Execute
Request
Session
Executing the request
23
All requests are executed by the ISitecoreWebApiSession interface instance
Three overloads for ReadItemAsync
• IReadItemsByIdRequest
• IReadItemsByPathRequest
• IReadItemsByQueryRequest
* If you cannot use the async keyword with your method, use theTask.WaitAll() method instead
ScItemsResponse response = await session.ReadItemAsync(request);
Creating Items
24
Requires authenticated session!
Must specify
• Parent id or path
• Item name
• ItemTemplate
var request = ItemWebApiRequestBuilder.CreateItemRequestWithParentParentPath("/path/to/parent")
.ItemTemplatePath(“Sample/Sample Item”)
.ItemName(“Name of new item”)
.Build();
Updating Items
25
Requires authenticated session
Must specify
• Field name
• Field value (raw value)
• Optional: language
var request = ItemWebApiRequestBuilder.UpdateItemRequestWithId(“{item-id-GUID}”)
.Language("en")
.AddFieldsRawValuesByNameToSet("Text", “Hello!”)
.Build();
var request = ItemWebApiRequestBuilder.UpdateItemRequestWithId(“{item-id-GUID}”)
.Language(“dk")
.AddFieldsRawValuesByNameToSet("Text", “Hej!”)
.Build();
Deleting Items
26
Requires authenticated session
Must specify
• Database
• Optional: Scope (remove parent or children)
No support for language versions!
var request = ItemWebApiRequestBuilder.DeleteItemRequestWithPath(itemPath)
.Database(“master”)
.Build();
What about media?
27
Retrieving media
28
By default the mobile SDK returns the media item path
Use the ItemWebApiRequestBuilder to download the media content
// constructing a request
string mediaPath = "/Images/green_mineraly1";
var request =
ItemWebApiRequestBuilder.DownloadResourceRequestWithMediaPath(mediaPath).Build();
// processing the request
using ( Stream response = awaitthis.session.DownloadMediaResourceAsync(request) )
{
// working with the media resource stream
}
Uploading Media
29
Required parameters
• Item name
• File name
• Resource data
• Parent item path or parent GUID
var request = ItemWebApiRequestBuilder.UploadResourceRequestWithParentId({GUID-ITEM-ID})
.ItemDataStream(stream)
.ItemName("MyMediaItem")
.FileName("myPhoto.jpg")
.Build();
var response = await session.UploadMediaResourceAsync(request);
HTML rendering request
30
Gets the HTML output of a Sitecore rendering
Required parameters:
• Source ID (Item ID)
• Rendering ID
var request =ItemWebApiRequestBuilder.RenderingHtmlRequestWithSourceAndRenderingId(sourceGUID, renderingGUID).
Build();
What about personalization?
31
Sorry, the current SDK
(1.0) does not support
personalization
Vision on Mobile and the SDK
33
Become the Sitecore integration layer for mobile apps
• Upgrade the SDK to leverage the newest Sitecore features
• No custom Sitecore integration needed
• Easy maintainability and lower costs
Proof of concept
34
Use Mobile SDK to retrieve items
Requires personalized data
Do not modify Mobile SDK since this runs client side
Modifications must be done server side
Use plain Sitecore installation
Sitecore.Services.Client provides a service layer on both
the server and the client side of Sitecore applications
that you use to develop data-driven applications.
36
The idea
37
ServicesAPI Controller
SC_ANALYTICS_GLOBAL_COOKIE
“Register device”
Store cookie
on device
ServicesAPI Controller xDB
xDB
Response data
Request with included cookie
Create
request
Sitecore ServicesWebAPI
38
Why should you use Sitecore.Services?
• Anonymous user filters
• Security policies
• Handles logging
Exposes two services
• Item Service
• Entity Service
The first steps
39
• Create CustomWebClient
• Add CookieContainer
• Create SessionApi Controller
• Register routes
Customize ItemWebAPI
40
Mobile SDK ItemWeb API
Challenges
41
Pass data within the Mobile SDK to the ItemWeb API
Add personalization to the ItemWeb API
42
Why?
Pipelines & Processors!
Sending custom data using the Mobile SDK
43
Abuse fields field in a read request
Mobile SDK method: AddFieldsToRead(string)
ItemWeb API param: fields
Receiving data in the ItemWeb API
44
Add custom processor in the itemWebApiGetField pipeline
Add method to retrieve data
Do something with the results
45
Other options?
46
47
Visit community.sitecore.net
48
Questions?
Do you have more questions ?
Go to community.sitecore.net
1900+ professionals are there to help you

More Related Content

PPTX
Power Mobile Apps with Sitecore
PPTX
Mobile (App) Development with Sitecore
PPTX
Sitecore and PhoneGap - Driving Business with Mobile Apps
PPTX
Case study: integrating azure with google app engine
PPTX
Ionic and Azure
PDF
Ibm empresa movil
PDF
Ionic Auth Connect: Single Sign-on Made Easy
PPTX
Disruptive Trends in Application Development
Power Mobile Apps with Sitecore
Mobile (App) Development with Sitecore
Sitecore and PhoneGap - Driving Business with Mobile Apps
Case study: integrating azure with google app engine
Ionic and Azure
Ibm empresa movil
Ionic Auth Connect: Single Sign-on Made Easy
Disruptive Trends in Application Development

What's hot (20)

PPTX
Webinar: Building HTML5 Mobile Apps with Kinvey and Gizmox
PPTX
Progressive Web Apps and React
PPTX
Pragmatic approach to building native apps hybrid way
KEY
Open Source World : Using Web Technologies to build native iPhone and Android...
PPTX
AppBattler - An Android-based SDK for game developers to enable social gaming
PDF
Build Consumer Apps Using Mobile SDK and Ionic Framework
PDF
Building Effective and Rapid Applications with IBM MobileFirst Platform
PPSX
Cross platform mobile application architecture for enterprise
PDF
Re Inventing Enterprise IT around APIs and Apps
PPTX
HTML5 Development with Gizmox Visual WebGui7
PDF
Nathan Crone - Resume
PDF
BBM Social Platform and App Monetization
PPTX
Salesforce Mobile Developer Week
PPTX
AppNotch Enterprise
PPTX
Mobile architecture options
PDF
WSO2 & eBay Case Study
PPTX
App Development Evolution: What has changed?
PPTX
The App Evolution
PPTX
Quickly Build a Native Mobile App for your Community using Salesforce Mobile SDK
PDF
Hybrid Applications with WebSphere commerce and Worklight
Webinar: Building HTML5 Mobile Apps with Kinvey and Gizmox
Progressive Web Apps and React
Pragmatic approach to building native apps hybrid way
Open Source World : Using Web Technologies to build native iPhone and Android...
AppBattler - An Android-based SDK for game developers to enable social gaming
Build Consumer Apps Using Mobile SDK and Ionic Framework
Building Effective and Rapid Applications with IBM MobileFirst Platform
Cross platform mobile application architecture for enterprise
Re Inventing Enterprise IT around APIs and Apps
HTML5 Development with Gizmox Visual WebGui7
Nathan Crone - Resume
BBM Social Platform and App Monetization
Salesforce Mobile Developer Week
AppNotch Enterprise
Mobile architecture options
WSO2 & eBay Case Study
App Development Evolution: What has changed?
The App Evolution
Quickly Build a Native Mobile App for your Community using Salesforce Mobile SDK
Hybrid Applications with WebSphere commerce and Worklight
Ad

Viewers also liked (18)

PPTX
Provoke: Achieving enhanced personalisation through big data – David Sigerson...
PPT
What I Eat
PDF
Serious About Your App Marketing? Here Are Your Must Have SDKs
PDF
Personalization in mobile services
PPTX
Why apps
PPTX
Extend sdk
PDF
This time it's personal - iBeacon and personalisation (Jon Little)
PDF
Platform - Technical architecture
PDF
PIXNET iOS SDK @OSDC 2014
PDF
Intro to Salesforce Mobile SDK: Building Hybrid Apps Webinar
PPT
The Marketing Playbook for API & SDK Adoption
PDF
How to measure everything - a million metrics per second with minimal develop...
PDF
Speed to Advocacy: The New Measure of Customer Experience Excellence
PPTX
Joe Reid, Krux: People Data Activation, from paradox to paradigm @ iMedia Dat...
PPTX
The DMP
PPTX
Unleash the Power of Apex Realtime Debugger
PPTX
Building apps faster with lightning and winter '17
PPTX
Building a Single Page App with Lightning Components
Provoke: Achieving enhanced personalisation through big data – David Sigerson...
What I Eat
Serious About Your App Marketing? Here Are Your Must Have SDKs
Personalization in mobile services
Why apps
Extend sdk
This time it's personal - iBeacon and personalisation (Jon Little)
Platform - Technical architecture
PIXNET iOS SDK @OSDC 2014
Intro to Salesforce Mobile SDK: Building Hybrid Apps Webinar
The Marketing Playbook for API & SDK Adoption
How to measure everything - a million metrics per second with minimal develop...
Speed to Advocacy: The New Measure of Customer Experience Excellence
Joe Reid, Krux: People Data Activation, from paradox to paradigm @ iMedia Dat...
The DMP
Unleash the Power of Apex Realtime Debugger
Building apps faster with lightning and winter '17
Building a Single Page App with Lightning Components
Ad

Similar to Creating personalized cross platform mobile apps with the Sitecore Mobile SDK (20)

PPTX
Sug bangalore - headless jss
PDF
Developing ionic apps for android and ios
PDF
"BlackBerry Webworks : Apps for The Smartphone and Tablet"
PPT
Android Introduction
PPTX
Best of Microsoft Dev Camp 2015
PPTX
Building API in the cloud using Azure Functions
PPTX
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
DOC
Amit Kumar Architect with Web and Angular JS
PPTX
Charla desarrollo de apps con sharepoint y office 365
PDF
Faites évoluer votre accès aux données avec MongoDB Stitch
PDF
JUDCon 2014: Gearing up for mobile development with AeroGear
PDF
Understanding Native, Hybrid, and Web Mobile Architectures
PDF
Azure App Services для создания бэкенда мобильных приложений. Parse Open Sour...
PPTX
Headless CMS. Sitecore JSS getting started, tips and tricks
PDF
A164 enterprise javascript ibm node sdk
PPTX
Developing SharePoint 2013 apps with Visual Studio 2012 - SharePoint Connecti...
PDF
Mobile SDK: Considerations & Best Practices
PPTX
SPCA2013 - Developing SharePoint 2013 Apps with Visual Studio 2012
PDF
Front-end. Global domination
PDF
Frontend. Global domination.
Sug bangalore - headless jss
Developing ionic apps for android and ios
"BlackBerry Webworks : Apps for The Smartphone and Tablet"
Android Introduction
Best of Microsoft Dev Camp 2015
Building API in the cloud using Azure Functions
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
Amit Kumar Architect with Web and Angular JS
Charla desarrollo de apps con sharepoint y office 365
Faites évoluer votre accès aux données avec MongoDB Stitch
JUDCon 2014: Gearing up for mobile development with AeroGear
Understanding Native, Hybrid, and Web Mobile Architectures
Azure App Services для создания бэкенда мобильных приложений. Parse Open Sour...
Headless CMS. Sitecore JSS getting started, tips and tricks
A164 enterprise javascript ibm node sdk
Developing SharePoint 2013 apps with Visual Studio 2012 - SharePoint Connecti...
Mobile SDK: Considerations & Best Practices
SPCA2013 - Developing SharePoint 2013 Apps with Visual Studio 2012
Front-end. Global domination
Frontend. Global domination.

Recently uploaded (20)

PDF
System and Network Administraation Chapter 3
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
ai tools demonstartion for schools and inter college
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
System and Network Administration Chapter 2
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
history of c programming in notes for students .pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
CHAPTER 2 - PM Management and IT Context
System and Network Administraation Chapter 3
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
2025 Textile ERP Trends: SAP, Odoo & Oracle
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Understanding Forklifts - TECH EHS Solution
Odoo Companies in India – Driving Business Transformation.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
ai tools demonstartion for schools and inter college
How to Migrate SBCGlobal Email to Yahoo Easily
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
System and Network Administration Chapter 2
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Odoo POS Development Services by CandidRoot Solutions
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
history of c programming in notes for students .pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design
CHAPTER 2 - PM Management and IT Context

Creating personalized cross platform mobile apps with the Sitecore Mobile SDK

  • 1. Use the mobile SDK to create personalized cross-platform apps leveraging the xDB Presented by // Mark vanAalst 12 june 2015
  • 2. Sitecore Mobile SDK Family Mobile SDK for Xamarin Mobile SDK for .NET Mobile SDK for iOS Mobile SDK for Android
  • 3. Sitecore Mobile SDK for Xamarin Powered by the Mobile SDK for .NET portable class library (PCL) Currently consistent features Single package on NuGet Xamarin SDK expected to grow
  • 4. Sitecore Mobile SDKs for mobile content delivery Manage in-app content directly from Sitecore Content marketing and updates without the traditional app update process Sitecore provides the client/serverAPIs, you provide the app One JSON REST-like web services server API – ItemWeb API Many native web service clients Clients de-serialize JSON (JavaScript) into strongly typed objects Asynchronous -Thread friendly / non-blocking
  • 7. Build native iOS and Android apps inVisual Studio Write C#. Run on 2.6 billion devices Share Code and UI Use NuGet and the Xamarin Component Store Xamarin Advantages
  • 8. Where does the SDK fit in? 8 Sitecore Mobile SDK for XamarinShared C# App Logic Platform Specific C# Platform Specific C#Platform Specific C#
  • 9. Diving into the Mobile SDK 9
  • 10. 10 What is the SDK ItemWebAPI Request Builder WebApiRequest ScApiSession Sitecore MobileC# SDK Item Objects Response HTTP Request HTTP Response Item Objects Request
  • 11. Advantages Build requests using native methods Wraps ItemWebAPI requests Deserializes response in to strong typed objects
  • 12. Setting up a session 12 Use SitecoreWebApiSessionBuilder class Security • Anonymous Session • Authenticated Session Permissions • Read-only • Read/Write Endpoint • Instance URL • Credentials • Context Site • Wep API version Item Source • Default Database • Default Language Media Library Parameters • Media Root item • Media Prefix • Default Extension • Resizing strategy var session =SitecoreWebApiSessionBuilder.AuthenticatedSessionWithHost(“http://my-host.com”) .Credentials(loginAndPasswordProvider) .Site("/sitecore/shell") .WebApiVersion("v1") .DefaultDatabase("web") .DefaultLanguage("en") .MediaLibraryRoot("/sitecore/media library") .MediaPrefix("~/media/") .DefaultMediaResourceExtension("ashx") .MediaResizingStrategy(DownloadStrategy.Plain) .BuildSession();
  • 13. Building sessions 13 The Mobile SDK provides the following builder methods: BuildReadonlySession() BuildSession() Warning: If you use a read-only session but your code contains methods that change/create content, the application will not compile. SitecoreWebApiSessionBuilder.AnonymousSessionWithHost(“http://my-host.com”).BuildReadonlySession(); SitecoreWebApiSessionBuilder.AnonymousSessionWithHost(“http://my-host.com”).BuildSession();
  • 14. Configuring your request 14 • Create, Read, Update and Delete functionality • RequestBuilder syntax is the same, scope may vary The Mobile SDK provides a set of methods to define the following properties: Database Language Version Payload Fields Scope Paging
  • 15. Usage Configure the database to get items from Mobile SDK method: Database(string) ItemWeb API param: sc_database Optional: Yes Item Request Parameters - Database 15 Database Language Version Payload Fields Scope Paging
  • 16. Usage Define the item language Mobile SDK method: Language(string) ItemWeb API param: language Optional: Yes Item Request Parameters - Language 16 Database Language Version Payload Fields Scope Paging
  • 17. Usage Define the specific version. Do not invoke for the latest version Mobile SDK method: Version(int?) ItemWeb API param: sc_itemversion Optional: Yes Item Request Parameters -Version 17 Database Language Version Payload Fields Scope Paging
  • 18. Usage Use payload type enumerator (content, default, full, min) to define the field list returned Mobile SDK method: Payload(PayloadType) ItemWeb API param: payload Optional: Yes Item Request Parameters - Payload 18 Database Language Version Payload Fields Scope Paging
  • 19. Usage Use as an alternative for payload. Set the fields returned explicitly. Mobile SDK method: AddFieldsToRead(string), AddFieldsToRead(Ilist<string>) ItemWeb API param: fields Optional: Yes Item Request Parameters - Fields 19 Database Language Version Payload Fields Scope Paging
  • 20. Usage Retrieve additional content from parent or child items Mobile SDK method: AddScope(ScopeType),AddScope(IEnummerable<ScopeType>) ItemWeb API param: scope Optional: Yes Item Request Parameters - Scope 20 Database Language Version Payload Fields Scope Paging
  • 21. Usage Get paginated data in case of large result sets Mobile SDK method: ItemsPerPage(int) PageNumber(int) ItemWeb API param: perPage page Optional: Yes Yes Item Request Parameters - Paging 21 Database Language Version Payload Fields Scope Paging
  • 23. Executing the request 23 All requests are executed by the ISitecoreWebApiSession interface instance Three overloads for ReadItemAsync • IReadItemsByIdRequest • IReadItemsByPathRequest • IReadItemsByQueryRequest * If you cannot use the async keyword with your method, use theTask.WaitAll() method instead ScItemsResponse response = await session.ReadItemAsync(request);
  • 24. Creating Items 24 Requires authenticated session! Must specify • Parent id or path • Item name • ItemTemplate var request = ItemWebApiRequestBuilder.CreateItemRequestWithParentParentPath("/path/to/parent") .ItemTemplatePath(“Sample/Sample Item”) .ItemName(“Name of new item”) .Build();
  • 25. Updating Items 25 Requires authenticated session Must specify • Field name • Field value (raw value) • Optional: language var request = ItemWebApiRequestBuilder.UpdateItemRequestWithId(“{item-id-GUID}”) .Language("en") .AddFieldsRawValuesByNameToSet("Text", “Hello!”) .Build(); var request = ItemWebApiRequestBuilder.UpdateItemRequestWithId(“{item-id-GUID}”) .Language(“dk") .AddFieldsRawValuesByNameToSet("Text", “Hej!”) .Build();
  • 26. Deleting Items 26 Requires authenticated session Must specify • Database • Optional: Scope (remove parent or children) No support for language versions! var request = ItemWebApiRequestBuilder.DeleteItemRequestWithPath(itemPath) .Database(“master”) .Build();
  • 28. Retrieving media 28 By default the mobile SDK returns the media item path Use the ItemWebApiRequestBuilder to download the media content // constructing a request string mediaPath = "/Images/green_mineraly1"; var request = ItemWebApiRequestBuilder.DownloadResourceRequestWithMediaPath(mediaPath).Build(); // processing the request using ( Stream response = awaitthis.session.DownloadMediaResourceAsync(request) ) { // working with the media resource stream }
  • 29. Uploading Media 29 Required parameters • Item name • File name • Resource data • Parent item path or parent GUID var request = ItemWebApiRequestBuilder.UploadResourceRequestWithParentId({GUID-ITEM-ID}) .ItemDataStream(stream) .ItemName("MyMediaItem") .FileName("myPhoto.jpg") .Build(); var response = await session.UploadMediaResourceAsync(request);
  • 30. HTML rendering request 30 Gets the HTML output of a Sitecore rendering Required parameters: • Source ID (Item ID) • Rendering ID var request =ItemWebApiRequestBuilder.RenderingHtmlRequestWithSourceAndRenderingId(sourceGUID, renderingGUID). Build();
  • 32. Sorry, the current SDK (1.0) does not support personalization
  • 33. Vision on Mobile and the SDK 33 Become the Sitecore integration layer for mobile apps • Upgrade the SDK to leverage the newest Sitecore features • No custom Sitecore integration needed • Easy maintainability and lower costs
  • 35. Use Mobile SDK to retrieve items Requires personalized data Do not modify Mobile SDK since this runs client side Modifications must be done server side Use plain Sitecore installation
  • 36. Sitecore.Services.Client provides a service layer on both the server and the client side of Sitecore applications that you use to develop data-driven applications. 36
  • 37. The idea 37 ServicesAPI Controller SC_ANALYTICS_GLOBAL_COOKIE “Register device” Store cookie on device ServicesAPI Controller xDB xDB Response data Request with included cookie Create request
  • 38. Sitecore ServicesWebAPI 38 Why should you use Sitecore.Services? • Anonymous user filters • Security policies • Handles logging Exposes two services • Item Service • Entity Service
  • 39. The first steps 39 • Create CustomWebClient • Add CookieContainer • Create SessionApi Controller • Register routes
  • 41. Challenges 41 Pass data within the Mobile SDK to the ItemWeb API Add personalization to the ItemWeb API
  • 43. Sending custom data using the Mobile SDK 43 Abuse fields field in a read request Mobile SDK method: AddFieldsToRead(string) ItemWeb API param: fields
  • 44. Receiving data in the ItemWeb API 44 Add custom processor in the itemWebApiGetField pipeline Add method to retrieve data
  • 45. Do something with the results 45
  • 48. 48 Questions? Do you have more questions ? Go to community.sitecore.net 1900+ professionals are there to help you