小编Sol*_*ola的帖子

单击按钮时如何打开手机设置?

我正在尝试在应用程序中实现一项功能,该功能在互联网连接不可用时显示警报.警报有两个操作(确定和设置),每当用户点击设置时,我想以编程方式将它们带到手机设置.

我正在使用Swift和Xcode.

settings ios swift

144
推荐指数
11
解决办法
10万
查看次数

Instagram 解析身份验证以生成会话令牌 Swift IOS

如何创建在解析中对用户进行身份验证所需的会话令牌。我已经能够关注这篇博客文章http://blog.parse.com/announcements/bring-your-own-login/,但我不知道如何使用 Swift(IOS) 生成会话令牌。

这就是我到目前为止所拥有的。

func doAuthInstagram() {
    let oauthswift = OAuth2Swift(
        consumerKey: Instagram["consumerKey"]!,
        consumerSecret: Instagram["consumerSecret"]!,
        authorizeUrl: "https://api.instagram.com/oauth/authorize",
        responseType: "token"
    )

    let state: String = generateStateWithLength(20) as String
    oauthswift.authorize_url_handler = WebViewController()

    oauthswift.authorizeWithCallbackURL(NSURL(string: "oauth-swift://oauth-callback/instagram")!, scope: "likes+comments", state: state,
        success: { (credential, response, parameters) -> Void in

        let url: String = "https://api.instagram.com/v1/users/self/?access_token=\(credential.oauth_token)"
        let parameters: Dictionary = Dictionary<String, AnyObject>()

        oauthswift.client.get(url, parameters: parameters,
            success: { (data, response) -> Void in
            let jsonDict: AnyObject! = NSJSONSerialization.JSONObjectWithData(data, options: nil, error: nil)

                let user = PFUser() …
Run Code Online (Sandbox Code Playgroud)

objective-c ios instagram parse-platform swift

5
推荐指数
0
解决办法
624
查看次数

标签 统计

ios ×2

swift ×2

instagram ×1

objective-c ×1

parse-platform ×1

settings ×1