博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
XMPP: Registration gives error in iOS
阅读量:7226 次
发布时间:2019-06-29

本文共 2432 字,大约阅读时间需要 8 分钟。

  hot3.png

Hi I a using the below code for registration.

After xmppStream has been connected then I call this code inside didNotAuthenticate method:

- (void)xmppStream:(XMPPStream *)sender didNotAuthenticate:(NSXMLElement *)error{    NSString *jidStr = @"mohit@localhost";    NSString password = @"mohit";    XMPPJID *jid = [XMPPJID jidWithString:jidStr];    [self  xmppStream].myJID =jid;    if (self.xmppStream.supportsInBandRegistration) {        if (![self.xmppStream registerWithPassword:password error:&error]) {            NSLog(@"Registration error: %@", error);        }        else{            NSLog(@"Registration on progress");        }    }     else {        NSLog(@"Inband registration is not supported");    }}

in Console it prints the "Registration on progress" but in the below delegate method 

- (void)xmppStream:(XMPPStream *)sender didNotRegister:(NSXMLElement *)error{    DDXMLElement *errorXML = [error elementForName:@"error"];    NSString *errorCode  = [[errorXML attributeForName:@"code"] stringValue];    NSString *regError = [NSString stringWithFormat:@"ERROR :- %@",error.description];    NSLog(@"%@",regError);}

It gives error: 

mohit
mohit

I am using the ejabberd server. Please help me on this.

    

asked Jun 3 '14 at 21:11

8018

Just enable registration in ejabberd configuration file –   

Ejabberd configuration problem. –  

I don't think so. I have it set to register [{allow,all}] –  

add a comment

1 Answer

up vote2down vote

Following steps worked for me

  1. Go to your Ejabbered admin home page and login with admin credentials. ("")

  2. Click on "Access Rules" from left side menu.

  3. In the textfield at the bottom the page, paste the following access rule and click "Add New".

    {access, register_from, [{allow, all}]}

    This should eliminate the 403 forbidden error.

  4. After forbidden error is resolved one more error may arrive that is "Users are not allowed to register accounts so quickly". For this again copy and paste the following access rule in the same textfield and click "Add New".

    {access, register, [{all, allow}, {registration_timeout, infinity}]}

    This should eliminate the above error.

answered Oct 14 at 20:51

488412

Great! For me it worked to go to Virtual Host-Nodes-Modules-mod_register and add the access rules you described. –  

add a comment

转载于:https://my.oschina.net/iWage/blog/539649

你可能感兴趣的文章
8086的地址空间
查看>>
Android开发动画效果被遮掉的解决方法
查看>>
Apache2.2.17源码编译安装以及配置虚拟主机
查看>>
2017年开发语言排名
查看>>
读二进制表的显示 Binary Watch
查看>>
我的友情链接
查看>>
linux基础:10、基础命令(4)
查看>>
linux中强大的screen命令
查看>>
放开那个程序员
查看>>
构建高性能数据库缓存之Redis(一)
查看>>
测试驱动开发
查看>>
解决MySQL不允许从远程访问
查看>>
puppet介绍及基于httpd实例部署
查看>>
UML常用工具之三--RSA
查看>>
iis7 appcmd的基础命令及简单用法
查看>>
用脚本实现移动某目录下文件名符合指定规则的文件到另一个目录的功能
查看>>
关于SQL镜像配置报错
查看>>
终于找到解决方案了,Qt的Model/View Framework解析
查看>>
线程信息的获取和设置
查看>>
Databricks Scala 编程风格指南
查看>>