TF-851 [iOS] Share image with TMail app
This commit is contained in:
@@ -5,7 +5,7 @@ import Photos
|
||||
|
||||
class ShareViewController: SLComposeServiceViewController {
|
||||
var hostAppBundleIdentifier = ""
|
||||
var appGroupId = ""
|
||||
let appGroupId = "group.com.linagora.teammail"
|
||||
let sharedKey = "ShareKey"
|
||||
var sharedMedia: [SharedMediaFile] = []
|
||||
var sharedText: [String] = []
|
||||
@@ -27,9 +27,6 @@ class ShareViewController: SLComposeServiceViewController {
|
||||
// For example: com.test.ShareExtension -> com.test
|
||||
let lastIndexOfPoint = shareExtensionAppBundleIdentifier.lastIndex(of: ".");
|
||||
hostAppBundleIdentifier = String(shareExtensionAppBundleIdentifier[..<lastIndexOfPoint!]);
|
||||
|
||||
// loading custom AppGroupId from Build Settings or use group.<hostAppBundleIdentifier>
|
||||
appGroupId = (Bundle.main.object(forInfoDictionaryKey: "AppGroupId") as? String) ?? "group.\(hostAppBundleIdentifier)";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ import 'package:tmail_ui_user/features/upload/data/network/file_uploader.dart';
|
||||
import 'package:tmail_ui_user/features/upload/domain/usecases/local_file_picker_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/upload/presentation/controller/upload_controller.dart';
|
||||
import 'package:tmail_ui_user/main/bindings/network/binding_tag.dart';
|
||||
import 'package:worker_manager/worker_manager.dart';
|
||||
|
||||
class ComposerBindings extends BaseBindings {
|
||||
|
||||
@@ -64,7 +65,7 @@ class ComposerBindings extends BaseBindings {
|
||||
}
|
||||
|
||||
void _bindingsUtils() {
|
||||
Get.lazyPut(() => FileUploader(Get.find<DioClient>(tag: BindingTag.isoLateTag)));
|
||||
Get.lazyPut(() => FileUploader(Get.find<DioClient>(tag: BindingTag.isoLateTag), Get.find<Executor>()));
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -29,8 +29,9 @@ class MailboxIsolateWorker {
|
||||
|
||||
final ThreadAPI _threadApi;
|
||||
final EmailAPI _emailApi;
|
||||
final Executor _isolateExecutor;
|
||||
|
||||
MailboxIsolateWorker(this._threadApi, this._emailApi);
|
||||
MailboxIsolateWorker(this._threadApi, this._emailApi, this._isolateExecutor);
|
||||
|
||||
Future<List<Email>> markAsMailboxRead(
|
||||
AccountId accountId,
|
||||
@@ -45,7 +46,7 @@ class MailboxIsolateWorker {
|
||||
totalEmailUnread,
|
||||
onProgressController);
|
||||
} else {
|
||||
final result = await Executor().execute(
|
||||
final result = await _isolateExecutor.execute(
|
||||
arg1: MailboxMarkAsReadArguments(
|
||||
_threadApi,
|
||||
_emailApi,
|
||||
|
||||
@@ -19,8 +19,9 @@ import 'package:worker_manager/worker_manager.dart';
|
||||
class ThreadIsolateWorker {
|
||||
final ThreadAPI _threadAPI;
|
||||
final EmailAPI _emailAPI;
|
||||
final Executor _isolateExecutor;
|
||||
|
||||
ThreadIsolateWorker(this._threadAPI, this._emailAPI);
|
||||
ThreadIsolateWorker(this._threadAPI, this._emailAPI, this._isolateExecutor);
|
||||
|
||||
Future<List<EmailId>> emptyTrashFolder(
|
||||
AccountId accountId,
|
||||
@@ -30,7 +31,7 @@ class ThreadIsolateWorker {
|
||||
if (BuildUtils.isWeb) {
|
||||
return _emptyTrashFolderOnWeb(accountId, mailboxId, updateDestroyedEmailCache);
|
||||
} else {
|
||||
final result = await Executor().execute(
|
||||
final result = await _isolateExecutor.execute(
|
||||
arg1: EmptyTrashFolderArguments(_threadAPI, _emailAPI, accountId, mailboxId),
|
||||
fun1: _emptyTrashFolderAction,
|
||||
notification: (value) {
|
||||
|
||||
@@ -17,8 +17,9 @@ import 'package:worker_manager/worker_manager.dart' as worker;
|
||||
class FileUploader {
|
||||
|
||||
final DioClient _dioClient;
|
||||
final worker.Executor _isolateExecutor;
|
||||
|
||||
FileUploader(this._dioClient);
|
||||
FileUploader(this._dioClient, this._isolateExecutor);
|
||||
|
||||
Future<Attachment?> uploadAttachment(
|
||||
UploadTaskId uploadId,
|
||||
@@ -35,7 +36,7 @@ class FileUploader {
|
||||
uploadUri,
|
||||
cancelToken: cancelToken);
|
||||
} else {
|
||||
final attachmentUploaded = await worker.Executor().execute(
|
||||
final attachmentUploaded = await _isolateExecutor.execute(
|
||||
arg1: UploadFileArguments(
|
||||
_dioClient,
|
||||
uploadId,
|
||||
|
||||
@@ -23,6 +23,7 @@ import 'package:tmail_ui_user/features/session/data/network/session_api.dart';
|
||||
import 'package:tmail_ui_user/features/thread/data/network/thread_api.dart';
|
||||
import 'package:tmail_ui_user/features/thread/data/network/thread_isolate_worker.dart';
|
||||
import 'package:tmail_ui_user/main/bindings/network/binding_tag.dart';
|
||||
import 'package:worker_manager/worker_manager.dart';
|
||||
|
||||
class NetworkBindings extends Bindings {
|
||||
|
||||
@@ -99,11 +100,16 @@ class NetworkBindings extends Bindings {
|
||||
}
|
||||
|
||||
void _bindingIsolateWorker() {
|
||||
Get.put(Executor());
|
||||
Get.put(ThreadIsolateWorker(
|
||||
Get.find<ThreadAPI>(),
|
||||
Get.find<EmailAPI>()));
|
||||
Get.find<ThreadAPI>(),
|
||||
Get.find<EmailAPI>(),
|
||||
Get.find<Executor>(),
|
||||
));
|
||||
Get.put(MailboxIsolateWorker(
|
||||
Get.find<ThreadAPI>(),
|
||||
Get.find<EmailAPI>()));
|
||||
Get.find<ThreadAPI>(),
|
||||
Get.find<EmailAPI>(),
|
||||
Get.find<Executor>(),
|
||||
));
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -176,7 +176,7 @@ dependencies:
|
||||
percent_indicator: 4.2.2
|
||||
|
||||
# Isolate
|
||||
worker_manager: 4.4.6
|
||||
worker_manager: 4.4.0
|
||||
|
||||
async: 2.8.2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user