OSX Dropbox Sync API错误-无法验证链接请求 [英] OSX Dropbox Sync API Error - unable to verify link request

查看:66
本文介绍了OSX Dropbox Sync API错误-无法验证链接请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在教程之后实现的Swift I中编码.

Coded in Swift I implemented after the Tutorial.

DBAccountManager是在applicationDidFinishLaunching上的AppDelegate中设置的.

DBAccountManager is setup in AppDelegate on applicationDidFinishLaunching.

后来,当用户在我的应用程序中激活保管箱支持时,我正在尝试链接该帐户. 显示窗口面板,我的应用程序正在等待回调.

Later, when the user activates dropbox support in my application I'm trying to link the account. The Window Panel is displayed and my application is waiting for the callback.

有时候,即使用户登录并接受,我也没有关联帐户.

Sometimes I do not get a linked account, even the user logs in and accepts.

日志说 "[ERROR]无法验证链接请求"

在机器上无法正常工作时,您可以重试并重试... 如果有效,它就像一种魅力,将来我总是直接从图书馆获得链接帐户,而无需登录窗口.

When this occurs on a machine it wont't work, you can retry and retry... if it worked, it works like a charm and in future I always get the linked account directly from the library without the login window.

此错误是什么意思,我该怎么办?

What does this error mean and what can I do?

AppDelegate:

func applicationDidFinishLaunching(aNotification: NSNotification) {
    // Dropbox API Key & Secret
    let _appKey = "------"
    let _appSecret = "------"

    // Accountmanager
    if (DBAccountManager.sharedManager() == nil)
    {
        let accountManager = DBAccountManager(appKey: _appKey, secret: _appSecret)
        DBAccountManager.setSharedManager(accountManager)
    }

    ....
 }

当用户单击以激活保管箱时,我班级中的链接:

internal func __start(parentWindow:NSWindow?, callback:((Bool) -> Void))
{
    let am = DBAccountManager.sharedManager()        
    if am == nil
    {
        NSLog("Dropbox not available!")
        callback!(false)
        return           
    }
    // link account
    let linkedAccount = am!.linkedAccount

    if (linkedAccount != nil)
    {
        // Already linked
        DLog("Dropbox link found.")
        let fileSystem = DBFilesystem(account: linkedAccount!)
        DBFilesystem.setSharedFilesystem(fileSystem)
        callback(true)
    }
    else
    {
        // link with window must be in mainthread
        dispatch_async(dispatch_get_main_queue())
        {
            am!.linkFromWindow(parentWindow) {
                account in

                if (account != nil)
                {
                    DLog("Dropbox linked")
                    let fileSystem = DBFilesystem(account: account!)
                    DBFilesystem.setSharedFilesystem(fileSystem)
                    callback(true)
                }
                else
                {
                    DLog("NOT LINKED (Dropbox)")
                    callback(false)
                } // if - else account
            } // accountmanager block
        } // dispatchblock main
    } // if - else linkedaccount
}

以下是完整的日志,该应用未执行其他任何操作:

Here the full log, the app is not doing anything else:

2015-02-23 10:25:39.443 TestApp[39226:30958267] Dropbox init
<<<< MediaValidator >>>> mv_ValidateRFC4281CodecId: Unrecognized codec 1.(null). Failed codec specific check.
<<<< MediaValidator >>>> mv_LookupCodecSupport: Unrecognized codec 1
[10:25:40.979] mv_LowLevelCheckIfVideoPlayableUsingDecoder signalled err=-12956 (kFigMediaValidatorError_VideoCodecNotSupported) (video codec 1) at  line 1851
<<<< MediaValidator >>>> mv_TestCodecSupportUsingDecoders: Unrecognized codec 1
<<<< MediaValidator >>>> mv_ValidateRFC4281CodecId: Unrecognized codec 1.(null). Failed codec specific check.
<<<< MediaValidator >>>> mv_LookupCodecSupport: Unrecognized codec 1
[10:25:40.979] mv_LowLevelCheckIfVideoPlayableUsingDecoder signalled err=-12956 (kFigMediaValidatorError_VideoCodecNotSupported) (video codec 1) at  line 1851
<<<< MediaValidator >>>> mv_TestCodecSupportUsingDecoders: Unrecognized codec 1
2015-02-23 10:25:43.873 TestApp[39226:30958267] [ERROR] unable to verify link request
2015-02-23 10:25:43.879 TestApp[39226:30958267] NOT LINKED (Dropbox)

推荐答案

我找到了一些东西,并且由于找到了解决方法,所以连投递箱错误也消失了.

I found something and since I found a fix for that, even the dropbox error is gone.

问题似乎是NSUserDefaults没有存储任何数据(不在内存中,也不在磁盘上!).由于Dropbox使用NSUserDefaults前后检查状态,因此这杀死了整个过程. 恢复NSUserDefaults后,似乎整个保管箱问题都消失了. OSX NSUserDefaults不起作用

The problem seems to be, that NSUserDefaults did not store any data (not in memory and not on disk!). Since Dropbox uses NSUserDefaults to check the state before and after, this killed the whole process. With getting the NSUserDefaults back working it seems the whole dropbox problem was gone. OSX NSUserDefaults not Working

这篇关于OSX Dropbox Sync API错误-无法验证链接请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆