I am working on setting up a test application with backendless. I followed the quick start guide here.
When I run the app it crashes on:
-[Invoker invokeSync:method:args:]
I am using Swift 2.2 and Xcode 7.3.1
I am working on setting up a test application with backendless. I followed the quick start guide here.
When I run the app it crashes on:
-[Invoker invokeSync:method:args:]
I am using Swift 2.2 and Xcode 7.3.1
Hi Caleb,
I have assigned an internal ticket to our iOS dev, soon he’ll contact with you to help you resolve this issue.
Regards,
Stanislav
Hi Caleb,
I just created a sample project with pod ‘Backendless’ and shared it for you. It works fine for me, please check it and let me know how it goes for you?
Regards,
Slava
HI Slava,
The project you shared worked.
Here is a zip file with the project I created. What did I do wrong?
Hi Caleb,
You made two mistakes:
Duplicated ‘secretKey’ == ‘appId’:
http://support.backendless.com/public/attachments/90f5db1cf378e1bb2f82522734d3e728.png</img>
but SECRET_KEY should be set by iOS Secret Key of your Backendless app.
If you use a sync method, you should use try/catch wrapper (I fixed ViewController.swift of your sample):
class ViewController: UIViewController {
let backendless = Backendless.sharedInstance()
override func viewDidLoad() {
super.viewDidLoad()
registerUserSync()
}
func registerUserSync() {
Types.tryblock({ () -> Void in
let user = BackendlessUser()
user.email = "caleb.kleveter@gmail.com"
user.password = "my_super_password"
let registeredUser = self.backendless.userService.registering(user)
print("User has been registered: \(registeredUser)")
},
catchblock: { (exception) -> Void in
print("Server reported an error: \(exception as! Fault)")
}
)
}
}
Cause of your original sample crash was “uncatched exception”.
Regards,
Slava