allow toggle for disabling mobile param
This commit is contained in:
@@ -60,7 +60,7 @@ namespace PocketSharp
|
||||
RequestCode = requestCode;
|
||||
}
|
||||
|
||||
return new Uri(String.Format(authentificationUri, RequestCode, CallbackUri));
|
||||
return new Uri(String.Format(authentificationUri, RequestCode, CallbackUri, isMobileClient ? "1" : "0"));
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace PocketSharp
|
||||
RequestCode = requestCode;
|
||||
}
|
||||
|
||||
return new Uri(String.Format("{0}&force=signup", String.Format(authentificationUri, RequestCode, CallbackUri)));
|
||||
return new Uri(String.Format("{0}&force=signup", String.Format(authentificationUri, RequestCode, CallbackUri, isMobileClient ? "1" : "0")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,12 @@ namespace PocketSharp
|
||||
/// <summary>
|
||||
/// The authentification URL
|
||||
/// </summary>
|
||||
protected string authentificationUri = "https://getpocket.com/auth/authorize?request_token={0}&redirect_uri={1}&mobile=1";
|
||||
protected string authentificationUri = "https://getpocket.com/auth/authorize?request_token={0}&redirect_uri={1}&mobile={2}";
|
||||
|
||||
/// <summary>
|
||||
/// Indicates, whether this client is used for mobile or desktop
|
||||
/// </summary>
|
||||
protected bool isMobileClient = true;
|
||||
|
||||
/// <summary>
|
||||
/// callback URLi for API calls
|
||||
@@ -91,11 +96,20 @@ namespace PocketSharp
|
||||
/// <param name="callbackUri">The callback URL is called by Pocket after authentication</param>
|
||||
/// <param name="handler">The HttpMessage handler.</param>
|
||||
/// <param name="timeout">Request timeout (in seconds).</param>
|
||||
public PocketClient(string consumerKey, string accessCode = null, string callbackUri = null, HttpMessageHandler handler = null, int? timeout = null)
|
||||
/// <param name="isMobileClient">Indicates, whether this client is used for mobile or desktop</param>
|
||||
public PocketClient(
|
||||
string consumerKey,
|
||||
string accessCode = null,
|
||||
string callbackUri = null,
|
||||
HttpMessageHandler handler = null,
|
||||
int? timeout = null,
|
||||
bool isMobileClient = true)
|
||||
{
|
||||
// assign public properties
|
||||
ConsumerKey = consumerKey;
|
||||
|
||||
this.isMobileClient = isMobileClient;
|
||||
|
||||
// assign access code if submitted
|
||||
if (accessCode != null)
|
||||
{
|
||||
|
||||
@@ -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("3.0.2")]
|
||||
[assembly: AssemblyFileVersion("3.0.2")]
|
||||
[assembly: AssemblyVersion("3.1.0")]
|
||||
[assembly: AssemblyFileVersion("3.1.0")]
|
||||
Reference in New Issue
Block a user