小编Mul*_*att的帖子

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

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

THREAD WARNING: ['Media'] took '205.391846' ms. Plugin should use a background thread.
Run Code Online (Sandbox Code Playgroud)

我从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];
    }];
}
Run Code Online (Sandbox Code Playgroud)

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

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

media plugins multithreading background cordova

6
推荐指数
1
解决办法
8888
查看次数

标签 统计

background ×1

cordova ×1

media ×1

multithreading ×1

plugins ×1