Phonegap"['Media']插件应该使用后台线程."

 mobiledu2502934511 发布于 2023-01-06 13:00

我正在使用Phonegap 3和Media插件.在iOS上测试我的应用时,我一直收到这些错误:

THREAD WARNING: ['Media'] took '205.391846' ms. Plugin should use a background thread.

我从phonegap文档(http://docs.phonegap.com/en/edge/guide_platforms_ios_plugin.md.html)中看到了这一点:

   - (void)myPluginMethod:(CDVInvokedUrlCommand*)command
{
    // Check command.arguments here.
    [self.commandDelegate runInBackground:^{
        NSString* payload = nil;
        // Some blocking logic...
        CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:payload];
        // The sendPluginResult method is thread-safe.
        [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
    }];
}

这是否会进入我的应用程序,或者我是否需要为每个插件编辑它?我把它放在哪里?

我在网上看到了一些关于此的帖子,但没有一个明确回答如何使用上述代码.

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有