Backendless Support
 
Waiting for user's response

[iOS] How can I migrate backendless 3.0.46 to 4.0b14

Dear Backendless support team:

I have a question to ask you. I want to migrate backendless 3.0.46 to 4.0b14, but I got an error message "Cannot invoke 'getRegistration' with no arguments". I don't know how to fix it. Could you help me, please.

  1. func registerUserDeviceId(user: BackendlessUser) {
  2. if backendless!.messagingService.getRegistration().deviceId != nil {
  3. let deviceId = backendless!.messagingService.getRegistration().deviceId
  4. let properties = [kDEVICEID : deviceId]
  5. backendless!.userService.currentUser!.updateProperties(properties)
  6. backendless!.userService.update(backendless!.userService.currentUser, response: {
  7. newUser in
  8. print("updated device id in backendless")
  9. }, error: {
  10. fault in
  11. print("Fault coulnt update user device id \(fault!.detail!)")
  12. })
  13. }
  14. }

adfce3b9ca950d2e1e9d12cf6f97a734

Leave a Comment

Comments (1)

photo
1

Hello!

The getRegistration method takes deviceId as parameter. Please check this doc.

Regards, Olga