Subject: Xamarin Android Example Client not working
Hi, I'm trying to implement a Xamarin.Forms client using Matrix vNext.
At first I used the example Xamarin.Android MiniClientAndroid, but I got:
Then I tried using Matrix vNext, Matrix Services, Matrix Extensions nugget packages on a Xamarin Forms project.
On UWP everything works as expected.
On Android it isn't connecting and I get again:
Example of my code:
Any help is greatly appreciated.
Nicholas
At first I used the example Xamarin.Android MiniClientAndroid, but I got:
[libc] Access denied finding property "net.dns1"
[libc] Access denied finding property "net.dns2"
[libc] Access denied finding property "net.dns3"
[libc] Access denied finding property "net.dns4"
[libc] Access denied finding property "net.dns2"
[libc] Access denied finding property "net.dns3"
[libc] Access denied finding property "net.dns4"
Then I tried using Matrix vNext, Matrix Services, Matrix Extensions nugget packages on a Xamarin Forms project.
On UWP everything works as expected.
On Android it isn't connecting and I get again:
[libc] Access denied finding property "net.dns1"
[libc] Access denied finding property "net.dns2"
[libc] Access denied finding property "net.dns3"
[libc] Access denied finding property "net.dns4"
[libc] Access denied finding property "net.dns5"
[libc] Access denied finding property "net.dns6"
[libc] Access denied finding property "net.dns7"
[libc] Access denied finding property "net.dns8"
[libc] Access denied finding property "net.dns2"
[libc] Access denied finding property "net.dns3"
[libc] Access denied finding property "net.dns4"
[libc] Access denied finding property "net.dns5"
[libc] Access denied finding property "net.dns6"
[libc] Access denied finding property "net.dns7"
[libc] Access denied finding property "net.dns8"
Example of my code:
- public async Task InitMessagingService()
- {
- // setup XmppClient with some properties
- XmppClient = new XmppClient
- {
- Username = "nrall",
- Password = "testtest",
- XmppDomain = "0day.im",
- // setting the resolver to use the Srv resolver is optional, but recommended
- };
- // connect so the server
- await XmppClient.ConnectAsync();
- //// request roster (contact list). This is optional,
- //// but most chat clients do this on startup
- var rosterIqResult = await XmppClient.RequestRosterAsync();
- var rosterItems
- = rosterIqResult
- .Query
- .Cast<Roster>()
- .GetRoster();
- // enumerate over the items and build your contact list or GUI
- foreach (var ri in rosterItems)
- {
- // we use AutoMapper here to map the XMPP
- // rosterItem to our Contact ViewModel
- var contact = ri;
- //contacts.AddOrReplace(contact, c => c.Jid == contact.Jid);
- // Dump some info
- Debug.WriteLine($"Jid: {ri.Jid}");
- Debug.WriteLine($"Name: {ri.Name}");
- }
Any help is greatly appreciated.
Nicholas