GCDWebUploader支持iOS进入后台后仍然可以进行传输
生活随笔
收集整理的這篇文章主要介紹了
GCDWebUploader支持iOS进入后台后仍然可以进行传输
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
參考文章:https://www.jianshu.com/p/2bab0ef93f7d
?
1.開啟支持后臺模式:將GCDWebServer.m中的GCDWebServerOption_AutomaticallySuspendInBackground設置為NO;
2.APPDelegate中
- (void)applicationDidEnterBackground:(UIApplication *)application {// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.__weak typeof(self) weakSelf = self;self.backgroundTask = [application beginBackgroundTaskWithExpirationHandler:^{[application endBackgroundTask:weakSelf.backgroundTask];weakSelf.backgroundTask = UIBackgroundTaskInvalid;}]; }?
轉載于:https://www.cnblogs.com/siasyl/p/10650158.html
總結
以上是生活随笔為你收集整理的GCDWebUploader支持iOS进入后台后仍然可以进行传输的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: vue 创建项目的命令
- 下一篇: bzoj 2142 礼物