【问题标题】:Creating an AVAssetDownloadURLSession requires the com.apple.developer.media-asset-download entitlement创建 AVAssetDownloadURLSession 需要 com.apple.developer.media-asset-download 授权
【发布时间】:2017-07-06 06:16:51
【问题描述】:

当我尝试在 iOS 9.0 中构建 AVAssetDownloadURLSession 的实例时,它出现了异常。

原因:“创建 AVAssetDownloadURLSession 需要 com.apple.developer.media-asset-download 授权”。

我不知道如何解决这个问题。请帮帮我。

我的代码:

NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:@"AX"];
configuration.HTTPCookieAcceptPolicy = NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain;
configuration.shouldUseExtendedBackgroundIdleMode = YES;
configuration.sessionSendsLaunchEvents = YES;
configuration.HTTPShouldSetCookies = YES;
configuration.HTTPShouldUsePipelining = NO;
configuration.requestCachePolicy = NSURLRequestUseProtocolCachePolicy;
configuration.allowsCellularAccess = YES;
configuration.timeoutIntervalForRequest = 60.0;
configuration.HTTPMaximumConnectionsPerHost = 10;
configuration.discretionary = YES;

NSOperationQueue *queue = [[NSOperationQueue alloc] init];
queue.maxConcurrentOperationCount = 3;

AVAssetDownloadURLSession *session = [AVAssetDownloadURLSession sessionWithConfiguration:configuration assetDownloadDelegate:self delegateQueue:[NSOperationQueue mainQueue]];

【问题讨论】:

  • 您好,问题解决了吗?我发现这个崩溃也发生在真实设备上

标签: objective-c nsurlsession entitlements avasset


【解决方案1】:

AVDownloadURLSession 仅适用于设备。如果您在模拟器上尝试它会崩溃。尝试在设备上运行此代码。它会起作用的。

【讨论】:

    【解决方案2】:

    @martin 的回答是正确的。使用TARGET_IOS_SIMULATOR注释掉AVAssetDownloadURLSession相关代码在模拟器上调试。

    【讨论】:

      猜你喜欢
      • 2015-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多