I am using dreamfactory for quite a while on iOS, and now trying to use SWGCustomSettings to set Custom Setting. But tried multiple times, neither of the following can get the value posted to backend database.
var settings = SWGCustomSettings(values:[“name”:Settings.UserStatus,“value”: status])
var settings = SWGCustomSettings(values: [Settings.UserStatus : status.description])
can anybody indicate how to setup a SWGCustomSettings object with values?
let userAPI = SWGUserApi()
userAPI.addHeader(Settings.kApplicationName, forKey: "X-DreamFactory-Application-Name")
userAPI.setBaseUrlPath(Settings.baseDSPUrl)
var settings = SWGCustomSettings(values:["name":Settings.UserStatus,"value": status]) //values: [Settings.UserStatus : status.description]
// settings.name([Settings.UserStatus])
// var settings = StatusCustomerSetting(status: status.description)
// settings.UserStatus = status.description;
// settings.name = [Settings.UserStatus,status.description]
// settings.setValue(status.description, forKey: Settings.UserStatus)
// settings.name = [Settings.UserStatus]
userAPI.setCustomSettingsWithCompletionBlock(settings) { (success:SWGSuccess!, error:NSError!) -> Void in
println(" Setting Status \(status) to User Profile")
}
Thanks for this tutorial and question. I have a specific question of iOS oc API. I would appreciate it if someone having similar experience get a time to help.
How to use get customize values set in “settings” variable?
userAPI.setCustomSettingsWithCompletionBlock(settings) { (success:SWGSuccess!, error:NSError!) -> Void in
}
Thanks Jeffrey for point out the new iOS API.
I realized I was still using the previous version of SDK which contains more API wrappers.
I am wondering why old version SDK is gone? Also in the new API, there is no such customerSetting API at all, instead, replaced by a simple neat general API calls.
Currently I don’t want to update all my codes with this new sdk due to a lot of work.
I am still wondering the answer to my specific question to set a value to user’s profile.
userAPI.setCustomSettingsWithCompletionBlock(settings) { (success:SWGSuccess!, error:NSError!) -> Void in
}