From 74e2cb68e716d4e053a0e00f2a701754a82e26c9 Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Fri, 10 Mar 2023 22:32:50 +0100 Subject: [PATCH] sharing extension for ios implemented (missing widget for uplaod) --- android/app/capacitor.build.gradle | 1 + android/capacitor.settings.gradle | 3 + ios/App/App.xcodeproj/project.pbxproj | 191 ++++++++++++++++++++++- ios/App/App/App.entitlements | 10 ++ ios/App/App/AppDelegate.swift | 47 +++++- ios/App/App/Info.plist | 121 +++++++------- ios/App/Podfile | 1 + ios/App/upload/upload.entitlements | 10 ++ package-lock.json | 31 ---- package.json | 2 - src/app/app-routing.module.ts | 3 +- src/app/app.module.ts | 13 +- src/app/model/actions/actions.ts | 8 +- src/app/model/actions/move-item.ts | 1 - src/app/ws-viewer/ws-viewer.component.ts | 6 +- src/main.ts | 2 + 16 files changed, 338 insertions(+), 112 deletions(-) create mode 100644 ios/App/App/App.entitlements create mode 100644 ios/App/upload/upload.entitlements diff --git a/android/app/capacitor.build.gradle b/android/app/capacitor.build.gradle index ca1c63f..e4a126c 100644 --- a/android/app/capacitor.build.gradle +++ b/android/app/capacitor.build.gradle @@ -14,6 +14,7 @@ dependencies { implementation project(':capacitor-keyboard') implementation project(':capacitor-splash-screen') implementation project(':capacitor-status-bar') + implementation project(':capacitor-share-extension') } diff --git a/android/capacitor.settings.gradle b/android/capacitor.settings.gradle index fd6199e..c7e1694 100644 --- a/android/capacitor.settings.gradle +++ b/android/capacitor.settings.gradle @@ -16,3 +16,6 @@ project(':capacitor-splash-screen').projectDir = new File('../node_modules/@capa include ':capacitor-status-bar' project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android') + +include ':capacitor-share-extension' +project(':capacitor-share-extension').projectDir = new File('../node_modules/capacitor-share-extension/android/capacitor-share-extension') diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj index 246dee4..3ef0c33 100644 --- a/ios/App/App.xcodeproj/project.pbxproj +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -14,9 +14,46 @@ 504EC30F1FED79650016851F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30E1FED79650016851F /* Assets.xcassets */; }; 504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC3101FED79650016851F /* LaunchScreen.storyboard */; }; 50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; }; + 65B5151329BB4AB8005DC684 /* ShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65B5151229BB4AB8005DC684 /* ShareViewController.swift */; }; + 65B5151629BB4AB8005DC684 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 65B5151429BB4AB8005DC684 /* MainInterface.storyboard */; }; + 65B5151A29BB4AB8005DC684 /* upload.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 65B5151029BB4AB8005DC684 /* upload.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 65B5151829BB4AB8005DC684 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 504EC2FC1FED79650016851F /* Project object */; + proxyType = 1; + remoteGlobalIDString = 65B5150F29BB4AB8005DC684; + remoteInfo = upload; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 653C8E9E29BB40B300E6376F /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 65B5151A29BB4AB8005DC684 /* upload.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; + 65B5150829BB48F4005DC684 /* Embed ExtensionKit Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(EXTENSIONS_FOLDER_PATH)"; + dstSubfolderSpec = 16; + files = ( + ); + name = "Embed ExtensionKit Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 2FAD9762203C412B000D30F8 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = config.xml; sourceTree = ""; }; 50379B222058CBB4000EE86E /* capacitor.config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = capacitor.config.json; sourceTree = ""; }; @@ -27,6 +64,13 @@ 504EC3111FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 504EC3131FED79650016851F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50B271D01FEDC1A000F3C39B /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; path = public; sourceTree = ""; }; + 653C8E9029BB40B200E6376F /* UniformTypeIdentifiers.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UniformTypeIdentifiers.framework; path = System/Library/Frameworks/UniformTypeIdentifiers.framework; sourceTree = SDKROOT; }; + 65B5151029BB4AB8005DC684 /* upload.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = upload.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + 65B5151229BB4AB8005DC684 /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = ""; }; + 65B5151529BB4AB8005DC684 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; + 65B5151729BB4AB8005DC684 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 65B5151E29BB74FD005DC684 /* App.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = App.entitlements; sourceTree = ""; }; + 65B5153129BB7B97005DC684 /* upload.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = upload.entitlements; sourceTree = ""; }; AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App.framework; sourceTree = BUILT_PRODUCTS_DIR; }; AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.release.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.release.xcconfig"; sourceTree = ""; }; FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.debug.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.debug.xcconfig"; sourceTree = ""; }; @@ -41,6 +85,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 65B5150D29BB4AB8005DC684 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -48,6 +99,7 @@ isa = PBXGroup; children = ( AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */, + 653C8E9029BB40B200E6376F /* UniformTypeIdentifiers.framework */, ); name = Frameworks; sourceTree = ""; @@ -56,6 +108,7 @@ isa = PBXGroup; children = ( 504EC3061FED79650016851F /* App */, + 65B5151129BB4AB8005DC684 /* upload */, 504EC3051FED79650016851F /* Products */, 7F8756D8B27F46E3366F6CEA /* Pods */, 27E2DDA53C4D2A4D1A88CE4A /* Frameworks */, @@ -66,6 +119,7 @@ isa = PBXGroup; children = ( 504EC3041FED79650016851F /* App.app */, + 65B5151029BB4AB8005DC684 /* upload.appex */, ); name = Products; sourceTree = ""; @@ -73,6 +127,7 @@ 504EC3061FED79650016851F /* App */ = { isa = PBXGroup; children = ( + 65B5151E29BB74FD005DC684 /* App.entitlements */, 50379B222058CBB4000EE86E /* capacitor.config.json */, 504EC3071FED79650016851F /* AppDelegate.swift */, 504EC30B1FED79650016851F /* Main.storyboard */, @@ -85,6 +140,17 @@ path = App; sourceTree = ""; }; + 65B5151129BB4AB8005DC684 /* upload */ = { + isa = PBXGroup; + children = ( + 65B5153129BB7B97005DC684 /* upload.entitlements */, + 65B5151229BB4AB8005DC684 /* ShareViewController.swift */, + 65B5151429BB4AB8005DC684 /* MainInterface.storyboard */, + 65B5151729BB4AB8005DC684 /* Info.plist */, + ); + path = upload; + sourceTree = ""; + }; 7F8756D8B27F46E3366F6CEA /* Pods */ = { isa = PBXGroup; children = ( @@ -106,23 +172,43 @@ 504EC3011FED79650016851F /* Frameworks */, 504EC3021FED79650016851F /* Resources */, 9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */, + 653C8E9E29BB40B300E6376F /* Embed Foundation Extensions */, + 65B5150829BB48F4005DC684 /* Embed ExtensionKit Extensions */, ); buildRules = ( ); dependencies = ( + 65B5151929BB4AB8005DC684 /* PBXTargetDependency */, ); name = App; productName = App; productReference = 504EC3041FED79650016851F /* App.app */; productType = "com.apple.product-type.application"; }; + 65B5150F29BB4AB8005DC684 /* upload */ = { + isa = PBXNativeTarget; + buildConfigurationList = 65B5151B29BB4AB8005DC684 /* Build configuration list for PBXNativeTarget "upload" */; + buildPhases = ( + 65B5150C29BB4AB8005DC684 /* Sources */, + 65B5150D29BB4AB8005DC684 /* Frameworks */, + 65B5150E29BB4AB8005DC684 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = upload; + productName = upload; + productReference = 65B5151029BB4AB8005DC684 /* upload.appex */; + productType = "com.apple.product-type.app-extension"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 504EC2FC1FED79650016851F /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0920; + LastSwiftUpdateCheck = 1420; LastUpgradeCheck = 1420; TargetAttributes = { 504EC3031FED79650016851F = { @@ -130,6 +216,10 @@ LastSwiftMigration = 1100; ProvisioningStyle = Automatic; }; + 65B5150F29BB4AB8005DC684 = { + CreatedOnToolsVersion = 14.2; + ProvisioningStyle = Automatic; + }; }; }; buildConfigurationList = 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */; @@ -146,6 +236,7 @@ projectRoot = ""; targets = ( 504EC3031FED79650016851F /* App */, + 65B5150F29BB4AB8005DC684 /* upload */, ); }; /* End PBXProject section */ @@ -164,6 +255,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 65B5150E29BB4AB8005DC684 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 65B5151629BB4AB8005DC684 /* MainInterface.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -211,8 +310,24 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 65B5150C29BB4AB8005DC684 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 65B5151329BB4AB8005DC684 /* ShareViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 65B5151929BB4AB8005DC684 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 65B5150F29BB4AB8005DC684 /* upload */; + targetProxy = 65B5151829BB4AB8005DC684 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ 504EC30B1FED79650016851F /* Main.storyboard */ = { isa = PBXVariantGroup; @@ -230,6 +345,14 @@ name = LaunchScreen.storyboard; sourceTree = ""; }; + 65B5151429BB4AB8005DC684 /* MainInterface.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 65B5151529BB4AB8005DC684 /* Base */, + ); + name = MainInterface.storyboard; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -350,7 +473,9 @@ isa = XCBuildConfiguration; baseConfigurationReference = FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = App/App.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 4RW9XSSSMV; @@ -371,7 +496,9 @@ isa = XCBuildConfiguration; baseConfigurationReference = AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = App/App.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 4RW9XSSSMV; @@ -387,6 +514,59 @@ }; name = Release; }; + 65B5151C29BB4AB8005DC684 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_ENTITLEMENTS = upload/upload.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 4RW9XSSSMV; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = upload/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = upload; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = gcube.workspace.starter.upload; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 65B5151D29BB4AB8005DC684 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_ENTITLEMENTS = upload/upload.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 4RW9XSSSMV; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = upload/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = upload; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + MARKETING_VERSION = 1.0; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = gcube.workspace.starter.upload; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -408,6 +588,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 65B5151B29BB4AB8005DC684 /* Build configuration list for PBXNativeTarget "upload" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 65B5151C29BB4AB8005DC684 /* Debug */, + 65B5151D29BB4AB8005DC684 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 504EC2FC1FED79650016851F /* Project object */; diff --git a/ios/App/App/App.entitlements b/ios/App/App/App.entitlements new file mode 100644 index 0000000..a82c375 --- /dev/null +++ b/ios/App/App/App.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.gcube.workspace + + + diff --git a/ios/App/App/AppDelegate.swift b/ios/App/App/AppDelegate.swift index c3cd83b..e6a6964 100644 --- a/ios/App/App/AppDelegate.swift +++ b/ios/App/App/AppDelegate.swift @@ -1,11 +1,14 @@ import UIKit import Capacitor +import CapacitorShareExtension @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? + let store = ShareStore.store + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true @@ -33,11 +36,45 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } - func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool { - // Called when the app was launched with a url. Feel free to add additional processing here, - // but if you want the App API to support tracking app url opens, make sure to keep this call - return ApplicationDelegateProxy.shared.application(app, open: url, options: options) - } + func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { + + print("application function called") + + var success = true + if CAPBridge.handleOpenUrl(url, options) { + success = ApplicationDelegateProxy.shared.application(app, open: url, options: options) + } + + guard let components = NSURLComponents(url: url, resolvingAgainstBaseURL: true), + let params = components.queryItems else { + return false + } + let titles = params.filter { $0.name == "title" } + let descriptions = params.filter { $0.name == "description" } + let types = params.filter { $0.name == "type" } + let urls = params.filter { $0.name == "url" } + let webPaths = params.filter { $0.name == "webPath" } + + store.shareItems.removeAll() + + if (titles.count > 0){ + for index in 0...titles.count-1 { + var shareItem: JSObject = JSObject() + shareItem["title"] = titles[index].value! + shareItem["description"] = descriptions[index].value! + shareItem["type"] = types[index].value! + shareItem["url"] = urls[index].value! + shareItem["webPath"] = webPaths[index].value! + store.shareItems.append(shareItem) + } + } + + store.processed = false + let nc = NotificationCenter.default + nc.post(name: Notification.Name("triggerSendIntent"), object: nil ) + + return success + } func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { // Called when the app was launched with an activity, including Universal Links. diff --git a/ios/App/App/Info.plist b/ios/App/App/Info.plist index 0b50182..f693a0e 100644 --- a/ios/App/App/Info.plist +++ b/ios/App/App/Info.plist @@ -1,38 +1,42 @@ - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - d4sworkspace - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - $(MARKETING_VERSION) - CFBundleURLTypes - - - CFBundleURLName - com.getcapacitor.capacitor - CFBundleURLSchemes - - d4sworkspace - - - - NSExtensionAttributes + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + d4sworkspace + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(MARKETING_VERSION) + CFBundleURLTypes + - NSExtensionActivationRule - SUBQUERY ( + CFBundleURLName + com.getcapacitor.capacitor + CFBundleURLSchemes + + d4sworkspace + + + + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + LSRequiresIPhoneOS + + NSExtensionAttributes + + NSExtensionActivationRule + SUBQUERY ( extensionItems, $extensionItem, SUBQUERY ( @@ -46,35 +50,30 @@ ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.png" || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.compuserve.gif" ).@count == $extensionItem.attachments.@count - ).@count == 1 - - - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - + ).@count == 1 + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + diff --git a/ios/App/Podfile b/ios/App/Podfile index 6612244..2a45b34 100644 --- a/ios/App/Podfile +++ b/ios/App/Podfile @@ -16,6 +16,7 @@ def capacitor_pods pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard' pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen' pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar' + pod 'CapacitorShareExtension', :path => '../../node_modules/capacitor-share-extension' pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins' end diff --git a/ios/App/upload/upload.entitlements b/ios/App/upload/upload.entitlements new file mode 100644 index 0000000..a82c375 --- /dev/null +++ b/ios/App/upload/upload.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.gcube.workspace + + + diff --git a/package-lock.json b/package-lock.json index f994520..3d77be0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,9 +33,7 @@ "@ionic/angular": "^6.5.4", "angular-oauth2-oidc": "^15.0.1", "capacitor-share-extension": "^2.0.0", - "cordova-plugin-file-opener2": "^4.0.0", "cordova-plugin-inappbrowser": "^5.0.0", - "cordova-plugin-x-socialsharing": "^6.0.4", "ionicons": "^6.1.3", "keycloak-angular": "^13.0.0", "keycloak-js": "^20.0.5", @@ -6614,24 +6612,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cordova-plugin-file-opener2": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cordova-plugin-file-opener2/-/cordova-plugin-file-opener2-4.0.0.tgz", - "integrity": "sha512-+O+MMldI2k5Kjoa62KXYxnZQIGE4k5VfoCmmOUmaV5XM6U6euiiKMfCkuMrOrdAFb1C5Jsx+SuBHbWx1NEB5lw==", - "engines": { - "cordovaDependencies": { - "2.0.0": { - "cordova": ">=6.0.0" - }, - "3.0.0": { - "cordova": ">=7.0.0" - }, - "4.0.0": { - "cordova-android": ">=10.0.0" - } - } - } - }, "node_modules/cordova-plugin-inappbrowser": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/cordova-plugin-inappbrowser/-/cordova-plugin-inappbrowser-5.0.0.tgz", @@ -6656,17 +6636,6 @@ } } }, - "node_modules/cordova-plugin-x-socialsharing": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/cordova-plugin-x-socialsharing/-/cordova-plugin-x-socialsharing-6.0.4.tgz", - "integrity": "sha512-+ak6rN9i2xf/PARA/T3Hss09s0QhpFrOWvrYowy+PkCjGWx/ZVt9RkW+7yKemfyTXSgTp0YkyAAR4r6hPAfBGQ==", - "engines": [ - { - "name": "cordova", - "version": ">=3.0.0" - } - ] - }, "node_modules/core-js-compat": { "version": "3.28.0", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.28.0.tgz", diff --git a/package.json b/package.json index ae20cd0..3bb37e4 100644 --- a/package.json +++ b/package.json @@ -38,9 +38,7 @@ "@ionic/angular": "^6.5.4", "angular-oauth2-oidc": "^15.0.1", "capacitor-share-extension": "^2.0.0", - "cordova-plugin-file-opener2": "^4.0.0", "cordova-plugin-inappbrowser": "^5.0.0", - "cordova-plugin-x-socialsharing": "^6.0.4", "ionicons": "^6.1.3", "keycloak-angular": "^13.0.0", "keycloak-js": "^20.0.5", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 08a1c10..b1e916b 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,7 +1,6 @@ import { NgModule } from '@angular/core'; import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; import { AuthGuard } from './_helper/auth-guard'; -import { LoginGuard } from './_helper/login-guard'; const loginModule = () => import('./login/login.module').then(m => m.LoginPageModule); @@ -15,7 +14,7 @@ const routes: Routes = [ { path: 'tabs', loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule) , canActivate: [AuthGuard] - }, + } ]; @NgModule({ imports: [ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index e0001f4..49fa746 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,18 +3,21 @@ import { APP_INITIALIZER, NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { RouteReuseStrategy } from '@angular/router'; import { KeycloakAngularModule, KeycloakService } from 'keycloak-angular'; -import { IonicModule, IonicRouteStrategy } from '@ionic/angular'; +import { IonicModule, IonicRouteStrategy, ModalController, ToastController } from '@ionic/angular'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import {initializeKeycloak} from './_helper/keycloak-init.factory' import { D4sAuthService } from './d4sauth.service'; +import { D4sIntentService } from './d4s-intent.service'; +import {initializeIntent} from './_helper/intent-init.factory' +import { StoragehubService } from './storagehub.service'; @NgModule({ declarations: [AppComponent], imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule, HttpClientModule, HttpClientModule, KeycloakAngularModule], providers: [ - D4sAuthService, + D4sAuthService, ModalController, StoragehubService, ToastController, { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }, { provide: APP_INITIALIZER, @@ -22,6 +25,12 @@ import { D4sAuthService } from './d4sauth.service'; multi: true, deps: [KeycloakService] }, + { + provide: APP_INITIALIZER, + useFactory: initializeIntent, + multi: true, + deps: [D4sIntentService] + }, ], bootstrap: [AppComponent] diff --git a/src/app/model/actions/actions.ts b/src/app/model/actions/actions.ts index 1def8d5..bbb8156 100644 --- a/src/app/model/actions/actions.ts +++ b/src/app/model/actions/actions.ts @@ -6,10 +6,10 @@ import { RenameAction } from "./rename-item"; export class Actions { - private static mv = new MoveAction(); - private static cp = new CopyAction(); - private static ren = new RenameAction(); - private static del = new DeleteAction(); + static mv = new MoveAction(); + static cp = new CopyAction(); + static ren = new RenameAction(); + static del = new DeleteAction(); public static getActionsPerType(type: string): Action[] { switch (type) { diff --git a/src/app/model/actions/move-item.ts b/src/app/model/actions/move-item.ts index 17d8c44..c6dce87 100644 --- a/src/app/model/actions/move-item.ts +++ b/src/app/model/actions/move-item.ts @@ -1,5 +1,4 @@ import { ModalOptions } from "@ionic/angular"; -import { Observable } from "rxjs"; import { StoragehubService } from "src/app/storagehub.service"; import { WsViewerComponent } from "src/app/ws-viewer/ws-viewer.component"; import { WSItem } from "../ws-item"; diff --git a/src/app/ws-viewer/ws-viewer.component.ts b/src/app/ws-viewer/ws-viewer.component.ts index 4b4f72b..9347119 100644 --- a/src/app/ws-viewer/ws-viewer.component.ts +++ b/src/app/ws-viewer/ws-viewer.component.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { Component, Input, OnInit } from '@angular/core'; import { MatIconModule } from '@angular/material/icon'; -import { IonicModule, LoadingController, ModalController, ToastController } from '@ionic/angular'; +import { IonicModule, ModalController } from '@ionic/angular'; import { Sorting, SortName, SortType } from '../model/sorting'; import { WSItem } from '../model/ws-item'; import { StoragehubService } from '../storagehub.service'; @@ -18,8 +18,8 @@ import { StoragehubService } from '../storagehub.service'; }) export class WsViewerComponent implements OnInit { - constructor(private storagehub: StoragehubService, private modalCtrl: ModalController, - ) { } + constructor(private storagehub: StoragehubService, + private modalCtrl: ModalController) { } @Input() notClickableIds: string[] = []; @Input() notSelectableIds: string[] = []; diff --git a/src/main.ts b/src/main.ts index 91ec6da..66423ee 100644 --- a/src/main.ts +++ b/src/main.ts @@ -10,3 +10,5 @@ if (environment.production) { platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.log(err)); + + \ No newline at end of file