shared file config done

This commit is contained in:
Lorito Tiago
2024-02-08 12:37:57 +01:00
parent e6f70cb7e6
commit 1e50f31584
9 changed files with 589 additions and 81 deletions
+184 -5
View File
@@ -16,8 +16,35 @@
50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; };
A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */; };
DAD1AB3F2ACF3A7F001D9958 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = DAD1AB3D2ACF39DE001D9958 /* GoogleService-Info.plist */; };
DAD98CE32B73A46D002F1EA9 /* ShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAD98CE22B73A46D002F1EA9 /* ShareViewController.swift */; };
DAD98CE62B73A46D002F1EA9 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DAD98CE42B73A46D002F1EA9 /* MainInterface.storyboard */; };
DAD98CEA2B73A46D002F1EA9 /* MyShareExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = DAD98CE02B73A46D002F1EA9 /* MyShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
DAD98CE82B73A46D002F1EA9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 504EC2FC1FED79650016851F /* Project object */;
proxyType = 1;
remoteGlobalIDString = DAD98CDF2B73A46D002F1EA9;
remoteInfo = MyShareExtension;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
DAD98CEB2B73A46D002F1EA9 /* Embed Foundation Extensions */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 13;
files = (
DAD98CEA2B73A46D002F1EA9 /* MyShareExtension.appex in Embed Foundation Extensions */,
);
name = "Embed Foundation Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
2FAD9762203C412B000D30F8 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = config.xml; sourceTree = "<group>"; };
50379B222058CBB4000EE86E /* capacitor.config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = capacitor.config.json; sourceTree = "<group>"; };
@@ -37,6 +64,11 @@
DA6FE4D82ACEF2DA006F1E0D /* FirebaseMessaging.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = FirebaseMessaging.framework; sourceTree = BUILT_PRODUCTS_DIR; };
DA8422AF2AD03FBE00AC9118 /* App.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = App.entitlements; sourceTree = "<group>"; };
DAD1AB3D2ACF39DE001D9958 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../../Downloads/App 2023-09-14 12-28-07/GoogleService-Info.plist"; sourceTree = "<group>"; };
DAD98CE02B73A46D002F1EA9 /* MyShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = MyShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
DAD98CE22B73A46D002F1EA9 /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = "<group>"; };
DAD98CE52B73A46D002F1EA9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = "<group>"; };
DAD98CE72B73A46D002F1EA9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
DAD98CEF2B73A5CB002F1EA9 /* MyShareExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MyShareExtension.entitlements; sourceTree = "<group>"; };
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 = "<group>"; };
/* End PBXFileReference section */
@@ -49,6 +81,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
DAD98CDD2B73A46D002F1EA9 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@@ -69,6 +108,7 @@
isa = PBXGroup;
children = (
504EC3061FED79650016851F /* App */,
DAD98CE12B73A46D002F1EA9 /* MyShareExtension */,
504EC3051FED79650016851F /* Products */,
7F8756D8B27F46E3366F6CEA /* Pods */,
27E2DDA53C4D2A4D1A88CE4A /* Frameworks */,
@@ -79,6 +119,7 @@
isa = PBXGroup;
children = (
504EC3041FED79650016851F /* App.app */,
DAD98CE02B73A46D002F1EA9 /* MyShareExtension.appex */,
);
name = Products;
sourceTree = "<group>";
@@ -109,6 +150,17 @@
name = Pods;
sourceTree = "<group>";
};
DAD98CE12B73A46D002F1EA9 /* MyShareExtension */ = {
isa = PBXGroup;
children = (
DAD98CEF2B73A5CB002F1EA9 /* MyShareExtension.entitlements */,
DAD98CE22B73A46D002F1EA9 /* ShareViewController.swift */,
DAD98CE42B73A46D002F1EA9 /* MainInterface.storyboard */,
DAD98CE72B73A46D002F1EA9 /* Info.plist */,
);
path = MyShareExtension;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -122,23 +174,42 @@
504EC3021FED79650016851F /* Resources */,
9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */,
5B7AACB22ECDCEAA343DC840 /* [CP] Copy Pods Resources */,
DAD98CEB2B73A46D002F1EA9 /* Embed Foundation Extensions */,
);
buildRules = (
);
dependencies = (
DAD98CE92B73A46D002F1EA9 /* PBXTargetDependency */,
);
name = App;
productName = App;
productReference = 504EC3041FED79650016851F /* App.app */;
productType = "com.apple.product-type.application";
};
DAD98CDF2B73A46D002F1EA9 /* MyShareExtension */ = {
isa = PBXNativeTarget;
buildConfigurationList = DAD98CEE2B73A46D002F1EA9 /* Build configuration list for PBXNativeTarget "MyShareExtension" */;
buildPhases = (
DAD98CDC2B73A46D002F1EA9 /* Sources */,
DAD98CDD2B73A46D002F1EA9 /* Frameworks */,
DAD98CDE2B73A46D002F1EA9 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = MyShareExtension;
productName = MyShareExtension;
productReference = DAD98CE02B73A46D002F1EA9 /* MyShareExtension.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 = {
@@ -146,6 +217,9 @@
LastSwiftMigration = 1100;
ProvisioningStyle = Manual;
};
DAD98CDF2B73A46D002F1EA9 = {
CreatedOnToolsVersion = 14.2;
};
};
};
buildConfigurationList = 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */;
@@ -165,6 +239,7 @@
projectRoot = "";
targets = (
504EC3031FED79650016851F /* App */,
DAD98CDF2B73A46D002F1EA9 /* MyShareExtension */,
);
};
/* End PBXProject section */
@@ -184,6 +259,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
DAD98CDE2B73A46D002F1EA9 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DAD98CE62B73A46D002F1EA9 /* MainInterface.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
@@ -246,8 +329,24 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
DAD98CDC2B73A46D002F1EA9 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DAD98CE32B73A46D002F1EA9 /* ShareViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
DAD98CE92B73A46D002F1EA9 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = DAD98CDF2B73A46D002F1EA9 /* MyShareExtension */;
targetProxy = DAD98CE82B73A46D002F1EA9 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
504EC30B1FED79650016851F /* Main.storyboard */ = {
isa = PBXVariantGroup;
@@ -265,6 +364,14 @@
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
DAD98CE42B73A46D002F1EA9 /* MainInterface.storyboard */ = {
isa = PBXVariantGroup;
children = (
DAD98CE52B73A46D002F1EA9 /* Base */,
);
name = MainInterface.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
@@ -386,11 +493,12 @@
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_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 65;
CURRENT_PROJECT_VERSION = 68;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS;
INFOPLIST_FILE = App/Info.plist;
@@ -404,7 +512,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.gpr.gabinetedigital.teste;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = GabineteProfile;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = GabineteDigitalProfile;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
@@ -415,11 +523,12 @@
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_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 65;
CURRENT_PROJECT_VERSION = 68;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS;
INFOPLIST_FILE = App/Info.plist;
@@ -432,13 +541,74 @@
PRODUCT_BUNDLE_IDENTIFIER = com.gpr.gabinetedigital.teste;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = GabineteProfile;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = GabineteDigitalProfile;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
DAD98CEC2B73A46D002F1EA9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_ENTITLEMENTS = MyShareExtension/MyShareExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 94BRNM2LSS;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = MyShareExtension/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = MyShareExtension;
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 = com.gpr.gabinetedigital.teste.MyShareExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
DAD98CED2B73A46D002F1EA9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_ENTITLEMENTS = MyShareExtension/MyShareExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 94BRNM2LSS;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = MyShareExtension/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = MyShareExtension;
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 = com.gpr.gabinetedigital.teste.MyShareExtension;
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 */
@@ -460,6 +630,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
DAD98CEE2B73A46D002F1EA9 /* Build configuration list for PBXNativeTarget "MyShareExtension" */ = {
isa = XCConfigurationList;
buildConfigurations = (
DAD98CEC2B73A46D002F1EA9 /* Debug */,
DAD98CED2B73A46D002F1EA9 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */
+4
View File
@@ -4,5 +4,9 @@
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.security.application-groups</key>
<array>
<string>group.gabinete</string>
</array>
</dict>
</plist>
+40 -5
View File
@@ -2,10 +2,15 @@ import UIKit
import Capacitor
import FirebaseCore
import Firebase
import SendIntent
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
// share intent
let store = ShareStore.store
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
@@ -53,11 +58,41 @@ 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 {
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" }
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!
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.
+83 -69
View File
@@ -2,74 +2,88 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FirebaseAppDelegateProxyEnabled</key>
<true/>
<key>UNUserNotificationCenterDelegate</key>
<string>YourApp.NotificationDelegate</string>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Gabinete Digital</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>Used to demonstrate image picker plugin</string>
<key>NSFaceIDUsageDescription</key>
<string>$FACEID_USAGE_DESCRIPTION</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>some string</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>some string</string>
<key>NSLocationUsageDescription</key>
<string>Need location access for updating nearby friends</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs your location to test the location feature of the Google Maps plugin.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Used to capture audio for image picker plugin</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Privacy - Photo Library Additions Usage Description</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Used to demonstrate image picker plugin</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Gabinete Digital</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.gpr.gabinetedigital.teste</string>
<key>CFBundleURLSchemes</key>
<array>
<string>gabineteDigital</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>FirebaseAppDelegateProxyEnabled</key>
<true/>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>Used to demonstrate image picker plugin</string>
<key>NSFaceIDUsageDescription</key>
<string>$FACEID_USAGE_DESCRIPTION</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>some string</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>some string</string>
<key>NSLocationUsageDescription</key>
<string>Need location access for updating nearby friends</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs your location to test the location feature of the Google Maps plugin.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Used to capture audio for image picker plugin</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Privacy - Photo Library Additions Usage Description</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Used to demonstrate image picker plugin</string>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>UNUserNotificationCenterDelegate</key>
<string>YourApp.NotificationDelegate</string>
</dict>
</plist>
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="j1y-V4-xli">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Share View Controller-->
<scene sceneID="ceB-am-kn3">
<objects>
<viewController id="j1y-V4-xli" customClass="ShareViewController" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" opaque="NO" contentMode="scaleToFill" id="wbc-yd-nQP">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="1Xd-am-t49"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="CEy-Cv-SGf" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
+48
View File
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string></string>
</dict>
<dict>
<key>CFBundleURLName</key>
<string>com.capacitorjs.app.testapp</string>
</dict>
</array>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<string>TRUEPREDICATE</string>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsFileWithMaxCount</key>
<integer>5</integer>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>5</integer>
<key>NSExtensionActivationSupportsMovieWithMaxCount</key>
<integer>5</integer>
<key>NSExtensionActivationSupportsText</key>
<true/>
<key>NSExtensionActivationSupportsWebPageWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationUsesStrictMatching</key>
<false/>
</dict>
</dict>
</plist>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.share</string>
</array>
<key>keychain-access-groups</key>
<array/>
</dict>
</plist>
@@ -0,0 +1,193 @@
//
// ShareViewController.swift
// mindlib
//
// Created by Carsten Klaffke on 05.07.20.
//
import MobileCoreServices
import Social
import UIKit
class ShareItem {
public var title: String?
public var type: String?
public var url: String?
}
class ShareViewController: UIViewController {
private var shareItems: [ShareItem] = []
override public func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
self.extensionContext!.completeRequest(returningItems: [], completionHandler: nil)
}
private func sendData() {
let queryItems = shareItems.map {
[
URLQueryItem(
name: "title",
value: $0.title?.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? ""),
URLQueryItem(name: "description", value: ""),
URLQueryItem(
name: "type",
value: $0.type?.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? ""),
URLQueryItem(
name: "url",
value: $0.url?.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? ""),
]
}.flatMap({ $0 })
var urlComps = URLComponents(string: "gabineteDigital://")!
urlComps.queryItems = queryItems
openURL(urlComps.url!)
}
fileprivate func createSharedFileUrl(_ url: URL?) -> String {
let fileManager = FileManager.default
let copyFileUrl =
fileManager.containerURL(forSecurityApplicationGroupIdentifier: "group.gabinete")!
.absoluteString.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! + url!
.lastPathComponent.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
try? Data(contentsOf: url!).write(to: URL(string: copyFileUrl)!)
return copyFileUrl
}
func saveScreenshot(_ image: UIImage, _ index: Int) -> String {
let fileManager = FileManager.default
let copyFileUrl =
fileManager.containerURL(forSecurityApplicationGroupIdentifier: "group.SendIntentExample")!
.absoluteString.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
+ "/screenshot_\(index).png"
do {
try image.pngData()?.write(to: URL(string: copyFileUrl)!)
return copyFileUrl
} catch {
print(error.localizedDescription)
return ""
}
}
fileprivate func handleTypeUrl(_ attachment: NSItemProvider)
async throws -> ShareItem
{
let results = try await attachment.loadItem(forTypeIdentifier: kUTTypeURL as String, options: nil)
let url = results as! URL?
let shareItem: ShareItem = ShareItem()
if url!.isFileURL {
shareItem.title = url!.lastPathComponent
shareItem.type = "application/" + url!.pathExtension.lowercased()
shareItem.url = createSharedFileUrl(url)
} else {
shareItem.title = url!.absoluteString
shareItem.url = url!.absoluteString
shareItem.type = "text/plain"
}
return shareItem
}
fileprivate func handleTypeText(_ attachment: NSItemProvider)
async throws -> ShareItem
{
let results = try await attachment.loadItem(forTypeIdentifier: kUTTypeText as String, options: nil)
let shareItem: ShareItem = ShareItem()
let text = results as! String
shareItem.title = text
shareItem.type = "text/plain"
return shareItem
}
fileprivate func handleTypeMovie(_ attachment: NSItemProvider)
async throws -> ShareItem
{
let results = try await attachment.loadItem(forTypeIdentifier: kUTTypeMovie as String, options: nil)
let shareItem: ShareItem = ShareItem()
let url = results as! URL?
shareItem.title = url!.lastPathComponent
shareItem.type = "video/" + url!.pathExtension.lowercased()
shareItem.url = createSharedFileUrl(url)
return shareItem
}
fileprivate func handleTypeImage(_ attachment: NSItemProvider, _ index: Int)
async throws -> ShareItem
{
let data = try await attachment.loadItem(forTypeIdentifier: kUTTypeImage as String, options: nil)
let shareItem: ShareItem = ShareItem()
switch data {
case let image as UIImage:
shareItem.title = "screenshot_\(index)"
shareItem.type = "image/png"
shareItem.url = self.saveScreenshot(image, index)
case let url as URL:
shareItem.title = url.lastPathComponent
shareItem.type = "image/" + url.pathExtension.lowercased()
shareItem.url = self.createSharedFileUrl(url)
default:
print("Unexpected image data:", type(of: data))
}
return shareItem
}
override public func viewDidLoad() {
super.viewDidLoad()
shareItems.removeAll()
let extensionItem = extensionContext?.inputItems[0] as! NSExtensionItem
Task {
try await withThrowingTaskGroup(
of: ShareItem.self,
body: { taskGroup in
for (index, attachment) in extensionItem.attachments!.enumerated() {
if attachment.hasItemConformingToTypeIdentifier(kUTTypeURL as String) {
taskGroup.addTask {
return try await self.handleTypeUrl(attachment)
}
} else if attachment.hasItemConformingToTypeIdentifier(kUTTypeText as String) {
taskGroup.addTask {
return try await self.handleTypeText(attachment)
}
} else if attachment.hasItemConformingToTypeIdentifier(kUTTypeMovie as String) {
taskGroup.addTask {
return try await self.handleTypeMovie(attachment)
}
} else if attachment.hasItemConformingToTypeIdentifier(kUTTypeImage as String) {
taskGroup.addTask {
return try await self.handleTypeImage(attachment, index)
}
}
}
for try await item in taskGroup {
self.shareItems.append(item)
}
})
self.sendData()
}
}
@objc func openURL(_ url: URL) -> Bool {
var responder: UIResponder? = self
while responder != nil {
if let application = responder as? UIApplication {
return application.perform(#selector(openURL(_:)), with: url) != nil
}
responder = responder?.next
}
return false
}
}
+1 -2
View File
@@ -129,7 +129,6 @@
"ci": "^2.1.1",
"cordova": "^11.0.0",
"cordova-plugin-crop": "^0.4.0",
"cordova-plugin-dbcopy": "git+https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git",
"cordova-plugin-document-viewer": "^1.0.0",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-file-opener2": "^3.0.5",
@@ -307,4 +306,4 @@
"url": "git+https://Kayaya@bitbucket.org/equilibriumito/gabinete-digital.git"
},
"license": "ISC"
}
}