Xamarin XMPP 客户端库

Xamarin XMPP client library

我花了一整天的时间寻找可以在 Xamarin 中工作的 XMPP 客户端库。 具体来说,我正在开发一个带有便携式 class 库 (Xamarin Forms) 的跨平台应用程序。我经历了 Sharp.Xmpp, s22.xmp, agsSharp and UbietyXMPP

Xamarin 中的每一个都有其独特的插件问题。 是否有与 Xamarin 兼容的经过测试和试用的客户端库?

以下是从 NuGet 添加时每个客户端库的错误文本,在 agsXmpp 的情况下是编译时错误日志。

客户端库的错误消息:

AgsXmpp

Error 2 Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile? File name: 'System.Drawing.dll' at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel) at Xamarin.Android.Tasks.ResolveAssemblies.Execute() whattf.Droid

S22.Xmpp

Installing 'S22.Xmpp 1.0.0.0'. Successfully installed 'S22.Xmpp 1.0.0.0'. Adding 'S22.Xmpp 1.0.0.0' to whattf.Droid. Uninstalling 'S22.Xmpp 1.0.0.0'. Successfully uninstalled 'S22.Xmpp 1.0.0.0'. Install failed. Rolling back... Could not install package 'S22.Xmpp 1.0.0.0'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v6.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

XMPP

Installing 'XMPP 0.7.0.21'. Successfully installed 'XMPP 0.7.0.21'. Adding 'XMPP 0.7.0.21' to whattf.Droid. Uninstalling 'XMPP 0.7.0.21'. Successfully uninstalled 'XMPP 0.7.0.21'. Install failed. Rolling back... Could not install package 'XMPP 0.7.0.21'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v6.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

UbietyXMPP

Attempting to resolve dependency 'SharpZipLib (= 0.86.0)'. Attempting to resolve dependency 'Heijden.Dns (= 1.0.0)'. Attempting to resolve dependency 'Microsoft.Bcl (= 1.1.10)'. Attempting to resolve dependency 'Microsoft.Bcl.Build (= 1.0.14)'. Attempting to resolve dependency 'Microsoft.Bcl.Build (= 1.0.21)'. Attempting to resolve dependency 'Microsoft.Net.Http (= 2.2.29)'. Attempting to resolve dependency 'Serilog (= 1.5.9)'. Attempting to resolve dependency 'Serilog.Sinks.Seq (= 1.5.15)'. Attempting to resolve dependency 'libidn (= 1.29.1)'. Attempting to resolve dependency 'ExceptionAnalyzer (= 1.0.5)'. Attempting to resolve dependency 'Microsoft.AnalyzerPowerPack (= 1.0.1)'. Installing 'SharpZipLib 0.86.0'. Successfully installed 'SharpZipLib 0.86.0'. Installing 'Heijden.Dns 1.0.0'. Successfully installed 'Heijden.Dns 1.0.0'. Installing 'Microsoft.Bcl 1.1.10'. Successfully installed 'Microsoft.Bcl 1.1.10'. Installing 'Microsoft.Bcl.Build 1.0.21'. Successfully installed 'Microsoft.Bcl.Build 1.0.21'. Installing 'Microsoft.Net.Http 2.2.29'. Successfully installed 'Microsoft.Net.Http 2.2.29'. Installing 'Serilog 1.5.9'. Successfully installed 'Serilog 1.5.9'. Installing 'Serilog.Sinks.Seq 1.5.15'. Successfully installed 'Serilog.Sinks.Seq 1.5.15'. Installing 'libidn 1.29.1'. Successfully installed 'libidn 1.29.1'. Installing 'ExceptionAnalyzer 1.0.5'. Successfully installed 'ExceptionAnalyzer 1.0.5'. Installing 'Microsoft.AnalyzerPowerPack 1.0.1'. Successfully installed 'Microsoft.AnalyzerPowerPack 1.0.1'. Installing 'UbietyXMPP 0.7.37.0'. Successfully installed 'UbietyXMPP 0.7.37.0'. Adding 'SharpZipLib 0.86.0' to whattf.Droid. Uninstalling 'SharpZipLib 0.86.0'. Successfully uninstalled 'SharpZipLib 0.86.0'. Install failed. Rolling back... Could not install package 'SharpZipLib 0.86.0'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v6.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Xamarin 是完整 .NET 框架的一个子集,并使用自己的核心库。这就是为什么如果不为 Xamarin 重新编译它们并在需要时对源代码进行一些修改,您将无法获得这些库 运行。

MatriX XMPP 库可用于 Xamarin iOS 和 Android。但它是一个商业产品。