Files
2014-06-13 15:53:21 -07:00

1219 lines
34 KiB
HTML

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
<title>UPPlatform Class Reference</title>
<meta id="xcode-display" name="xcode-display" content="render"/>
<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
<meta name="generator" content="appledoc 2.2 (build 961)" />
</head>
<body>
<header id="top_header">
<div id="library" class="hideInXcode">
<h1><a id="libraryTitle" href="../index.html">UPPlatformSDK </a></h1>
<a id="developerHome" href="../index.html">Jawbone</a>
</div>
<div id="title" role="banner">
<h1 class="hideInXcode">UPPlatform Class Reference</h1>
</div>
<ul id="headerButtons" role="toolbar">
<li id="toc_button">
<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
</li>
<li id="jumpto_button" role="navigation">
<select id="jumpTo">
<option value="top">Jump To&#133;</option>
<option value="overview">Overview</option>
<option value="tasks">Tasks</option>
<option value="properties">Properties</option>
<option value="//api/name/currentSession">&nbsp;&nbsp;&nbsp;&nbsp;currentSession</option>
<option value="//api/name/enableNetworkLogging">&nbsp;&nbsp;&nbsp;&nbsp;enableNetworkLogging</option>
<option value="//api/name/redirectURI">&nbsp;&nbsp;&nbsp;&nbsp;redirectURI</option>
<option value="class_methods">Class Methods</option>
<option value="//api/name/basePlatformURL">&nbsp;&nbsp;&nbsp;&nbsp;+ basePlatformURL</option>
<option value="//api/name/currentPlatformVersion">&nbsp;&nbsp;&nbsp;&nbsp;+ currentPlatformVersion</option>
<option value="//api/name/sharedPlatform">&nbsp;&nbsp;&nbsp;&nbsp;+ sharedPlatform</option>
<option value="instance_methods">Instance Methods</option>
<option value="//api/name/endCurrentSession">&nbsp;&nbsp;&nbsp;&nbsp;- endCurrentSession</option>
<option value="//api/name/refreshAccessTokenWithClientID:clientSecret:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- refreshAccessTokenWithClientID:clientSecret:completion:</option>
<option value="//api/name/sendRequest:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- sendRequest:completion:</option>
<option value="//api/name/startSessionWithClientID:clientSecret:authScope:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- startSessionWithClientID:clientSecret:authScope:completion:</option>
<option value="//api/name/startSessionWithClientID:clientSecret:authScope:redirectURI:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- startSessionWithClientID:clientSecret:authScope:redirectURI:completion:</option>
<option value="//api/name/startSessionWithClientID:clientSecret:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- startSessionWithClientID:clientSecret:completion:</option>
<option value="//api/name/startSessionWithClientID:clientSecret:webView:authScope:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- startSessionWithClientID:clientSecret:webView:authScope:completion:</option>
<option value="//api/name/startSessionWithClientID:clientSecret:webView:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- startSessionWithClientID:clientSecret:webView:completion:</option>
<option value="//api/name/validateSessionWithCompletion:">&nbsp;&nbsp;&nbsp;&nbsp;- validateSessionWithCompletion:</option>
</select>
</li>
</ul>
</header>
<nav id="tocContainer" class="isShowingTOC">
<ul id="toc" role="tree">
<li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li>
<li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
</ul></li>
<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#properties">Properties</a></span><ul>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/currentSession">currentSession</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/enableNetworkLogging">enableNetworkLogging</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/redirectURI">redirectURI</a></span></li>
</ul></li>
<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#class_methods">Class Methods</a></span><ul>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/basePlatformURL">basePlatformURL</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/currentPlatformVersion">currentPlatformVersion</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/sharedPlatform">sharedPlatform</a></span></li>
</ul></li>
<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/endCurrentSession">endCurrentSession</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/refreshAccessTokenWithClientID:clientSecret:completion:">refreshAccessTokenWithClientID:clientSecret:completion:</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/sendRequest:completion:">sendRequest:completion:</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/startSessionWithClientID:clientSecret:authScope:completion:">startSessionWithClientID:clientSecret:authScope:completion:</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/startSessionWithClientID:clientSecret:authScope:redirectURI:completion:">startSessionWithClientID:clientSecret:authScope:redirectURI:completion:</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/startSessionWithClientID:clientSecret:completion:">startSessionWithClientID:clientSecret:completion:</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/startSessionWithClientID:clientSecret:webView:authScope:completion:">startSessionWithClientID:clientSecret:webView:authScope:completion:</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/startSessionWithClientID:clientSecret:webView:completion:">startSessionWithClientID:clientSecret:webView:completion:</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/validateSessionWithCompletion:">validateSessionWithCompletion:</a></span></li>
</ul></li>
</ul>
</nav>
<article>
<div id="contents" class="isShowingTOC" role="main">
<a title="UPPlatform Class Reference" name="top"></a>
<div class="main-navigation navigation-top">
<ul>
<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
</div>
<div id="header">
<div class="section-header">
<h1 class="title title-header">UPPlatform Class Reference</h1>
</div>
</div>
<div id="container">
<div class="section section-specification"><table cellspacing="0"><tbody>
<tr>
<td class="specification-title">Inherits from</td>
<td class="specification-value">NSObject</td>
</tr><tr>
<td class="specification-title">Declared in</td>
<td class="specification-value">UPPlatform.h<br />UPPlatform.m</td>
</tr>
</tbody></table></div>
<div class="section section-overview">
<a title="Overview" name="overview"></a>
<h2 class="subtitle subtitle-overview">Overview</h2>
<p>The base platform object, which manages the current session, authentication, and HTTP requests.</p>
</div>
<div class="section section-tasks">
<a title="Tasks" name="tasks"></a>
<h2 class="subtitle subtitle-tasks">Tasks</h2>
<ul class="task-list">
<li>
<span class="tooltip">
<code><a href="#//api/name/currentSession">&nbsp;&nbsp;currentSession</a></code>
</span>
<span class="task-item-suffix">property</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/redirectURI">&nbsp;&nbsp;redirectURI</a></code>
</span>
<span class="task-item-suffix">property</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/enableNetworkLogging">&nbsp;&nbsp;enableNetworkLogging</a></code>
</span>
<span class="task-item-suffix">property</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/sharedPlatform">+&nbsp;sharedPlatform</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/basePlatformURL">+&nbsp;basePlatformURL</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/currentPlatformVersion">+&nbsp;currentPlatformVersion</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/validateSessionWithCompletion:">&ndash;&nbsp;validateSessionWithCompletion:</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/refreshAccessTokenWithClientID:clientSecret:completion:">&ndash;&nbsp;refreshAccessTokenWithClientID:clientSecret:completion:</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/startSessionWithClientID:clientSecret:webView:completion:">&ndash;&nbsp;startSessionWithClientID:clientSecret:webView:completion:</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/startSessionWithClientID:clientSecret:webView:authScope:completion:">&ndash;&nbsp;startSessionWithClientID:clientSecret:webView:authScope:completion:</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/startSessionWithClientID:clientSecret:completion:">&ndash;&nbsp;startSessionWithClientID:clientSecret:completion:</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/startSessionWithClientID:clientSecret:authScope:completion:">&ndash;&nbsp;startSessionWithClientID:clientSecret:authScope:completion:</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/startSessionWithClientID:clientSecret:authScope:redirectURI:completion:">&ndash;&nbsp;startSessionWithClientID:clientSecret:authScope:redirectURI:completion:</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/endCurrentSession">&ndash;&nbsp;endCurrentSession</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/sendRequest:completion:">&ndash;&nbsp;sendRequest:completion:</a></code>
</span>
</li>
</ul>
</div>
<div class="section section-methods">
<a title="Properties" name="properties"></a>
<h2 class="subtitle subtitle-methods">Properties</h2>
<div class="section-method">
<a name="//api/name/currentSession" title="currentSession"></a>
<h3 class="subsubtitle method-title">currentSession</h3>
<div class="method-subsection brief-description">
<p>The current session, if active. Will be nil if the user has not authenticated.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, readonly) UPSession *currentSession</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>The current session, if active. Will be nil if the user has not authenticated.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">UPPlatform.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/enableNetworkLogging" title="enableNetworkLogging"></a>
<h3 class="subsubtitle method-title">enableNetworkLogging</h3>
<div class="method-subsection brief-description">
<p>Flag to enable extra network logging. Setting this to YES will log all HTTP requests and responses sent via UPPlatform.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) BOOL enableNetworkLogging</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Flag to enable extra network logging. Setting this to YES will log all HTTP requests and responses sent via UPPlatform.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">UPPlatform.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/redirectURI" title="redirectURI"></a>
<h3 class="subsubtitle method-title">redirectURI</h3>
<div class="method-subsection brief-description">
<p>The redirect URI used during authentication.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, readonly) NSString *redirectURI</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>The redirect URI used during authentication.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">UPPlatform.h</code><br />
</div>
</div>
</div>
<div class="section section-methods">
<a title="Class Methods" name="class_methods"></a>
<h2 class="subtitle subtitle-methods">Class Methods</h2>
<div class="section-method">
<a name="//api/name/basePlatformURL" title="basePlatformURL"></a>
<h3 class="subsubtitle method-title">basePlatformURL</h3>
<div class="method-subsection brief-description">
<p>The base URL for the platform.</p>
</div>
<div class="method-subsection method-declaration"><code>+ (NSString *)basePlatformURL</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>The base URL for the platform.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">UPPlatform.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/currentPlatformVersion" title="currentPlatformVersion"></a>
<h3 class="subsubtitle method-title">currentPlatformVersion</h3>
<div class="method-subsection brief-description">
<p>The current version of the API.</p>
</div>
<div class="method-subsection method-declaration"><code>+ (NSString *)currentPlatformVersion</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>The current version of the API.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">UPPlatform.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/sharedPlatform" title="sharedPlatform"></a>
<h3 class="subsubtitle method-title">sharedPlatform</h3>
<div class="method-subsection brief-description">
<p>The singleton for the shared platform.</p>
</div>
<div class="method-subsection method-declaration"><code>+ (UPPlatform *)sharedPlatform</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>The singleton for the shared platform.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">UPPlatform.h</code><br />
</div>
</div>
</div>
<div class="section section-methods">
<a title="Instance Methods" name="instance_methods"></a>
<h2 class="subtitle subtitle-methods">Instance Methods</h2>
<div class="section-method">
<a name="//api/name/endCurrentSession" title="endCurrentSession"></a>
<h3 class="subsubtitle method-title">endCurrentSession</h3>
<div class="method-subsection brief-description">
<p>Ends the current session, clearing the session and access token.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)endCurrentSession</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Ends the current session, clearing the session and access token.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">UPPlatform.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/refreshAccessTokenWithClientID:clientSecret:completion:" title="refreshAccessTokenWithClientID:clientSecret:completion:"></a>
<h3 class="subsubtitle method-title">refreshAccessTokenWithClientID:clientSecret:completion:</h3>
<div class="method-subsection brief-description">
<p>Refreshes the current access token.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)refreshAccessTokenWithClientID:(NSString *)<em>clientID</em> clientSecret:(NSString *)<em>clientSecret</em> completion:(UPPlatformSessionCompletion)<em>completion</em></code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Refreshes the current access token.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">UPPlatform.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/sendRequest:completion:" title="sendRequest:completion:"></a>
<h3 class="subsubtitle method-title">sendRequest:completion:</h3>
<div class="method-subsection brief-description">
<p>Sends an HTTP request, setting appropriate authentication headers based on the current session.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)sendRequest:(UPURLRequest *)<em>request</em> completion:(UPPlatformRequestCompletion)<em>completion</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<dl class="argument-def parameter-def">
<dt><em>request</em></dt>
<dd><p>The request to send.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>completion</em></dt>
<dd><p>The request completion block after receiving a response or error.</p></dd>
</dl>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Sends an HTTP request, setting appropriate authentication headers based on the current session.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">UPPlatform.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/startSessionWithClientID:clientSecret:authScope:completion:" title="startSessionWithClientID:clientSecret:authScope:completion:"></a>
<h3 class="subsubtitle method-title">startSessionWithClientID:clientSecret:authScope:completion:</h3>
<div class="method-subsection brief-description">
<p>Starts a user&rsquo;s session.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)startSessionWithClientID:(NSString *)<em>clientID</em> clientSecret:(NSString *)<em>clientSecret</em> authScope:(UPPlatformAuthScope)<em>authScope</em> completion:(UPPlatformSessionCompletion)<em>completion</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<dl class="argument-def parameter-def">
<dt><em>clientID</em></dt>
<dd><p>The client ID provided during application signup.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>clientSecret</em></dt>
<dd><p>The client secret provided during application signup.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>authScope</em></dt>
<dd><p>Options to request specific auth scopes during authentication. Defaults to UPPlatformAuthScopeBasicRead.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>completion</em></dt>
<dd><p>The session completion block.</p></dd>
</dl>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Starts a user&rsquo;s session.</p>
<p>This will present a UIWebView to perform the OAuth authentication flow, taking care of getting the access token for HTTP requests.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">UPPlatform.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/startSessionWithClientID:clientSecret:authScope:redirectURI:completion:" title="startSessionWithClientID:clientSecret:authScope:redirectURI:completion:"></a>
<h3 class="subsubtitle method-title">startSessionWithClientID:clientSecret:authScope:redirectURI:completion:</h3>
<div class="method-subsection brief-description">
<p>Starts a user&rsquo;s session.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)startSessionWithClientID:(NSString *)<em>clientID</em> clientSecret:(NSString *)<em>clientSecret</em> authScope:(UPPlatformAuthScope)<em>authScope</em> redirectURI:(NSString *)<em>redirectURI</em> completion:(UPPlatformSessionCompletion)<em>completion</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<dl class="argument-def parameter-def">
<dt><em>clientID</em></dt>
<dd><p>The client ID provided during application signup.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>clientSecret</em></dt>
<dd><p>The client secret provided during application signup.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>authScope</em></dt>
<dd><p>Options to request specific auth scopes during authentication. Defaults to UPPlatformAuthScopeBasicRead.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>redirectURI</em></dt>
<dd><p>An alternate redirect URI used during authentication. This is not common.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>completion</em></dt>
<dd><p>The session completion block.</p></dd>
</dl>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Starts a user&rsquo;s session.</p>
<p>This will present a UIWebView to perform the OAuth authentication flow, taking care of getting the access token for HTTP requests.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">UPPlatform.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/startSessionWithClientID:clientSecret:completion:" title="startSessionWithClientID:clientSecret:completion:"></a>
<h3 class="subsubtitle method-title">startSessionWithClientID:clientSecret:completion:</h3>
<div class="method-subsection brief-description">
<p>Starts a user&rsquo;s session.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)startSessionWithClientID:(NSString *)<em>clientID</em> clientSecret:(NSString *)<em>clientSecret</em> completion:(UPPlatformSessionCompletion)<em>completion</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<dl class="argument-def parameter-def">
<dt><em>clientID</em></dt>
<dd><p>The client ID provided during application signup.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>clientSecret</em></dt>
<dd><p>The client secret provided during application signup.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>completion</em></dt>
<dd><p>The session completion block.</p></dd>
</dl>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Starts a user&rsquo;s session.</p>
<p>This will present a UIWebView to perform the OAuth authentication flow, taking care of getting the access token for HTTP requests.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">UPPlatform.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/startSessionWithClientID:clientSecret:webView:authScope:completion:" title="startSessionWithClientID:clientSecret:webView:authScope:completion:"></a>
<h3 class="subsubtitle method-title">startSessionWithClientID:clientSecret:webView:authScope:completion:</h3>
<div class="method-subsection brief-description">
<p>Starts a user&rsquo;s session.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)startSessionWithClientID:(NSString *)<em>clientID</em> clientSecret:(NSString *)<em>clientSecret</em> webView:(WebView *)<em>webView</em> authScope:(UPPlatformAuthScope)<em>authScope</em> completion:(UPPlatformSessionCompletion)<em>completion</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<dl class="argument-def parameter-def">
<dt><em>clientID</em></dt>
<dd><p>The client ID provided during application signup.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>clientSecret</em></dt>
<dd><p>The client secret provided during application signup.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>webView</em></dt>
<dd><p>An existing WebView to perform authentication. Will create a new window with a single WebView if nil.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>authScope</em></dt>
<dd><p>Options to request specific auth scopes during authentication. Defaults to UPPlatformAuthScopeBasicRead.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>completion</em></dt>
<dd><p>The session completion block.</p></dd>
</dl>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Starts a user&rsquo;s session.</p>
<p>This will present a WebView to perform the OAuth authentication flow, taking care of getting access token for HTTP requests.
An existing WebView can be provided, or one will be created in a new window if nil is provided.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">UPPlatform.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/startSessionWithClientID:clientSecret:webView:completion:" title="startSessionWithClientID:clientSecret:webView:completion:"></a>
<h3 class="subsubtitle method-title">startSessionWithClientID:clientSecret:webView:completion:</h3>
<div class="method-subsection brief-description">
<p>Starts a user&rsquo;s session.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)startSessionWithClientID:(NSString *)<em>clientID</em> clientSecret:(NSString *)<em>clientSecret</em> webView:(WebView *)<em>webView</em> completion:(UPPlatformSessionCompletion)<em>completion</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<dl class="argument-def parameter-def">
<dt><em>clientID</em></dt>
<dd><p>The client ID provided during application signup.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>clientSecret</em></dt>
<dd><p>The client secret provided during application signup.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>webView</em></dt>
<dd><p>An existing WebView to perform authentication. Will create a new window with a single WebView if nil.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>completion</em></dt>
<dd><p>The session completion block.</p></dd>
</dl>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Starts a user&rsquo;s session.</p>
<p>This will present a WebView to perform the OAuth authentication flow, taking care of getting access token for HTTP requests.
An existing WebView can be provided, or one will be created in a new window if nil is provided.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">UPPlatform.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/validateSessionWithCompletion:" title="validateSessionWithCompletion:"></a>
<h3 class="subsubtitle method-title">validateSessionWithCompletion:</h3>
<div class="method-subsection brief-description">
<p>Validates the current session.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)validateSessionWithCompletion:(UPPlatformSessionCompletion)<em>completion</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<dl class="argument-def parameter-def">
<dt><em>completion</em></dt>
<dd><p>The session completion block. If the session object passed to the completion block is not nil, the session is valid and API requests can be made.</p></dd>
</dl>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Validates the current session.</p>
<p>This method is useful in order to prevent any API requests from unexpectedly returning a 401 Unauthorized response when the user&rsquo;s access token is not valid.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">UPPlatform.h</code><br />
</div>
</div>
</div>
</div>
<div class="main-navigation navigation-bottom">
<ul>
<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
</div>
<div id="footer">
<hr />
<div class="footer-copyright">
<p><span class="copyright">&copy; 2014 Jawbone. All rights reserved. (Last updated: 2014-06-13)</span><br />
<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 961)</a>.</span></p>
</div>
</div>
</div>
</article>
<script type="text/javascript">
function jumpToChange()
{
window.location.hash = this.options[this.selectedIndex].value;
}
function toggleTOC()
{
var contents = document.getElementById('contents');
var tocContainer = document.getElementById('tocContainer');
if (this.getAttribute('class') == 'open')
{
this.setAttribute('class', '');
contents.setAttribute('class', '');
tocContainer.setAttribute('class', '');
window.name = "hideTOC";
}
else
{
this.setAttribute('class', 'open');
contents.setAttribute('class', 'isShowingTOC');
tocContainer.setAttribute('class', 'isShowingTOC');
window.name = "";
}
return false;
}
function toggleTOCEntryChildren(e)
{
e.stopPropagation();
var currentClass = this.getAttribute('class');
if (currentClass == 'children') {
this.setAttribute('class', 'children open');
}
else if (currentClass == 'children open') {
this.setAttribute('class', 'children');
}
return false;
}
function tocEntryClick(e)
{
e.stopPropagation();
return true;
}
function init()
{
var selectElement = document.getElementById('jumpTo');
selectElement.addEventListener('change', jumpToChange, false);
var tocButton = document.getElementById('table_of_contents');
tocButton.addEventListener('click', toggleTOC, false);
var taskTreeItem = document.getElementById('task_treeitem');
if (taskTreeItem.getElementsByTagName('li').length > 0)
{
taskTreeItem.setAttribute('class', 'children');
taskTreeItem.firstChild.setAttribute('class', 'disclosure');
}
var tocList = document.getElementById('toc');
var tocEntries = tocList.getElementsByTagName('li');
for (var i = 0; i < tocEntries.length; i++) {
tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false);
}
var tocLinks = tocList.getElementsByTagName('a');
for (var i = 0; i < tocLinks.length; i++) {
tocLinks[i].addEventListener('click', tocEntryClick, false);
}
if (window.name == "hideTOC") {
toggleTOC.call(tocButton);
}
}
window.onload = init;
// If showing in Xcode, hide the TOC and Header
if (navigator.userAgent.match(/xcode/i)) {
document.getElementById("contents").className = "hideInXcode"
document.getElementById("tocContainer").className = "hideInXcode"
document.getElementById("top_header").className = "hideInXcode"
}
</script>
</body>
</html>