2002 Error on first initApp

I’m using the Objective-C SDK, and on my first initApp, I get a 2002 error. I’ve triple-checked my iOS secret, app ID, and version number, but I still receive the error when trying to create a user by following your example code.

[backendless initApp:@"FB6FBF05-DF5A-xxxx-xxxx-96ABD32B2E00" secret:@"BAD79FBD-xxxx-xxxx-xxxx-8CA4FA9B2A00" version:@"v1"];

 
 // Testing SDK
 BackendlessUser *user = [BackendlessUser new];
 user.name = @"Ryan Cohen";
 user.email = @"rc@me.com";
 user.password = @"password";
 
 @try {
 user = [backendless.userService registering:user];
 } @catch (Fault *fault) {
 NSLog(@"Fault: %@", fault);
 } @finally {
 NSLog(@"Finally...");
 }


The error code indicates that the combination of application id, secret key and/or version name is wrong.

I know this. I’m asking why this is occurring when all of the above are correct.

Do you use it with the cloud version of Backendless or Standalone?

I’m using the official iOS SDK

I am talking about the backend. The Cloud version is hosted on our servers, Standalone can be installed on yours.

In that case I believe it’s standalone…what does that change with the init?

It doesn’t change init, but you need to set the server URL. See step 11 here:

https://backendless.com/products/standalone-backendless-quick-start-guide/

Solved. Thank you Mark!

Also, can’t get requests working. There are the errors I’m receiving when trying to achieve the above code I had included.

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file. 
 
FAULT = '-1022' [NSURLErrorDomain] <The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.>


What could be causing this? I have the IP address setup correctly and passing it in like this:

 
 
 
 
 
 
 
 
[backendless setHostUrl:MST_HOST_URL];


Where the host url is a macro defined as "http://10.99.0.179:80/api";
An error also persists even when I change “http” to “https”

Do you have SSL certificate installed on the server?

I’m not sure…it’s the company’s I’m working for. If there was, how would I go about setting that in the SDK?

Hi Ryan!

This error “The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.”
is not related to Backendless backend or Backendless IOS SDK.
If http connection is ok for you, just configure your Info.plist:
http://stackoverflow.com/questions/32631184/the-resource-could-not-be-loaded-because-the-app-transport-security-policy-requi
The simplest way is to add

 <key>NSAppTransportSecurity</key>
 <dict>
 <key>NSAllowsArbitraryLoads</key>
 <true></true>
 </dict>

in Info.plist file.

UPD: Info how to configure SSL for standalone server:

http://support.backendless.com/t/backendless-v3-x-standalone-add-ssl-support
http://support.backendless.com/t/standalone-ssl

Regards,
Kate.