Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.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
Swift Instagram API提供了OAutheException_Swift_Xcode_Instagram Api - Fatal编程技术网

Swift Instagram API提供了OAutheException

Swift Instagram API提供了OAutheException,swift,xcode,instagram-api,Swift,Xcode,Instagram Api,我正在开发一个iOS应用程序,我正在尝试将Instagram API集成到我的应用程序中,以便用户可以使用Instagram登录,但我收到一条错误消息,说您必须包含有效的客户端id、响应类型和重定向uri参数 它在我第一次运行我的项目时工作,但在我重新启动Mac之后,它在我运行它时不断出现此错误。 下面是我的代码 let url = String(format: "%@?client_id=%@&redirect_url=%@&response_type=token&sc

我正在开发一个iOS应用程序,我正在尝试将Instagram API集成到我的应用程序中,以便用户可以使用Instagram登录,但我收到一条错误消息,说您必须包含有效的
客户端id
响应类型
重定向uri
参数

它在我第一次运行我的项目时工作,但在我重新启动Mac之后,它在我运行它时不断出现此错误。 下面是我的代码

let url = String(format: "%@?client_id=%@&redirect_url=%@&response_type=token&scope=%@&DEBUG=True", arguments: [INSTAGRAM_IDS.AUTHURL,INSTAGRAM_IDS.CLIENTID,INSTAGRAM_IDS.REDIRECTURL,INSTAGRAM_IDS.SCOPE])

您应该创建一个类名常量,并在init中添加以下内容

在youtube上观看这段视频

import Foundation


struct  INSTAGRAM_IDS {
    static let AUTHURL = "https://api.instagram.com/oauth/authorize/"
    static let APIURL = "https://api.instagram.com/v1/users/"
    static let CLIENT_ID = "id of client signup in insta and get id"
    static let CLIENTSERCRET = "secret of client signup in insta and get this"
    static let REDIRECT_URI = "http://www.google.com"
    static let ACCESSTOKEN = "access_token"
    static let SCOPE = "follower_list+public_content"
}