AnsweredAssumed Answered

anonymous log in using account manager create account results in bad request error code 400 but wrks for existing account

Question asked by Mohamed aslam on Oct 6, 2015

hi anybody tell me or share me how to implement anonymous log in  please

 

 

HashMap<String, String> attr = new HashMap<String, String>();

  attr.put("first", firstName);

  attr.put("last", lastName);

  // attr.put("email", "email");

  attr.put("phone", phone);

  attr.put("name", firstName + " " + lastName);

 

 

  AccountManager mAccount = AccountManager.getInstance(connection);

 

  if (mAccount.supportsAccountCreation()) {

  mAccount.sensitiveOperationOverInsecureConnection(true);

 

  mAccount.createAccount(phone, phone,attr);

 

 

 

  return true;

  } else {

  Log.e("account", "Cannot create account");

  return false;

  }

 

 

  }

 

iam getting following error msg

 

 

10-06 18:35:37.155: D/SMACK(30892): RECV (1): <iq type="error" id="IRRUx-33" from="shaili" to="dbf0721a@shaili/dbf0721a"><query xmlns="jabber:iq:register"><username>+919056989895</username><phone>+9190569898 95</phone><last/><password>+919056989895</password><first>min</first><name>min </name></query><error code="400" type="modify"><bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></i RECV (1): <iq type="error" id="IRRUx-33" from="shaili" to="dbf0721a@shaili/dbf0721a"><query xmlns="jabber:iq:register"><username>+919056989895</username><phone>+9190569898 95</phone><last/><password>+919056989895</password><first>min</first><name>min </name></query><error code="400" type="modify"><bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>

Outcomes