Hello,
API ID : 4C37F5D2-F3B8-7D4B-FFEC-6B49B441A000
I have a code that works I believe (I use it for several weeks now, with positive results),
and I’m trying right now to run the unitary tests I have to create temporary accounts.
But, several times in a row, I get timed out errors : register error : FAULT = ‘-1001’ [NSURLErrorDomain] <The request timed out.>
I’ve updated the backendless lib from github a few days ago to fix some other problem (I saw a message on the forum about the same issue, and the provided solution was to update to the lastest version of the lib).
Here is the code I use to register a user :
BackendlessUser* user = [BackendlessUser new];
user.email = email;
user.password = pword;
[backendless.userService registering:user response:^(BackendlessUser* bkUser) {
// save credentials locally
self.email = email;
self.pword = pword;
[self save];
// now the user is registered, he can login
[self login:email pword:pword endBlock:endBlock];
} error:^(Fault* fault) {
DLog(@"register error : %@", fault);
// report error if it's not a "account exists already"
if (!fault.faultCode || ![fault.faultCode isEqualToString:ERROR_CODE_REGISTER_EXISTS_ALREADY]) {
[[StatsManager main] reporFault:fault withTag:@"register" email:email];
}
endBlock(NO, fault.faultCode, fault.message);
}];
Would you have any information on your side ?
Thanks,
loïc b.
sorry for the code not formatted properly, but when I try to use the “code” button in the editor toolbar, it makes my browser freeze… (safari 9.1), even If I kill it and restart it.
Can you open https://api.backendless.com in a browser?
Also, try this in your code (before the call to initialize the app) (basically changing https to http):
backendless.hostURL = @“http://api.backendless.com”;
The test to open the https worked properly.
I would prefer keeping the https url, for security reasons.
The new version of the app has been validated by Apple, and for this week-end, I’m getting a lot of error reports (about 10% of the users, I use Crashlytics), indicating a time out on several requests, most of the times it’s the login, sometimes it’s other requests like the app init. In the logs, I can see that the devices are switching from cellular to wifi, and from wifi to cellular, which makes me think that there may be a link between those events.
I use Reachability to detect change in the network status. When the network status goes to 3G or wifi, I automatically :
- init the backendless service
- check the user token
- if it’s not valid, I make the user login
I suspect there’s something wrong in this process. Maybe I should stop doing that ?
actually, I just saw in Crashlytics that the time out issue also happens with save requests, and sometimes to “backendless.persistenceService find”.
I’m a bit puzzled, this look-like-random situation is not easy to understand.