【问题标题】:Instagram Basic display Api (Not Able to get user Access token iOS Swift)Instagram Basic display Api (Not Able to get user Access token iOS Swift)
【发布时间】:2020-01-23 10:37:49
【问题描述】:

我希望我的 iOS 应用程序的用户通过 Instagram 登录。 由于 Instagram 停止使用以前的方法,我正在使用 Instagram Basic Display Api。 可以使用此 API 进行身份验证吗? 其次,我在 facebook 开发者网站上创建了一个应用程序并设置了 instagram 应用程序并获得了 instagram 应用程序 ID。 现在如何使用此 App ID 获取用户访问令牌??

https://api.instagram.com/oauth/authorize
  ?client_id={instagram-app-id}
  &redirect_uri={redirect-uri}
  &scope={scope}
  &response_type=code
  &state={state}        //Optional

我在邮递员和浏览器中使用 App ID 和重定向 uri 访问此 url。它不工作并显示错误。

【问题讨论】:

    标签: authentication oauth instagram instagram-api


    【解决方案1】:

    尝试使用 webVieW 加载

      override func viewDidLoad() {
        super.viewDidLoad()
    
        let url = URL(string: "https://api.instagram.com/oauth/authorize?client_id=\(clientId)&redirect_uri=\(redirectUri)&scope=user_profile,user_media&response_type=code")
            let urlRequest = URLRequest(url: url!)
            webView.load(urlRequest)
    }
    

    【讨论】:

      猜你喜欢
      • 2022-12-26
      • 1970-01-01
      • 2012-01-08
      • 1970-01-01
      • 1970-01-01
      • 2022-12-26
      • 2022-12-27
      • 1970-01-01
      • 2020-02-18
      相关资源
      最近更新 更多