【问题标题】:Instagram API gives oauthexceptionInstagram API 提供 oauhexception
【发布时间】:2019-05-13 09:41:41
【问题描述】:

我正在开发一个 iOS 应用程序,我正在尝试将 Instagram API 集成到我的应用程序中,以便用户可以使用 instagram 登录,但我收到一条错误消息,提示您必须包含有效的 client_idresponse_type 和 @987654323 @参数

它在我第一次运行我的项目时工作,但是在我重新启动我的 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])

【问题讨论】:

    标签: swift xcode instagram-api


    【解决方案1】:

    你应该创建一个类名Constant并在init中添加这些东西

    并在 youtube 上观看此视频 https://www.youtube.com/watch?v=zB50DMlVRgE

    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"
    }
    
    

    【讨论】:

      猜你喜欢
      • 2016-10-03
      • 1970-01-01
      • 2014-08-31
      • 2020-03-21
      • 1970-01-01
      • 1970-01-01
      • 2016-11-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多