Subject: gmail notifier
Hi,
I'm trying to implement gmail notifications ( per here: http://code.google.com/apis/talk/jep_extensions/gmail.html ). I used a DiscoInfoIQ to query the server for the feature and verified in the response that it is supported. Now I'm trying to query for new mail. I need to construct an iq stanza similar to this:
My code looks like this:
The line in red is throwing a null reference exception and I don't see why.
What are the steps to create and send a custom iq? Am I completely off?
Thanks for any help.
I'm trying to implement gmail notifications ( per here: http://code.google.com/apis/talk/jep_extensions/gmail.html ). I used a DiscoInfoIQ to query the server for the feature and verified in the response that it is supported. Now I'm trying to query for new mail. I need to construct an iq stanza similar to this:
- <iq type='get'
- from='romeo@gmail.com/orchard'
- to='romeo@gmail.com'
- id='mail-request-1'>
- <query xmlns='google:mail:notify'
- />
- </iq>
My code looks like this:
- private void queryForEmail()
- {
- emailQuery.Type = IqType.get;
- emailQuery.From = xmpp.MyJID;
- emailQuery.To = xmpp.MyJID;
- emailQuery.Id = "newMailQuery";
- emailQuery.Query.SetNamespace("google:mail:notify"); // null reference exception
- xmpp.Send(emailQuery);
- }
What are the steps to create and send a custom iq? Am I completely off?
Thanks for any help.
This post was edited on 2011-06-13, 11:36 by Alex.