I'm working on connecting my Parse app to my Node.js Parse Server with the Swift language. In the documentation of Parse, I can see this code :
[Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> configuration) {
...
configuration.applicationId = @"YOUR_APP_ID";
configuration.clientKey = @"YOUR_APP_CLIENT_KEY";
configuration.server = @"http://localhost:1337/parse";
...
}]];
And since I use the Swift language, here is my configuration until now :
// Initialize Parse.
Parse.setApplicationId("APP_ID", clientKey: "CLIENT_KEY")
But how can I specify the server as in the Objective-C code ?
Thanks!
The fastest and easiest way to get started is to run MongoDB and Parse Server locally. Use the bootstrap script to set up Parse Server in the current directory. You can use any arbitrary string as your application id and master key. These will be used by your clients to authenticate with the Parse Server.
Parse is a platform that offers many tools and one of the things it provides is a “service as a back-end”. Parse takes care of the implementation of the back-end so that developers can focus on building their apps while still leveraging the power of having data persistence in the cloud.
Found the answer by myself, here is how to set a configuration (including the server URL) with Swift :
let parseConfiguration = ParseClientConfiguration(block: { (ParseMutableClientConfiguration) -> Void in
ParseMutableClientConfiguration.applicationId = "APP_ID"
ParseMutableClientConfiguration.clientKey = "CLIENT_KEY"
ParseMutableClientConfiguration.server = "http://your_server.com:1337/parse"
})
Parse.initializeWithConfiguration(parseConfiguration)
Hope it will help someone else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With