I can receive custom IQ packet using aSmack which might be developed according to smack 3.4.0.
Now I update the smack library to 4.2.0-beta2, and can’t receive.
NotificationIQProvider is like following:
public class NotificationIQProvider extends IQProvider {
public NotificationIQProvider() {
}
@Override
public NotificationIQ parse(XmlPullParser parser, int arg1)
throws XmlPullParserException, IOException, SmackException {
// TODO Auto-generated method stub;
NotificationIQ notification = new NotificationIQ();
for (boolean done = false; !done;) {
…
}
}
NotificationIQ is like following:
public class NotificationIQ extends IQ {
public static final String ELEMENT = “notifications”;
public static final String NAMESPACE = “androidrs:iq:notifications”;
public NotificationIQ() {
super(ELEMENT, NAMESPACE);
}
@Override
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder iqChildElementXmlStringBuilder) {
// TODO Auto-generated method stub
return null;
}
}
And I register my IQ provider:
ProviderManager.addIQProvider(“notifications”,
“androidrs:iq:notifications”,
new NotificationIQProvider());