I'm not quite sure if I'm reading the random key properly, because I'm using the right user name and password but still can't login.
Code: Select all
- (void) onRandomKey:(INFSmartFoxSFSEvent *)evt
{
NSString *md5ma_pass = [self md5ma:@"1"];
//NSString *key = [[NSString alloc] initWithUTF8String: [[evt.params objectForKey:@"key"] UTF8String]];
//NSString *key = [[NSString alloc] initWithString: [evt.params objectForKey:@"key"]];
//NSString *key = [[NSString alloc] initWithData: [evt.params objectForKey:@"key"] encoding:NSASCIIStringEncoding ];
NSString *key = [[NSString alloc] initWithData: [evt.params objectForKey:@"key"] encoding:NSUTF8StringEncoding ];
NSString *md5ma_pass_key = [md5ma_pass stringByAppendingString: key];
[smartFox login:smartFox.defaultZone name: @"1" pass: [self md5ma: md5ma_pass_key]];
}
Code: Select all
<msg t='sys'><body action='rndK' r='-1'><k>gVtS\L^eAkmNiOd_J\</k></body></msg>
<msg t='sys'><body action='rndK' r='-1'><k>AoLzBKOzirMa[vetTcK</k></body></msg>
cheers,
chris