Forum Xamarin.Forms

Unable to send chat message using xamarin QuickBlock sdk

tutugeorgetutugeorge USMember ✭✭

I am trying to integrate Chat feature into my Xamarin Forms applications.

Here is the code i am using
var boolStatus = await App.QbProvider.GetBaseSession();
var device = DependencyService.Get();
var deviceUid = device.GetIdentifier();
var userId = await App.QbProvider.LoginWithLoginValueAsync("username", "password", Platform.ios, deviceUid);
var user = await App.QbProvider.GetUserAsync(userId);
var dialList = await App.QbProvider.GetDialogAsync(new int[] {maid, otherid });
var dial = await App.QbProvider.GetDialogAsync(dialList.Id);

MessageProvider.Instance.ConnetToXmpp(user.Id, "password");
privateChatManager = App.QbProvider.GetXmppClient().GetPrivateChatManager(otherid, dialList.Id);

i am able to get the user id by giving username and password. And also able to retrieve any messages previously send.
But unable to send any new chat message.

The error i am getting is "Not connected to XMPP server."



Sign In or Register to comment.