Search code examples
androidxmppsmackasmackadhoc

aSmack ad-Hoc commands in Android app


I have implemented the app with some xmpp functions using aSmack package, for implementing ad-hoc commands, my app needs to receive and send these commands and my sending part works perfect, but I have a problem when I am receiving. in sender console I get "Forbidden" error and when I am seeing xml debug window, receiver sends some xml lines to sender which include "error type= 'Auth'" Do you have any idea what is my problem? I was thinking maybe I should add some permission in my manifest but I don't know which one, because I think my app doesn't have permission to execute ad-hoc command.


Solution

  • There was a stupid thing... when you create a class for registering command , the class should be extends "LocalCommand" and it will override automatically too many methods. one of those methods is "hasPermition()" and by default is returning "false" , I just changed it to true and everything works perfectly.