Skip to content

Commit

Permalink
Change type of Link.Result from string to enum
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre3 committed Apr 15, 2018
1 parent 69229ac commit ad46c8d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
24 changes: 3 additions & 21 deletions Line.Messaging/Line.Messaging.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Company></Company>
<Product>Line Messaging API</Product>
<Description>SDK for the LINE Messaging API for C#</Description>
<Version>1.2.4</Version>
<Version>1.2.5</Version>
<Copyright>© 2018 pierre3</Copyright>
<PackageLicenseUrl>https://github.com/pierre3/LineMessagingApi/blob/master/LICENSE</PackageLicenseUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand All @@ -15,27 +15,9 @@
<IncludeSymbols>true</IncludeSymbols>
<RepositoryUrl>https://github.com/pierre3/LineMessagingApi/</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageReleaseNotes>Supports API update at 2018-02-08 and 2018-02-22
( https://developers.line.me/en/docs/messaging-api/release-notes/ )
<PackageReleaseNotes>Supports API update at 2018-03-29

1. Default actions can now be set for template messages

2. displayText property for postback actions released
- We have released the displayText property and have deprecated the text property for postback actions.
We recommend using displayText instead of the text property.
- (Breaking changes) In the constructor of PostbackTemplateAction,
the value of the text parameter is now set to the DisplayText property by default.
If you want to use the Text property as before, please set "useDisplayText" parameter to "false".

//Use the DisplayText property
PostbackTemplateAction("label", "data", "text");

//Use the Text property (Behavior of previous versions)
PostbackTemplateAction("label", "data", "text", useDisplayText : false);

3. Property for accessibility released
- Now you can specify text to be spoken using the label property for imagemap messages and rich menus when the accessibility feature is enabled on the client device.
This feature is supported on LINE iOS version 8.2.0 and later.</PackageReleaseNotes>
- Supports the account link feature.</PackageReleaseNotes>
<AssemblyVersion>1.2.4.0</AssemblyVersion>
<FileVersion>1.2.4.0</FileVersion>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Line.Messaging/LineMessagingClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ public async Task<IList<ResponseRichMenu>> GetRichMenuListAsync()
/// Returns the status code 200 and a link token. Link tokens are valid for 10 minutes and can only be used once.
/// Note: The validity period may change without notice.
/// </returns>
public async Task<string> IssueLinkToken(string userId)
public async Task<string> IssueLinkTokenAsync(string userId)
{
var response = await _client.PostAsync($"{_uri}/bot/user/{userId}/linkToken", null);
await response.EnsureSuccessStatusCodeAsync().ConfigureAwait(false);
Expand Down
4 changes: 2 additions & 2 deletions Line.Messaging/Webhooks/Link.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class Link
/// </item>
/// </list>
/// </summary>
public string Result { get; }
public LinkResult Result { get; }

/// <summary>
/// Specified nonce when verifying the user ID
Expand Down Expand Up @@ -44,7 +44,7 @@ public class Link
/// </param>
public Link(string result, string nonce)
{
Result = result;
Result = (result == "ok") ? LinkResult.OK : LinkResult.Failed;
Nonce = nonce;
}

Expand Down
9 changes: 9 additions & 0 deletions Line.Messaging/Webhooks/LinkResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Line.Messaging.Webhooks
{

public enum LinkResult
{
OK,
Failed
}
}

0 comments on commit ad46c8d

Please sign in to comment.