Skip to content

Commit 16292b0

Browse files
committed
Fix #9
1 parent 0456192 commit 16292b0

File tree

6 files changed

+53
-35
lines changed

6 files changed

+53
-35
lines changed

Realtime/Realtime.csproj

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<PropertyGroup>
4-
<TargetFramework>netstandard2.1</TargetFramework>
5-
<PackageId>realtime-csharp</PackageId>
6-
<Authors>Joseph Schultz &lt;[email protected]&gt;</Authors>
7-
<Description>Realtime-csharp is written as a client library for supabase/realtime.</Description>
8-
<RootNamespace>Supabase.Realtime</RootNamespace>
9-
<PackageVersion>1.0.4</PackageVersion>
10-
<PackOnBuild>true</PackOnBuild>
11-
<Copyright>MIT</Copyright>
12-
<PackageIconUrl>https://avatars.githubusercontent.com/u/54469796?s=200&amp;v=4</PackageIconUrl>
13-
<NeutralLanguage>en</NeutralLanguage>
14-
<PackageLicenseUrl>https://github.com/supabase/realtime-csharp/blob/master/LICENSE</PackageLicenseUrl>
15-
<Owners>Joseph Schultz &lt;[email protected]&gt;</Owners>
16-
<PackageProjectUrl>https://github.com/supabase/realtime-csharp</PackageProjectUrl>
17-
<Summary>Realtime-csharp is written as a client library for supabase/realtime.</Summary>
18-
<PackageTags>supabase, realtime, phoenix</PackageTags>
19-
<Title>realtime-csharp</Title>
20-
<ReleaseVersion>1.0.4</ReleaseVersion>
21-
</PropertyGroup>
22-
23-
<ItemGroup>
24-
<PackageReference Include="postgrest-csharp" Version="1.0.6" />
25-
<PackageReference Include="WebSocketSharp-netstandard" Version="1.0.1" />
26-
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
27-
</ItemGroup>
28-
<ItemGroup>
29-
<Folder Include="Attributes\" />
30-
</ItemGroup>
31-
</Project>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk">
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.1</TargetFramework>
5+
<PackageId>realtime-csharp</PackageId>
6+
<Authors>Joseph Schultz &lt;[email protected]&gt;</Authors>
7+
<Description>Realtime-csharp is written as a client library for supabase/realtime.</Description>
8+
<RootNamespace>Supabase.Realtime</RootNamespace>
9+
<PackageVersion>1.0.4</PackageVersion>
10+
<PackOnBuild>true</PackOnBuild>
11+
<Copyright>MIT</Copyright>
12+
<PackageIconUrl>https://avatars.githubusercontent.com/u/54469796?s=200&amp;v=4</PackageIconUrl>
13+
<NeutralLanguage>en</NeutralLanguage>
14+
<PackageLicenseUrl>https://github.com/supabase/realtime-csharp/blob/master/LICENSE</PackageLicenseUrl>
15+
<Owners>Joseph Schultz &lt;[email protected]&gt;</Owners>
16+
<PackageProjectUrl>https://github.com/supabase/realtime-csharp</PackageProjectUrl>
17+
<Summary>Realtime-csharp is written as a client library for supabase/realtime.</Summary>
18+
<PackageTags>supabase, realtime, phoenix</PackageTags>
19+
<Title>realtime-csharp</Title>
20+
<ReleaseVersion>1.0.5</ReleaseVersion>
21+
</PropertyGroup>
22+
<PropertyGroup Condition=" '$(Version)' == '' ">
23+
<VersionPrefix Condition=" '$(VersionPrefix)' == '' ">1.0.5</VersionPrefix>
24+
<VersionSuffix Condition=" '$(VersionSuffix)' == '' ">
25+
</VersionSuffix>
26+
<Version Condition=" '$(VersionSuffix)' != '' ">$(VersionPrefix)-$(VersionSuffix)</Version>
27+
<Version Condition=" '$(Version)' == '' ">$(VersionPrefix)</Version>
28+
</PropertyGroup>
29+
<ItemGroup>
30+
<PackageReference Include="postgrest-csharp" Version="1.0.6" />
31+
<PackageReference Include="WebSocketSharp-netstandard" Version="1.0.1" />
32+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
33+
</ItemGroup>
34+
<ItemGroup>
35+
<Folder Include="Attributes\" />
36+
</ItemGroup>
37+
</Project>

Realtime/Socket.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ public Socket(string endpoint, ClientOptions options = null)
7676
options = new ClientOptions();
7777
}
7878

79+
options.Headers.Add("X-Client-Info", Utils.GetAssemblyVersion());
80+
7981
this.options = options;
8082
}
8183

Realtime/Utils.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using System.Reflection;
45

56
namespace Supabase.Realtime
67
{
@@ -43,5 +44,14 @@ public static string GenerateChannelTopic(string database, string schema, string
4344

4445
return channel;
4546
}
47+
48+
public static string GetAssemblyVersion()
49+
{
50+
var assembly = typeof(Client).Assembly;
51+
var informationVersion = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
52+
var name = assembly.GetName().Name;
53+
54+
return $"{name.ToString().ToLower()}-csharp/{informationVersion}";
55+
}
4656
}
4757
}

RealtimeExample/RealtimeExample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>netcoreapp3.1</TargetFramework>
6-
<ReleaseVersion>1.0.4</ReleaseVersion>
6+
<ReleaseVersion>1.0.5</ReleaseVersion>
77
</PropertyGroup>
88

99
<ItemGroup>

RealtimeTests/RealtimeTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>netcoreapp3.1</TargetFramework>
55

66
<IsPackable>false</IsPackable>
7-
<ReleaseVersion>1.0.4</ReleaseVersion>
7+
<ReleaseVersion>1.0.5</ReleaseVersion>
88
</PropertyGroup>
99

1010
<ItemGroup>

realtime-csharp.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.808.2
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Realtime", "Realtime\Realtime.csproj", "{194E6AEF-7ABB-41AD-BB96-59B5995B62A5}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Realtime", "Realtime\Realtime.csproj", "{194E6AEF-7ABB-41AD-BB96-59B5995B62A5}"
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RealtimeTests", "RealtimeTests\RealtimeTests.csproj", "{AD3699C8-F50D-44B3-9DF3-2365AF8B8BB3}"
99
EndProject
@@ -41,6 +41,6 @@ Global
4141
SolutionGuid = {5CFFD342-4DBD-4D79-BD1C-2183939DBFD4}
4242
EndGlobalSection
4343
GlobalSection(MonoDevelopProperties) = preSolution
44-
version = 1.0.4
44+
version = 1.0.5
4545
EndGlobalSection
4646
EndGlobal

0 commit comments

Comments
 (0)