i\'m using smack 3.1.0, and when i add a roster,i can\'t get subscription \"both\". who can help me? below is my code:
Roster.setDefaultSubscriptionMode(Rost
Same problem I was face but I got the solution how subscribe set 'both'
Below is sending subscription to user, when you added the user
Presence pres = new Presence(Presence.Type.subscribed);
pres.setPriority(24);
pres.setMode(Presence.Mode.available);
pres.setTo(friendJid);
RoosterConnection.getConnection().sendStanza(pres);
and Receiving end put below method in connection class and presenceChanged is default method of RosterListener.
@Override
public void presenceChanged(Presence presence) {
mBus.post(presence);
try {
Presence pres = new Presence(Presence.Type.subscribed);
pres.setTo(presence.getFrom());
RoosterConnection.getConnection().sendStanza(pres);
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}