Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/97.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 解析服务器不支持的URL_Ios_Swift_Heroku_Parse Platform - Fatal编程技术网

Ios 解析服务器不支持的URL

Ios 解析服务器不支持的URL,ios,swift,heroku,parse-platform,Ios,Swift,Heroku,Parse Platform,我目前正在Heroku上使用Parse server,我通过以下链接部署了该服务器: 您只需单击按钮,创建一个应用程序ID、客户端密钥和服务器URL,用于从iOS代码连接到解析服务器 现在,在我的应用程序中,每当我启动它时,我会不断地得到这个错误: [Error]: Network connection failed. Making attempt 2 after sleeping for 2.252750 seconds. [Error]: unsupported URL (Code: 10

我目前正在Heroku上使用Parse server,我通过以下链接部署了该服务器:

您只需单击按钮,创建一个
应用程序ID、客户端密钥和服务器URL
,用于从iOS代码连接到解析服务器

现在,在我的应用程序中,每当我启动它时,我会不断地得到这个错误:

[Error]: Network connection failed. Making attempt 2 after sleeping for 2.252750 seconds.
[Error]: unsupported URL (Code: 100, Version: 1.12.0)
即使我试图在下面的代码中请求获取PFFile中的数据,我也会得到与上面相同的错误:

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
    }

我已经转到
Plist.info
并将
应用程序传输安全设置设置设置为
允许任意加载
设置为
。这也没有解决问题。有人对此有什么意见吗?非常感谢

解析iOS SDK似乎在连接到解析服务器时出现问题

您可以从两侧进行检查并确定其故障位置

解析SDK:

在中检查您的连接URL

Parse.initializeWithConfiguration(ParseClientConfiguration {
    config in
    config.applicationId = <...>
    config.clientKey = <...>
    config.server = <...> // Check this URL
})
Parse.initializeWithConfiguration(ParseClientConfiguration{
配置在
config.applicationId=
config.clientKey=
config.server=//检查此URL
})
Heroku的URL应该如下所示:

https://<your-heroku-app-name>.herokuapp.com/parse
https://.herokuapp.com/parse
解析服务器:

转到Heroku仪表板并打开“日志”页面,查看是否:

  • 您的解析服务器已启动并运行,没有错误,您可能希望在查看日志输出以查看初始化消息的同时重新启动服务器
  • 当SDK尝试连接到解析服务器时会发生什么

要在Heroku仪表板的日志中获取更多信息,请转到设置>配置变量,并将环境变量
VERBOSE
的值设置为
1

我的问题是服务器中的图像名称有一个空格“long name.png”,我猜这对他们来说是无效字符,将其更改为longName.png,工作时没有任何错误。我正在使用back4app作为解析服务器。

很抱歉响应太晚。我更改了URL以包含
https
我只有
http
,但这似乎没有起作用。我也去了Heroku仪表板,但没有看到日志页面。我是否必须更改部署到Heroku的
解析服务器
代码中的某些内容?搜索Heroku上的日志页面,这是Heroku上的标准功能,没有它,您将不知道服务器端发生了什么。然后尝试在web浏览器中输入parse server的URL,您在浏览器中看到了什么,在Heroku上的parse server日志中看到了什么?当我以以下格式在浏览器中输入parse server URL时:
https://.herokuapp.com/parse
我看到1{“错误”:“未经授权”}`。让我快速查看日志。所以我在运行应用程序后查看了日志,似乎没有任何错误。但我仍然不断收到这些错误:
2016-09-20 14:07:02.742应用程序[2386:176276][Error]:不支持的URL(代码:100,版本:1.12.0)
2016-09-20 14:07:02.743应用程序[2386:176276][Error]:网络连接失败。在睡了12.655467秒后尝试4次。
是的,我想我最终会这样做。谢谢你的帮助。我真的很感激。将你的解析服务器升级到最新版本(登录Back4app->点击你的应用程序功能->解析版本)。此问题已解决。您用于初始化Parse SDK的代码是什么?您必须更改为以下内容:Parse.initialize(新的Parse.Configuration.Builder(this.applicationId)(“您的应用程序ID”).server(“).build()”);