here i am trying to develop a chat app using xmpp and openfire server in windows phone 8.1
here am getting this error-
Exception sending XMPP class
ObjXmppClient.SendChatMessage(Message.Trim(), ReceiverJid); in this lin
e
1. how to test weather message is send or receive?using emulator in windows app or any other way?
2. is there any notification in server when message is received?
3.if it is not the right way to send messages please let me know
my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.Net.XMPP;
namespace WP8Xmpp
{
public partial class Output : PhoneApplicationPage
{
public Output()
{
InitializeComponent();
}
JID jidto = new JID("smitha@taurus");
public XMPPClient ObjXmppClient { get; set; }
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
if (NavigationContext.QueryString.ContainsKey("key"))
{
string val = NavigationContext.QueryString["key"];
if (val.Contains("success"))
{
}
}
}
private void SendXmppMessage(String Message, JID ReceiverJid)
{
try
{
ObjXmppClient = new XMPPClient();
ObjXmppClient.SendChatMessage(Message.Trim(), ReceiverJid);
ObjXmppClient.OnNewConversationItem += ObjXmppClient_OnNewConversationItem;
}
catch(Exception ex)
{
}
}
void ObjXmppClient_OnNewConversationItem(RosterItem item, bool bReceived, TextMessage msg)
{
if (bReceived)
{
txtscreen.Text = txttype.Text;
}
}
private void Button_Click(object sender, RoutedEventArgs e)
{
SendXmppMessage(txttype.Text, jidto);
}
}
}