ricky khatri ricky khatri - 4 years ago 175
Android Question

android smack subscribe user not working

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();
try {

Presence response = new Presence(Presence.Type.subscribe);

//roster.createEntry(_userName, _nickName, my_friends[]);
//addBuddy(_userName, _nickName, Friends);
} catch (Exception e) {

Answer Source

I have been trying to resolve a similar issue where the Roster List does not updated on accepting a friend's request. Steps followed :-

  1. Sent a friend request using Presence type as subscribe
  2. At the other end, while accepting the friend's request, a subscribed presence type is sent
  3. On receiving the subscribed Presence packet, another subscribed packet is sent back.

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download