i am using below code to send friend request to any user its working fine but i am not able to find the connected user from roster list.
Now i want to know how could i identify new requested friend in roster list.
Roster roster = XMPPSmackConnection.getInstance().connection.getRoster();
roster.setSubscriptionMode(Roster.SubscriptionMode.manual);
try {
if(!_userName.contains("@"))
_userName=_userName+"@204.93.197.136";
Presence response = new Presence(Presence.Type.subscribe);
response.setTo(_userName);
XMPPSmackConnection.getInstance().connection.sendPacket(response);
//roster.createEntry(_userName, _nickName, my_friends[]);
//addBuddy(_userName, _nickName, Friends);
} catch (Exception e) {
_progDailog.dismiss();
e.printStackTrace();
}
I have been trying to resolve a similar issue where the Roster List does not updated on accepting a friend's request. Steps followed :-
The server's roster list gets updated immediately by Subscription type as Both but the roster entries are not. Also, the roster's subscription Mode is set to manual and it also has a PacketListener attached to it.
Please can you provide some help by contributing your solution to this problem? It would be of great help.
Thanks and Regards, Vaidehi