- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正在尝试在 Swift 2.0 项目中设置 VK iOS SDK。我收到一个错误,我不知道为什么会发生。
AppDelegate.swift:
//
// AppDelegate.swift
// iosVKMusic
//
// Created by Nick on 25.06.15.
// Copyright © 2015 Funtrum. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
let ret:Bool = VKSdk.processOpenURL(url, fromApplication: sourceApplication)
return ret
}
}
ViewController.swift:
//
// ViewController.swift
// iosVKMusic
//
// Created by Nick on 25.06.15.
// Copyright © 2015 Funtrum. All rights reserved.
//
import UIKit
extension ViewController: VKSdkDelegate {
func vkSdkNeedCaptchaEnter(captchaError: VKError) { }
func vkSdkTokenHasExpired(expiredToken: VKAccessToken) { }
func vkSdkUserDeniedAccess(authorizationError: VKError) { }
func vkSdkShouldPresentViewController(controller: UIViewController) { }
func vkSdkReceivedNewToken(newToken: VKAccessToken) { }
}
class ViewController: UIViewController {
let TOKEN_KEY = "my_application_access_token"
override func viewDidLoad() {
super.viewDidLoad()
VKSdk.initializeWithDelegate(self, andAppId: "4314639")
}
@IBAction func authTouchUp(sender: UIButton) {
if (VKSdk.wakeUpSession()) {
print("wakeUpSession", appendNewline: true)
} else {
print("else", appendNewline: true)
VKSdk.authorize([VK_PER_AUDIO, VK_PER_OFFLINE], revokeAccess: true)
}
}
func vkSdkAcceptedUserToken(token: VKAccessToken!) {
print("ACCEPTED", appendNewline: true)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
Bridgind Header.h:
//
// -Bridging-Header.h
// iosVKMusic
//
// Created by Nick on 28.06.15.
// Copyright © 2015 Funtrum. All rights reserved.
//
#ifndef _Bridging_Header_h
#define _Bridging_Header_h
#endif /* _Bridging_Header_h */
#import "VKSdk.h"
Autorize VKSdk.autorize(...)
返回此错误:
2015-06-29 16:11:14.931 iosVKMusic[554:75899] -canOpenURL: failed for URL: "vkauthorize://authorize" - error: "This app is not allowed to query for scheme vkauthorize"
最佳答案
我通过添加到 Info.plist 来修复这个错误
<key>LSApplicationQueriesSchemes</key>
<array>
<string>vkauthorize</string>
</array>
关于ios - VK iOS sdk授权,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31118600/
我在尝试使用 Vulkan Hpp 唯一句柄来存储缓冲区及其分配的内存时遇到了以下难题。我声明句柄 vk::UniqueBuffer vertex_buffer; vk::UniqueDeviceMe
当我在 vk.com 墙上分享网站链接时,它会显示网站的标题和缩略图。如何使用 vk ios sdk 做到这一点?我试图在消息中分享一个链接,例如 VKRequest *request = [[VKA
我正在使用以下 php 代码: $vk = new VK($app_id, $api_secret); $user_wall = $vk->api('newsfeed.get', array(
我正在尝试与包括 VK 在内的其他应用程序共享我的 Android 应用程序中的音频文件:https://play.google.com/store/apps/details?id=com.vkont
我正在尝试按照 here 和 here 的描述授权 vk.com 用户 (OAuth 2.0)。问题:每次我只看到一个空白屏幕,除了对 GC 的一次调用之外似乎什么也没有发生。我测试了我的 WebVi
我正在测试 vk.com api 以便能够执行搜索。我可以获得 token ,但是当我使用它时,它总是返回错误:“access_token 已过期”能不能帮我看看是不是代码错了,还是vk的配置? 非常
美好的一天。关于使用库VK的问题。如何获取头像,使用VKSDK\在 Internet 上找不到合适的信息。 最佳答案 在您的请求中,您需要指定以下字段之一:photo_50 或 photo_100 或
我正在尝试在 Swift 2.0 项目中设置 VK iOS SDK。我收到一个错误,我不知道为什么会发生。 AppDelegate.swift: // // AppDelegate.swift //
初始化这个结构的类似 C 的方法是: VkDeviceQueueCreateInfo queueCreateInfo = {}; queueCreateInfo.sType = VK_STRU
如何嵌入来自 vk.com 的视频并指定视频开始的时间(例如:视频应该从中间开始,或从第 5 秒开始),以及隐藏控件,就像在 YouTube 上一样? 一个简单的嵌入看起来像: 为了让它自动播放,我
我正在尝试授权我的独立应用程序。但在我单击“允许”后,它总是重定向到 http://oauth.vk.com/error?err=2 并将其作为响应正文: {"error":"invalid_requ
我面临这样的问题...我确实通过createWallPost在墙上发布,简单文本,从几个字符到非常大的文本的任意长度的纯文本...通过一次发布。下一次发布一次,同样的记录会报错。 ... 我很困惑
我想通过 vk.com 进行授权。我下载this库,但是没有正常的例子怎么用呢?我尝试下一个代码,但它对我不起作用。 package ua.khuta.testVkSdk; import an
我最近在 vk.vom 上看到了一些有趣的 css 技巧 background: url(/images/icons/mono_iconset.gif?8) no-repeat left -237px
我需要写信给List大学名单。我已经写好了要列出的国家和城市。但在大学中,数据的表现略有不同。有 {"response":[201,我不知道如何处理它。我成功地从 here 得到了国家.来自here我
我正在尝试获取电子邮件地址。成功登录后,我有名字,姓氏,除了电子邮件。请帮忙。 VK.Auth.login(function (response) { if (response
我正在尝试使用 vk auth与 martini .但是编译时出错: /goPath/vkAuthTry2.go:38: undefined: YourRedirectFunc 问题是如何定义Your
使用 Perl,我有两个相似的语法, if ($a && $b) { exit() } do { exit() } if ($a && $b) 我相信这些应该是同一件事,但是最上面的一个创建了 nul
vk.com 中使用 zend_oauth 进行身份验证时出现问题 消息:HTTP 请求中出现错误:无法在 TCP 连接 oauth.vk.com 上启用加密:确保为环境正确设置了“sslcafile
我正在使用社交网络 Vkontakte 作为 Oauth2 授权服务器。所以我有几个步骤:1) 使用 request_type=code 请求获取代码2)当我发送访问 token uri的请求时获取a
我是一名优秀的程序员,十分优秀!