Reputation:
I am currently using Parse server on Heroku which I got deployed using this link over here:
https://github.com/ParsePlatform/parse-server-example#with-the-heroku-button
You simply click on the button, create an application ID, client key, and server URL
which you use to connect to the Parse server from your iOS code.
Now in my app whenever I start it up I keep getting this error:
[Error]: Network connection failed. Making attempt 2 after sleeping for 2.252750 seconds.
[Error]: unsupported URL (Code: 100, Version: 1.12.0)
Even when I try to make a request to grab the data in a PFFile in the code below I get the same error as above:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! FollowersTableViewCell
cell.userNameLabel.text = followUsernameArray[indexPath.row]
let file = avaArray[indexPath.row]
file.getDataInBackgroundWithBlock { (data: NSData?, error: NSError?) in
if error == nil {
if let data = data {
//ERROR HERE. UNSUPPORTED URL!!??
let image = UIImage(data: data)
cell.avaImageView.image = image
}
}else if error != nil {
print("FROM FOLLOWERS TABLE VC cellForRowAtIndexPath: \(error?.localizedDescription)")
}
}
return cell
}
I already went to Plist.info
and set the App Transport Security Settings
to Allow Arbitrary Loads
to YES
. That didn't fix the problem either. Does anyone have any input on this? Would be much appreciated!
Upvotes: 3
Views: 1065
Reputation: 362
My problem was that the image name in the server had an space "long name.png", which I guess is a invalid character for them, changed it to longName.png and worked without any error. I was using back4app as my Parse Server.
Upvotes: 2
Reputation: 15042
It looks as if the Parse iOS SDK has problems connecting to the Parse Server.
You can check from both sides and determine where it faults.
Parse SDK:
Check your connection URL in
Parse.initializeWithConfiguration(ParseClientConfiguration {
config in
config.applicationId = <...>
config.clientKey = <...>
config.server = <...> // Check this URL
})
The URL should look something like this for Heroku:
https://<your-heroku-app-name>.herokuapp.com/parse
Parse Server:
Go to your Heroku dashboard and open the "Logs" page to see if:
To get more info in the logs in the Heroku dashboard go to Settings > Config Vars and set the environment variable VERBOSE
with value 1
.
Upvotes: 0