Merge remote-tracking branch 'origin/master' into simple
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
### 4.1.4 (2014-07-18)
|
||||
|
||||
- Implement WebAuthenticationBroker-view toggle
|
||||
|
||||
### 4.1.3 (2014-06-25)
|
||||
|
||||
- Only dispose response if available
|
||||
|
||||
@@ -60,7 +60,32 @@ namespace PocketSharp
|
||||
RequestCode = requestCode;
|
||||
}
|
||||
|
||||
return new Uri(String.Format(authentificationUri, RequestCode, CallbackUri, isMobileClient ? "1" : "0", "login"));
|
||||
return new Uri(String.Format(authentificationUri, RequestCode, CallbackUri, isMobileClient ? "1" : "0", "login", useInsideWebAuthenticationBroker ? "1" : "0"));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Generate registration URI from requestCode
|
||||
/// Follow the steps as with GenerateAuthenticationUri, but for unregistered users
|
||||
/// </summary>
|
||||
/// <param name="requestCode">The requestCode. If no requestCode is supplied, the property from the PocketClient intialization is used.</param>
|
||||
/// <returns>A valid URI to redirect the user to.</returns>
|
||||
/// <exception cref="System.NullReferenceException">Call GetRequestCode() first to receive a request_code</exception>
|
||||
public Uri GenerateRegistrationUri(string requestCode = null)
|
||||
{
|
||||
// check if request code is available
|
||||
if (RequestCode == null && requestCode == null)
|
||||
{
|
||||
throw new NullReferenceException("Call GetRequestCode() first to receive a request_code");
|
||||
}
|
||||
|
||||
// override property with given param if available
|
||||
if (requestCode != null)
|
||||
{
|
||||
RequestCode = requestCode;
|
||||
}
|
||||
|
||||
return new Uri(String.Format(authentificationUri, RequestCode, CallbackUri, isMobileClient ? "1" : "0", "signup", useInsideWebAuthenticationBroker ? "1" : "0"));
|
||||
}
|
||||
|
||||
|
||||
@@ -99,30 +124,5 @@ namespace PocketSharp
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Generate registration URI from requestCode
|
||||
/// Follow the steps as with GenerateAuthenticationUri, but for unregistered users
|
||||
/// </summary>
|
||||
/// <param name="requestCode">The requestCode. If no requestCode is supplied, the property from the PocketClient intialization is used.</param>
|
||||
/// <returns>A valid URI to redirect the user to.</returns>
|
||||
/// <exception cref="System.NullReferenceException">Call GetRequestCode() first to receive a request_code</exception>
|
||||
public Uri GenerateRegistrationUri(string requestCode = null)
|
||||
{
|
||||
// check if request code is available
|
||||
if (RequestCode == null && requestCode == null)
|
||||
{
|
||||
throw new NullReferenceException("Call GetRequestCode() first to receive a request_code");
|
||||
}
|
||||
|
||||
// override property with given param if available
|
||||
if (requestCode != null)
|
||||
{
|
||||
RequestCode = requestCode;
|
||||
}
|
||||
|
||||
return new Uri(String.Format(authentificationUri, RequestCode, CallbackUri, isMobileClient ? "1" : "0", "signup"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,13 +45,18 @@ namespace PocketSharp
|
||||
/// <summary>
|
||||
/// The authentification URL
|
||||
/// </summary>
|
||||
protected string authentificationUri = "https://getpocket.com/auth/authorize?request_token={0}&redirect_uri={1}&mobile={2}&force={3}";
|
||||
protected string authentificationUri = "https://getpocket.com/auth/authorize?request_token={0}&redirect_uri={1}&mobile={2}&force={3}&webauthenticationbroker={4}";
|
||||
|
||||
/// <summary>
|
||||
/// Indicates, whether this client is used for mobile or desktop
|
||||
/// </summary>
|
||||
protected bool isMobileClient = true;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates, whether this client is used inside a broker (on Windows 8)
|
||||
/// </summary>
|
||||
protected bool useInsideWebAuthenticationBroker = true;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates, whether the last HTTP response is cached
|
||||
/// </summary>
|
||||
@@ -108,6 +113,7 @@ namespace PocketSharp
|
||||
/// <param name="handler">The HttpMessage handler.</param>
|
||||
/// <param name="timeout">Request timeout (in seconds).</param>
|
||||
/// <param name="isMobileClient">Indicates, whether this client is used for mobile or desktop</param>
|
||||
/// <param name="useInsideWebAuthenticationBroker">Indicates, whether this client is used inside a broker (on Windows 8), see: http://getpocket.com/developer/docs/getstarted/windows8 </param>
|
||||
/// <param name="parserUri">Enables the wrapper for the private Text Parser API</param>
|
||||
/// <param name="cacheHTTPResponseData">Caches the last HTTP response in public properties</param>
|
||||
public PocketClient(
|
||||
@@ -117,6 +123,7 @@ namespace PocketSharp
|
||||
HttpMessageHandler handler = null,
|
||||
int? timeout = null,
|
||||
bool isMobileClient = true,
|
||||
bool useInsideWebAuthenticationBroker = false,
|
||||
Uri parserUri = null,
|
||||
bool cacheHTTPResponseData = true)
|
||||
{
|
||||
@@ -124,6 +131,7 @@ namespace PocketSharp
|
||||
ConsumerKey = consumerKey;
|
||||
|
||||
this.isMobileClient = isMobileClient;
|
||||
this.useInsideWebAuthenticationBroker = useInsideWebAuthenticationBroker;
|
||||
this.cacheHTTPResponseData = cacheHTTPResponseData;
|
||||
|
||||
// assign access code if submitted
|
||||
|
||||
@@ -22,5 +22,5 @@
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("4.1.3")]
|
||||
[assembly: AssemblyFileVersion("4.1.3")]
|
||||
[assembly: AssemblyVersion("4.1.4")]
|
||||
[assembly: AssemblyFileVersion("4.1.4")]
|
||||
Reference in New Issue
Block a user