iOS | Personal contacts
Which method is for creating own personal contacts?
I have tried
serviceManager.contactsManagerService.directoriesManager.createPersonalContact(<#T##updateBlock: (ContactDirectoryBuilder) -> Void##(ContactDirectoryBuilder) -> Void#>, block: <#T##((Contact?, Error?) -> Void)?##((Contact?, Error?) -> Void)?##(Contact?, Error?) -> Void#>)
but I was getting server error once I called this method.
Here is how I have tried to use in SWIFT
serviceManager.contactsManagerService.directoriesManager.createPersonalContact { contactBuilder in
contactBuilder.firstName = name
contactBuilder.lastName = surname
} block: { contact, error in
completion(error)
}
Here is the log
2022-12-19 09:04:43.056196+0100 DholRainbow[12971:4582151] [HTTP] [POST] [SENT] https://openrainbow.com/api/rainbow/directory/v1.0/entries?analyticsEntryType=personal (correlatorId: 72D7C9B716)
2022-12-19 09:04:44.277646+0100 DholRainbow[12971:4582284] [HTTP] [POST] [RECV] https://openrainbow.com/api/rainbow/directory/v1.0/entries?analyticsEntryType=personal (reqId: 3w8_IVMxLc, correlatorId: 72D7C9B716)
2022-12-19 09:04:44.278157+0100 DholRainbow[12971:4582284] [HTTP] [POST] [ERROR] /api/rainbow/directory/v1.0/entries Cannot perform request in REST : {
errorCode = 500;
errorDetails = "";
errorDetailsCode = "-1";
errorMsg = "Internal Server Error";
}
-
I don't know if it changes anything but I have "builder" instead of "contactBuilder", can you try?
Also on your official app, you are able to create the account on the same environment / account? If yes, might be something with the appId but the server error is not helpful.
-
Does not have any impact change contactBuilder to builder.
And yes Im using same account for both apps for this reason to debug if is problem only within my custom app or also on official app. But in this case, in official app I will create personal contact with no errors.
-
I have checked with backend team and the issue is about the country which is empty. It is required and it must be in ISO-3166-1-alpha3 format.
In the Rainbow SDK you can use following as default:
ServicesManager.sharedInstance().myUser.contact?.countryCode
You can also use following property to display the list of countries (as Country object) :
ServicesManager.sharedInstance().myUser.countries
Vous devez vous connecter pour laisser un commentaire.
Commentaires
8 commentaires