diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 000000000..75e8c5aec --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,9 @@ +App/build +App/Pods +App/Podfile.lock +App/App/public +DerivedData +xcuserdata + +# Cordova plugins for Capacitor +capacitor-cordova-ios-plugins diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj new file mode 100644 index 000000000..8d49770cd --- /dev/null +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -0,0 +1,402 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + 2FAD9763203C412B000D30F8 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = 2FAD9762203C412B000D30F8 /* config.xml */; }; + 50379B232058CBB4000EE86E /* capacitor.config.json in Resources */ = {isa = PBXBuildFile; fileRef = 50379B222058CBB4000EE86E /* capacitor.config.json */; }; + 504EC3081FED79650016851F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504EC3071FED79650016851F /* AppDelegate.swift */; }; + 504EC30D1FED79650016851F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30B1FED79650016851F /* Main.storyboard */; }; + 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 */; }; + A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */; }; +/* End PBXBuildFile 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 = ""; }; + 504EC3041FED79650016851F /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 504EC3071FED79650016851F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 504EC30C1FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 504EC30E1FED79650016851F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 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 = ""; }; + 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 = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 504EC3011FED79650016851F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 27E2DDA53C4D2A4D1A88CE4A /* Frameworks */ = { + isa = PBXGroup; + children = ( + AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 504EC2FB1FED79650016851F = { + isa = PBXGroup; + children = ( + 504EC3061FED79650016851F /* App */, + 504EC3051FED79650016851F /* Products */, + 7F8756D8B27F46E3366F6CEA /* Pods */, + 27E2DDA53C4D2A4D1A88CE4A /* Frameworks */, + ); + sourceTree = ""; + }; + 504EC3051FED79650016851F /* Products */ = { + isa = PBXGroup; + children = ( + 504EC3041FED79650016851F /* App.app */, + ); + name = Products; + sourceTree = ""; + }; + 504EC3061FED79650016851F /* App */ = { + isa = PBXGroup; + children = ( + 50379B222058CBB4000EE86E /* capacitor.config.json */, + 504EC3071FED79650016851F /* AppDelegate.swift */, + 504EC30B1FED79650016851F /* Main.storyboard */, + 504EC30E1FED79650016851F /* Assets.xcassets */, + 504EC3101FED79650016851F /* LaunchScreen.storyboard */, + 504EC3131FED79650016851F /* Info.plist */, + 2FAD9762203C412B000D30F8 /* config.xml */, + 50B271D01FEDC1A000F3C39B /* public */, + ); + path = App; + sourceTree = ""; + }; + 7F8756D8B27F46E3366F6CEA /* Pods */ = { + isa = PBXGroup; + children = ( + FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */, + AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 504EC3031FED79650016851F /* App */ = { + isa = PBXNativeTarget; + buildConfigurationList = 504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */; + buildPhases = ( + 6634F4EFEBD30273BCE97C65 /* [CP] Check Pods Manifest.lock */, + 504EC3001FED79650016851F /* Sources */, + 504EC3011FED79650016851F /* Frameworks */, + 504EC3021FED79650016851F /* Resources */, + 9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = App; + productName = App; + productReference = 504EC3041FED79650016851F /* App.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 504EC2FC1FED79650016851F /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 0920; + TargetAttributes = { + 504EC3031FED79650016851F = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 504EC2FB1FED79650016851F; + productRefGroup = 504EC3051FED79650016851F /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 504EC3031FED79650016851F /* App */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 504EC3021FED79650016851F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */, + 50B271D11FEDC1A000F3C39B /* public in Resources */, + 504EC30F1FED79650016851F /* Assets.xcassets in Resources */, + 50379B232058CBB4000EE86E /* capacitor.config.json in Resources */, + 504EC30D1FED79650016851F /* Main.storyboard in Resources */, + 2FAD9763203C412B000D30F8 /* config.xml in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 6634F4EFEBD30273BCE97C65 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-App-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-App/Pods-App-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 504EC3001FED79650016851F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 504EC3081FED79650016851F /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 504EC30B1FED79650016851F /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 504EC30C1FED79650016851F /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 504EC3101FED79650016851F /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 504EC3111FED79650016851F /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 504EC3141FED79650016851F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 504EC3151FED79650016851F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 504EC3171FED79650016851F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = App/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; + PRODUCT_BUNDLE_IDENTIFIER = com.gpr.gabinetedigital; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 504EC3181FED79650016851F /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = App/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.gpr.gabinetedigital; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 504EC3141FED79650016851F /* Debug */, + 504EC3151FED79650016851F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 504EC3171FED79650016851F /* Debug */, + 504EC3181FED79650016851F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 504EC2FC1FED79650016851F /* Project object */; +} diff --git a/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..42daef8a1 --- /dev/null +++ b/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/App/App.xcworkspace/contents.xcworkspacedata b/ios/App/App.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..b301e824b --- /dev/null +++ b/ios/App/App.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/App/App/AppDelegate.swift b/ios/App/App/AppDelegate.swift new file mode 100644 index 000000000..53e376039 --- /dev/null +++ b/ios/App/App/AppDelegate.swift @@ -0,0 +1,60 @@ +import UIKit +import Capacitor + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // 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. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // 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(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + // Called when the app was launched with an activity, including Universal Links. + // 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(application, continue: userActivity, restorationHandler: restorationHandler) + } + + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + super.touchesBegan(touches, with: event) + + let statusBarRect = UIApplication.shared.statusBarFrame + guard let touchPoint = event?.allTouches?.first?.location(in: self.window) else { return } + + if statusBarRect.contains(touchPoint) { + NotificationCenter.default.post(name: .capacitorStatusBarTapped, object: nil) + } + } + +} diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png new file mode 100644 index 000000000..2f503741c Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png new file mode 100644 index 000000000..dd72c1ce8 Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png new file mode 100644 index 000000000..dd72c1ce8 Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png new file mode 100644 index 000000000..7fbf0a84a Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png new file mode 100644 index 000000000..f996ea18f Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png new file mode 100644 index 000000000..bb2935fb7 Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png new file mode 100644 index 000000000..bb2935fb7 Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png new file mode 100644 index 000000000..21d16e5b1 Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png new file mode 100644 index 000000000..dd72c1ce8 Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png new file mode 100644 index 000000000..ff0754519 Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png new file mode 100644 index 000000000..ff0754519 Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png new file mode 100644 index 000000000..3401fa887 Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png new file mode 100644 index 000000000..adf6ba01d Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png new file mode 100644 index 000000000..ffd0da781 Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png new file mode 100644 index 000000000..90aea7cd2 Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png new file mode 100644 index 000000000..2f5eafb6b Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png new file mode 100644 index 000000000..89c8d0448 Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png new file mode 100644 index 000000000..ef541c90a Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..90eea7ec7 --- /dev/null +++ b/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,116 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "AppIcon-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "AppIcon-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "AppIcon-29x29@2x-1.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "AppIcon-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "AppIcon-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "AppIcon-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "AppIcon-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "AppIcon-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "AppIcon-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "AppIcon-20x20@2x-1.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "AppIcon-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "AppIcon-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "AppIcon-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "AppIcon-40x40@2x-1.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "AppIcon-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "AppIcon-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "AppIcon-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "AppIcon-512@2x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/App/App/Assets.xcassets/Contents.json b/ios/App/App/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/ios/App/App/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json b/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json new file mode 100644 index 000000000..d7d96a67c --- /dev/null +++ b/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "splash-2732x2732-2.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "splash-2732x2732-1.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "splash-2732x2732.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png new file mode 100644 index 000000000..33ea6c970 Binary files /dev/null and b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png differ diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png new file mode 100644 index 000000000..33ea6c970 Binary files /dev/null and b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png differ diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png new file mode 100644 index 000000000..33ea6c970 Binary files /dev/null and b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png differ diff --git a/ios/App/App/Base.lproj/LaunchScreen.storyboard b/ios/App/App/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..e7ae5d780 --- /dev/null +++ b/ios/App/App/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/App/App/Base.lproj/Main.storyboard b/ios/App/App/Base.lproj/Main.storyboard new file mode 100644 index 000000000..b44df7be8 --- /dev/null +++ b/ios/App/App/Base.lproj/Main.storyboard @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ios/App/App/Info.plist b/ios/App/App/Info.plist new file mode 100644 index 000000000..a63138a44 --- /dev/null +++ b/ios/App/App/Info.plist @@ -0,0 +1,56 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + gabinete-digital + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + NSMicrophoneUsageDescription + We want to record some audio from you + + diff --git a/ios/App/App/capacitor.config.json b/ios/App/App/capacitor.config.json new file mode 100644 index 000000000..8deba142d --- /dev/null +++ b/ios/App/App/capacitor.config.json @@ -0,0 +1,22 @@ +{ + "appId": "com.gpr.gabinetedigital", + "appName": "gabinete-digital", + "webDir": "www", + "npmClient": "npm", + "linuxAndroidStudioPath": "/snap/android-studio/current/android-studio/bin/studio.sh", + "cordova": { + "preferences": { + "ScrollEnabled": "false", + "BackupWebStorage": "none", + "SplashMaintainAspectRatio": "true", + "FadeSplashScreenDuration": "300", + "SplashShowOnlyFirstTime": "false", + "SplashScreen": "screen", + "SplashScreenDelay": "3000" + } + }, + "android": { + "allowMixedContent": true + }, + "bundledWebRuntime": false +} diff --git a/ios/App/App/config.xml b/ios/App/App/config.xml new file mode 100644 index 000000000..43b503a74 --- /dev/null +++ b/ios/App/App/config.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ios/App/Podfile b/ios/App/Podfile new file mode 100644 index 000000000..ee4cde511 --- /dev/null +++ b/ios/App/Podfile @@ -0,0 +1,27 @@ +platform :ios, '12.0' +use_frameworks! + +# workaround to avoid Xcode caching of Pods that requires +# Product -> Clean Build Folder after new Cordova plugins installed +# Requires CocoaPods 1.6 or newer +install! 'cocoapods', :disable_input_output_paths => true + +def capacitor_pods + pod 'Capacitor', :path => '../../node_modules/@capacitor/ios' + pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios' + pod 'CapacitorApp', :path => '..\..\node_modules\@capacitor\app' + pod 'CapacitorCamera', :path => '..\..\node_modules\@capacitor\camera' + pod 'CapacitorHaptics', :path => '..\..\node_modules\@capacitor\haptics' + pod 'CapacitorKeyboard', :path => '..\..\node_modules\@capacitor\keyboard' + pod 'CapacitorNetwork', :path => '..\..\node_modules\@capacitor\network' + pod 'CapacitorFilesystem', :path => '..\..\node_modules\@capacitor\filesystem' + pod 'CapacitorPushNotifications', :path => '..\..\node_modules\@capacitor\push-notifications' + pod 'CapacitorVoiceRecorder', :path => '..\..\node_modules\capacitor-voice-recorder' + pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins' + pod 'CordovaPluginsResources', :path => '../capacitor-cordova-ios-plugins' +end + +target 'App' do + capacitor_pods + # Add your Pods here +end diff --git a/package-lock.json b/package-lock.json index 795c870b9..ac401ff1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2031,15 +2031,20 @@ "dev": true }, "@capacitor/android": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-3.3.0.tgz", - "integrity": "sha512-dzbzdN7KjjwpUbg7mZKVkgAVytEwGyXUL4Z1t9c12UhViJaNjU7/nSlTXjb+IiauwVg9oI2LHtSVrp1NIjUycw==" + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-3.3.1.tgz", + "integrity": "sha512-TB9UJh6/e6CV6KDpu/lNHKhgVvnDL2d3crNYtfKzp64CzeZhttQGIQShXSdMb3DG4kk7Zi/qBlfSaWBBD95NhQ==" }, "@capacitor/app": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@capacitor/app/-/app-1.0.5.tgz", "integrity": "sha512-U0dAw1CAjKyguSRxKDabszsQ4dj679RnxaUZrSHDR5Jnt5x308oQuKXFP++wnMBbw72D02iqjG0a+/Ujye7C9g==" }, + "@capacitor/camera": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@capacitor/camera/-/camera-1.2.0.tgz", + "integrity": "sha512-NAIGWnyHBGQ/dgla/D4KDkAeQ2f3fzw+D+DIkGNH3f1ciX4bXC7lNbDVU67SMOuNt+CmcTJF64q3nVXcpv5JvQ==" + }, "@capacitor/cli": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-3.3.0.tgz", @@ -2152,15 +2157,25 @@ "tslib": "^2.1.0" } }, + "@capacitor/filesystem": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@capacitor/filesystem/-/filesystem-1.0.6.tgz", + "integrity": "sha512-8xqUbDZFGBMhgqoBSn9wEd9OBPdHIRegQ9zCCZcpHNf3FFAIby1ck+aDFnoq+Da49xhD6ks1SKCBSxz/26qWTw==" + }, "@capacitor/haptics": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@capacitor/haptics/-/haptics-1.1.2.tgz", - "integrity": "sha512-h7uAK/iTSDYfvMY2aaZJ5tlGyIOOdH17mzHHED4jgP3TSXbsmeYU839u56hNGi9vb4Q00Jsb0YzsDMzSjv4Nag==" + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@capacitor/haptics/-/haptics-1.1.3.tgz", + "integrity": "sha512-ui2mY/riK1Y4bxnJKJfclWO61obZ0RHmtErPhpmt4wIEVjG1segYdFop45R2PxyEwoUJgzEsAxnviM/T6k8seQ==" + }, + "@capacitor/ios": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-3.3.0.tgz", + "integrity": "sha512-KImT4hVoQJuAfe01wUYiMLnutMu7PxVCv4c8HVWiW+OuyyOua3lC8wQ5gAauGDugAo6mdM7fVva5a0Vtyhnbdg==" }, "@capacitor/keyboard": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@capacitor/keyboard/-/keyboard-1.1.2.tgz", - "integrity": "sha512-EUduhQzrHma4PlGfdSxVeGIwxR2+/xLRDbjQH5Q4cXqrlYssIX2UyQrL4wNpDaAOg1Z4VD8EzzVolC81LG6Q+A==" + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@capacitor/keyboard/-/keyboard-1.1.3.tgz", + "integrity": "sha512-WpD1f/3HH6IpADiRaFTDGdhrqYhZDikybXXhUdGAEEwHbErHt9zS5RQgbeROjGmkXcurVvQsalQ59YuKU0VzwA==" }, "@capacitor/network": { "version": "1.0.6", @@ -2172,11 +2187,6 @@ "resolved": "https://registry.npmjs.org/@capacitor/push-notifications/-/push-notifications-1.0.7.tgz", "integrity": "sha512-vbvAptFq5cI6xKYYWMb7tsWvA88/PTG4v6ptxN0Ygtc1fQ4l/AzONQiYqdtFpbBhF2fML2kXQ/5eSAfn8HY9aw==" }, - "@capacitor/status-bar": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@capacitor/status-bar/-/status-bar-1.0.5.tgz", - "integrity": "sha512-SZuxjaN5Nr8FKUVlkVH3l0X2JWey0yVMfMhyE3RG7ryUSAesgs3bvkAEXSfjphsHOpt4A/rEeCJb2ZbeCBwroA==" - }, "@cnakazawa/watch": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", @@ -6681,6 +6691,14 @@ "integrity": "sha512-feylzsbDxi1gPZ1IjystzIQZagYYLvfKrSuygUCgf7z6x790VEzze5QEkdSV1U58RA7Hi0+v6fv4K54atOzATg==", "dev": true }, + "capacitor-voice-recorder": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/capacitor-voice-recorder/-/capacitor-voice-recorder-2.0.0.tgz", + "integrity": "sha512-YU0tN8+A963sCYjL9du6jbUqOh5w5dJf++8IFBkuV0sDQZuuLaK//1RypJi0MQLifQESZSjhTVWoXTViIthA/w==", + "requires": { + "get-blob-duration": "^1.2.0" + } + }, "capture-exit": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", @@ -7888,18 +7906,6 @@ "integrity": "sha512-ThmXzl6QIKWFXf4wWw7Q/zpB+VKkz3VM958+5A0sXD4jmR++u7KnGttLksXshVwWr6lvGwUebLYtIyXwS4Ovcg==", "dev": true }, - "cordova-plugin-streaming-media": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cordova-plugin-streaming-media/-/cordova-plugin-streaming-media-2.3.0.tgz", - "integrity": "sha512-og7UmXbaWoSrOmo/mZu/c7vKDdUMu2eVrdRMvIJY6qqZ6Fv2BrJvOXm8prVt0xjWqWOMJpQs3DAajX8+N39Cqw==", - "dev": true - }, - "cordova-plugin-telerik-imagepicker": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/cordova-plugin-telerik-imagepicker/-/cordova-plugin-telerik-imagepicker-2.3.6.tgz", - "integrity": "sha512-guf+BHB7O3g1ll3++d+aOvTGHXwBmqdxBFJTCKKMIGqazlf+Sq3Bsd1tRRswPRxy1MZRlJIe6Arz4pdCCmOigA==", - "dev": true - }, "cordova-plugin-whitelist": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.5.tgz", @@ -10389,6 +10395,24 @@ "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==" }, + "get-blob-duration": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-blob-duration/-/get-blob-duration-1.2.0.tgz", + "integrity": "sha512-2xNJa+oKznR21eC2ThMzw4a1931a3ogA8aHoY92xruZufc/02G7pl/P793GJZytkyI8xMJ2DepEQ7MWvg/tn/Q==", + "requires": { + "@babel/runtime": "7.11.2" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.11.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz", + "integrity": "sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==", + "requires": { + "regenerator-runtime": "^0.13.4" + } + } + } + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -19336,8 +19360,7 @@ "regenerator-runtime": { "version": "0.13.9", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", - "dev": true + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" }, "regenerator-transform": { "version": "0.14.5", diff --git a/package.json b/package.json index d73c6741c..f11eabe0a 100644 --- a/package.json +++ b/package.json @@ -31,14 +31,16 @@ "@angular/platform-browser": "~12.1.2", "@angular/platform-browser-dynamic": "~12.1.2", "@angular/router": "~12.1.2", - "@capacitor/android": "^3.3.0", + "@capacitor/android": "^3.3.1", "@capacitor/app": "^1.0.5", + "@capacitor/camera": "^1.2.0", "@capacitor/core": "^3.3.0", "@capacitor/haptics": "^1.1.2", "@capacitor/keyboard": "^1.1.2", "@capacitor/network": "^1.0.6", + "@capacitor/filesystem": "^1.0.6", + "@capacitor/ios": "3.3.0", "@capacitor/push-notifications": "^1.0.7", - "@capacitor/status-bar": "^1.0.5", "@fortawesome/angular-fontawesome": "^0.9.0", "@fortawesome/fontawesome-free": "^5.15.3", "@fortawesome/fontawesome-svg-core": "^1.2.35", @@ -85,6 +87,7 @@ "angular-tag-cloud-module": "^5.2.2", "bootstrap": "^4.5.0", "build": "0.1.4", + "capacitor-voice-recorder": "^2.0.0", "ci": "^2.1.1", "cordova": "^10.0.0", "cordova-plugin-dbcopy": "git+https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git", @@ -163,8 +166,6 @@ "cordova-plugin-network-information": "^3.0.0", "cordova-plugin-splashscreen": "^5.0.2", "cordova-plugin-statusbar": "^2.4.2", - "cordova-plugin-streaming-media": "^2.3.0", - "cordova-plugin-telerik-imagepicker": "^2.3.6", "cordova-plugin-whitelist": "^1.3.4", "es6-promise-plugin": "^4.2.2", "jasmine-core": "~3.6.0", diff --git a/src/app/pages/chat/messages/messages.page.html b/src/app/pages/chat/messages/messages.page.html index 17fabbb62..d97245b37 100644 --- a/src/app/pages/chat/messages/messages.page.html +++ b/src/app/pages/chat/messages/messages.page.html @@ -48,7 +48,6 @@ --> -
@@ -124,6 +123,19 @@ --> + + +
- -
diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts index cf421056f..7d14e8fcd 100644 --- a/src/app/pages/chat/messages/messages.page.ts +++ b/src/app/pages/chat/messages/messages.page.ts @@ -20,6 +20,9 @@ import { ChatMessageStore } from 'src/app/store/chat/chat-message.service'; import { ChatUserStorage } from 'src/app/store/chat/chat-user.service'; import { environment } from 'src/environments/environment'; import { ThemeService } from 'src/app/services/theme.service' +import { Filesystem, Directory, Encoding } from '@capacitor/filesystem'; +import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, CurrentRecordingStatus } from 'capacitor-voice-recorder'; +import { Haptics, ImpactStyle } from '@capacitor/haptics'; @Component({ selector: 'app-messages', @@ -44,8 +47,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { members:any; scrollingOnce:boolean = true; - chatMessageStore = ChatMessageStore - chatUserStorage = ChatUserStorage + chatMessageStore = ChatMessageStore; + chatUserStorage = ChatUserStorage; private scrollChangeCallback: () => void; currentPosition: any; @@ -60,6 +63,13 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { task: ExpedientTaskModalPageNavParamsTask; LoadedDocument:any = null; + recording = false; + storedFileNames = []; + durationDisplay = ''; + duration = 0; + @ViewChild('recordbtn', { read: ElementRef }) recordBtn: ElementRef; + myAudio: any; + constructor( public popoverController: PopoverController, private modalController: ModalController, @@ -75,11 +85,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { private processes: ProcessesService, public ThemeService: ThemeService ) { - /* this.activatedRoute.paramMap.subscribe(params => { - if(params["params"].SerialNumber) { - this.roomId = params["params"].roomId; - } - }); */ this.loggedUser = authService.ValidatedUserChat['data']; this.roomId = this.navParams.get('roomId'); @@ -91,57 +96,110 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { } ngOnInit() { - - /* setInterval(()=>{ */ - this.load(); - /* }, 9000); */ - /* this.el = document.getElementById("scrollToBottom"); - this.el.scrollTop = this.el.scrollHeight - this.el.scrollTop; */ - + this.load(); this.setStatus('online'); - //this.onPressingMessage(); - - /* setInterval(()=>{ - const gesture = this.gestureController.create({ - el: this.rectangle.nativeElement, - gestureName:'my-gesture', - onMove: (detail) => { this.onMove(detail); } - }) - - gesture.enable(); - }, 9000); */ - + this.loadFiles(); + VoiceRecorder.requestAudioRecordingPermission(); } ngAfterViewInit() { this.scrollChangeCallback = () => this.onContentScrolled(event); window.addEventListener('scroll', this.scrollChangeCallback, true); - // const gesture = this.gestureController.create({ - // el: this.rectangle.nativeElement, - // gestureName:'long-press', - // onStart: () => { alert('OP') }, - // /* onMove () => { - // console.log('Move'); - // }, */ - // onEnd: () => { - // console.log('ENNNNNDS'); - // }, - // }) + const longpress = this.gestureController.create({ + el: this.recordBtn.nativeElement, + threshold: 0, + gestureName: 'long-press', + onStart: ev => { + Haptics.impact({ style: ImpactStyle.Light }) + this.startRecording(); + this.calculateDuration(); + }, + onEnd: ev =>{ + Haptics.impact({ style: ImpactStyle.Light }) + this.stopRecording(); + } + }, true); + longpress.enable(); + } + + calculateDuration(){ + if(!this.recording){ + this.duration = 0; + this.durationDisplay = ''; + return; + } + this.duration += 1; + const minutes = Math.floor(this.duration / 60); + const seconds = (this.duration % 60).toString().padStart(2,'0'); + this.durationDisplay = `${minutes}:${seconds}`; + + setTimeout(()=>{ + this.calculateDuration(); + }, 1000) + } + + async loadFiles(){ + Filesystem.readdir({ + path: '', + directory: Directory.Data + }).then(result =>{ + console.log(result); + const temp:any[] = result.files.reverse(); + this.storedFileNames = temp[0]; + console.log(this.storedFileNames); + + }) + } + + startRecording(){ + if(this.recording){ + return; + } + this.recording = true; + VoiceRecorder.startRecording(); + } + + stopRecording(){ + if(!this.recording){ + return; + } + this.recording = false; + VoiceRecorder.stopRecording().then(async (result: RecordingData) =>{ + this.recording = false; + if(result.value && result.value.recordDataBase64){ + const recordData = result.value.recordDataBase64; + console.log(recordData); + this.myAudio = recordData; + const fileName = new Date().getTime() + ".wav"; + await Filesystem.writeFile({ + path: fileName, + directory: Directory.Data, + data: recordData, + }) + } + }) + + } + + async playFile(fileName?:any){ + const audioFile = await Filesystem.readFile({ + path: fileName, + directory: Directory.Data + }) + console.log(audioFile); + const base64sound = audioFile.data; + + const audioRef = new Audio(`data:audio/aac;base64,${base64sound}`) + audioRef.oncanplaythrough = () => audioRef.play(); + audioRef.load(); - // gesture.enable(); } handlePress(id?:string){ this.selectedMsgId = id; this.showMessageOptions = true; - /* if(!this.showMessageOptions){ - this.showMessageOptions = true; - } - else{ - this.showMessageOptions = false; - } */ } handleClick(){ @@ -149,22 +207,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { this.selectedMsgId = ""; } - /* onPressingMessage(){ - const gesture = this.gestureController.create({ - el: this.messageContainer.nativeElement, - gestureName: 'long-press', - onStart: ev =>{ - this.longPressActive = true; - console.log('Pressing'); - }, - onEnd: ev => { - this.longPressActive = false; - console.log('Stop pressing'); - } - }); - gesture.enable(true); - } */ - deleteMessage(msgId:string){ let body = { "roomId": this.roomId, @@ -273,7 +315,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { const roomId = this.roomId; this.chatService.getRoomMessages(this.roomId).subscribe(res => { - /* console.log(res); */ + console.log(res); this.messages = res['messages'].reverse(); this.chatMessageStore.add(roomId, this.messages) console.log(this.messages); @@ -519,7 +561,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { this.messages = res['messages'].reverse(); this.chatMessageStore.add(roomId, this.messages) - console.log(this.messages); + //console.log(this.messages); // Reconnect in one second if(this.route.url != "/home/chat"){ console.log("Timer message stop") @@ -528,7 +570,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { if(document.querySelector('.isMessagesChatOpened')){ await new Promise(resolve => setTimeout(resolve, 5000)); await this.serverLongPull(); - console.log('Timer message running') + //console.log('Timer message running') } } diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts index bae0452a5..709122a83 100644 --- a/src/app/pages/events/events.page.ts +++ b/src/app/pages/events/events.page.ts @@ -109,13 +109,13 @@ export class EventsPage implements OnInit { // console.log('Resize event detected'); }); - + window['zipPhoneCallback'] = function (zipphone) { var frame = document.getElementById('home-iframe'); if(frame) { frame['contentWindow']['postMessage']({call:'cookies', value: { cookies: {} }}); } - } + } } @@ -493,12 +493,13 @@ export class EventsPage implements OnInit { } goToExpediente(SerialNumber: any) { - if (this.loggeduser.Profile == 'MDGPR') { + this.router.navigate(['/home/events/expediente', SerialNumber, 'events']); + /* if (this.loggeduser.Profile == 'MDGPR') { this.router.navigate(['/home/events/expediente', SerialNumber, 'events']); } else if (this.loggeduser.Profile == 'PR') { this.router.navigate(['/home/events/expedientes-pr', SerialNumber, 'events']); - } + } */ } viewExpedientListPage() { diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html index a26270b9b..5e500863d 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html @@ -104,7 +104,7 @@ - +
@@ -118,8 +118,10 @@ + +
diff --git a/src/app/pages/gabinete-digital/expediente/expediente.page.html b/src/app/pages/gabinete-digital/expediente/expediente.page.html index fe345d4d2..c383d3af7 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente.page.html +++ b/src/app/pages/gabinete-digital/expediente/expediente.page.html @@ -34,8 +34,8 @@
@@ -67,13 +67,13 @@
Lista vazia
-
+
diff --git a/src/app/pages/gabinete-digital/expediente/expediente.page.ts b/src/app/pages/gabinete-digital/expediente/expediente.page.ts index a2690a597..3f165a4a1 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expediente.page.ts @@ -25,7 +25,8 @@ export class ExpedientePage implements OnInit { taskslist = []; serialNumber: string; - expedienteGdStore = ExpedienteGdStore + //expedienteGdStore = ExpedienteGdStore; + expedientegbstore = ExpedienteGdStore expedienteTaskPipe = new ExpedienteTaskPipe() onlinecheck: boolean; @@ -60,10 +61,9 @@ export class ExpedientePage implements OnInit { this.backgroundservice.registerBackService('Online', () => { this.LoadList(); }); - } - async LoadList() { + LoadList() { this.processes.GetTaskListExpediente(false).subscribe(async res => { this.skeletonLoader = true @@ -85,7 +85,6 @@ export class ExpedientePage implements OnInit { }, (error) => { this.getEventsFromLocalDb(); }) - } async refreshing() { diff --git a/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts b/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts index f4da1f622..590200750 100644 --- a/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts +++ b/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts @@ -68,7 +68,7 @@ export class ExpedientesPrPage implements OnInit { LoadList() { this.skeletonLoader = true - + this.processes.GetTaskListExpediente(false).subscribe(result => { console.log(result); this.skeletonLoader = false @@ -99,7 +99,8 @@ export class ExpedientesPrPage implements OnInit { } goToExpediente(serialNumber:any){ - this.router.navigate(['/home/gabinete-digital/expedientes-pr',serialNumber,'gabinete-digital']); + //this.router.navigate(['/home/gabinete-digital/expedientes-pr',serialNumber,'gabinete-digital']); + this.router.navigate(['/home/gabinete-digital/expediente', serialNumber, 'gabinete-digital']); } async viewExpedientDetail(serialNumber:any) { diff --git a/src/app/pages/publications/new-publication/new-publication.page.html b/src/app/pages/publications/new-publication/new-publication.page.html index c010cc1ad..8295b9520 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.html +++ b/src/app/pages/publications/new-publication/new-publication.page.html @@ -34,7 +34,9 @@

{{capturedImageTitle}}

- +
+ +
@@ -51,7 +53,6 @@
X
-
diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts index a314b4e99..a82247f04 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -9,15 +9,14 @@ import { Image } from 'src/app/models/image'; import { PhotoService } from 'src/app/services/photo.service'; //Capacitor -//Cordova -import { Camera, CameraOptions } from '@ionic-native/camera/ngx'; import { ToastService } from 'src/app/services/toast.service'; import { FormControl, FormGroup, Validators } from '@angular/forms'; import { ThemePalette } from '@angular/material/core'; import { formatDate } from 'src/plugin/momentG.js' import { FileLoaderService } from 'src/app/services/file/file-loader.service'; import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service'; -import { ThemeService } from 'src/app/services/theme.service' +import { ThemeService } from 'src/app/services/theme.service'; +import { Camera, CameraResultType, CameraSource, Photo} from '@capacitor/camera'; @Component({ selector: 'app-new-publication', @@ -59,21 +58,21 @@ export class NewPublicationPage implements OnInit { guestPicture:any; - capturedImage:any; + capturedImage:any = ''; capturedImageTitle:any; + public photos: any[] = []; constructor( private modalController: ModalController, public photoService: PhotoService, private navParams: NavParams, private publications: PublicationsService, - private camera: Camera, private toastService: ToastService, private fileLoaderService: FileLoaderService, private fileToBase64Service: FileToBase64Service, public ThemeService: ThemeService ) { - + this.publicationType = this.navParams.get('publicationType'); this.folderId = this.navParams.get('folderId'); this.publicationTitle = 'Nova Publicação'; @@ -81,38 +80,70 @@ export class NewPublicationPage implements OnInit { ngOnInit() { this.setTitle(); - this.clear(); + console.log(this.folderId); + // this.takePicture(); } - takePicture() { - const options: CameraOptions = { - quality: 50, - destinationType: this.camera.DestinationType.DATA_URL, - encodingType: this.camera.EncodingType.JPEG, - mediaType: this.camera.MediaType.PICTURE, - targetWidth: 720, - targetHeight: 720, - } +async takePicture() { + const capturedImage = await Camera.getPhoto({ + quality: 90, + // allowEditing: true, + resultType: CameraResultType.Uri, + source: CameraSource.Camera - this.camera.getPicture(options).then((imageData) => { - // imageData is either a base64 encoded string or a file URI - // If it's base64 (DATA_URL): m - //let base64Image = 'data:image/jpeg;base64,' + imageData; - - this.capturedImage = 'data:image/png;base64,'+imageData; - this.capturedImageTitle = new Date().getTime() + '.jpeg'; - }, (err) => { - /* console.log(err); */ + }); + const response = await fetch(capturedImage.webPath!); + const blob = await response.blob(); + + this.photos.unshift({ + filepath: "soon...", + webviewPath: capturedImage.webPath }); + + this.capturedImage = await this.convertBlobToBase64(blob); + this.capturedImageTitle = new Date().getTime() + '.jpeg'; + + //console.log(this.capturedImage); + } + convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => { + const reader = new FileReader; + reader.onerror = reject; + reader.onload = () => { + resolve(reader.result); + }; + reader.readAsDataURL(blob); + }); - laodPicture() { + + async laodPicture() { + const capturedImage = await Camera.getPhoto({ + resultType: CameraResultType.Uri, + source: CameraSource.Photos, + quality: 90, + width: 1080, + height: 720, + }); + + const response = await fetch(capturedImage.webPath!); + const blob = await response.blob(); + + this.photos.unshift({ + filepath: "soon...", + webviewPath: capturedImage.webPath + }); + + this.capturedImage = await this.convertBlobToBase64(blob); + this.capturedImageTitle = new Date().getTime() + '.jpeg'; + } + + /* laodPicture() { const input = this.fileLoaderService.createInput({ accept: ['image/apng', 'image/jpeg', 'image/png'] }) - + input.onchange = async () => { const file = this.fileLoaderService.getFirstFile(input) @@ -123,29 +154,9 @@ export class NewPublicationPage implements OnInit { console.log(this.capturedImage) }; - } + } */ - getPicture() { - const options: CameraOptions = { - quality: 90, - sourceType: this.camera.PictureSourceType.PHOTOLIBRARY, - destinationType: this.camera.DestinationType.DATA_URL, - encodingType: this.camera.EncodingType.JPEG, - mediaType: this.camera.MediaType.PICTURE, - targetWidth: 720, - targetHeight: 720, - } - this.camera.getPicture(options).then((imageData) => { - // imageData is either a base64 encoded string or a file URI - // If it's base64 (DATA_URL): - let base64Image = 'data:image/jpeg;base64,' + imageData; - this.capturedImage = imageData; - this.capturedImageTitle = new Date().getTime() + '.jpeg'; - }, (err) => { - /* console.log(err); */ - }); - } runValidation() { this.validateFrom = true @@ -168,20 +179,20 @@ export class NewPublicationPage implements OnInit { ]) }) } - + async save() { - + this.injectValidation() this.runValidation() if(this.Form.invalid) return false - + if(this.publicationType == '3') { console.log(this.navParams.get('publication')); - - if(this.capturedImage != '') { + + if(this.capturedImage != ''){ this.publication = { DateIndex: this.publication.DateIndex, DocumentId:this.publication.DocumentId, @@ -198,13 +209,13 @@ export class NewPublicationPage implements OnInit { try { console.log(this.publication); - + await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() - this.toastService.successMessage("Publicação criado") + this.toastService.successMessage("Publicação editada") this.close(); } catch (error) { - this.toastService.badRequest("Publicação não criado") + this.toastService.badRequest("Publicação não editada") } finally { loader.remove() } @@ -232,7 +243,7 @@ export class NewPublicationPage implements OnInit { console.log(this.publication); await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() this.toastService.successMessage("Publicação criado") - + this.close(); } catch (error) { this.toastService.badRequest("Publicação não criado") @@ -273,7 +284,9 @@ export class NewPublicationPage implements OnInit { else { const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss') - console.log(date) + console.log(date); + console.log(this.folderId); + this.publication = { DateIndex: date, @@ -294,7 +307,7 @@ export class NewPublicationPage implements OnInit { await this.publications.CreatePublication(this.folderId, this.publication).toPromise(); this.close(); this.toastService.successMessage("Publicação criado") - + this.close(); } catch (error) { @@ -312,7 +325,7 @@ export class NewPublicationPage implements OnInit { this.showLoader=true; }); } - + clear() { this.capturedImage = ''; } @@ -352,8 +365,8 @@ export class NewPublicationPage implements OnInit { source: CameraSource.Camera }); console.log(image); - + this.photo = this.sanitizer.bypassSecurityTrustResourceUrl(image && (image.dataUrl)); } */ -} \ No newline at end of file +} diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index 9b53a6c34..ad0095192 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -196,7 +196,7 @@ export class ViewPublicationsPage implements OnInit { component: NewPublicationPage, componentProps: { publicationType: publicationType, - folderId: folderId, + folderId: this.folderId, }, cssClass: 'new-publication modal modal-desktop', backdropDismiss: false diff --git a/src/app/services/events/events.page.ts b/src/app/services/events/events.page.ts index 0ceb9b85d..079667c84 100644 --- a/src/app/services/events/events.page.ts +++ b/src/app/services/events/events.page.ts @@ -64,7 +64,7 @@ export class EventsPage implements OnInit { // shared data toDayEventStorage = ToDayEventStorage expedienteGdStore = ExpedienteGdStore - + expedienteTaskPipe = new ExpedienteTaskPipe() @Output() openExpedientListPage:EventEmitter = new EventEmitter(); @@ -352,12 +352,13 @@ export class EventsPage implements OnInit { } goToExpediente(SerialNumber:any) { - if(this.loggeduser.Profile == 'MDGPR'){ + this.router.navigate(['/home/events/expediente', SerialNumber, 'events']); + /* if(this.loggeduser.Profile == 'MDGPR'){ this.router.navigate(['/home/events/expediente', SerialNumber, 'events']); } else if(this.loggeduser.Profile == 'PR'){ this.router.navigate(['/home/events/expedientes-pr', SerialNumber, 'events']); - } + } */ } viewExpedientListPage(){ diff --git a/src/app/services/functions/file.service.ts b/src/app/services/functions/file.service.ts index 55483dc5c..040f13324 100644 --- a/src/app/services/functions/file.service.ts +++ b/src/app/services/functions/file.service.ts @@ -2,14 +2,14 @@ import { Injectable } from '@angular/core'; import { FileLoaderService } from '../file/file-loader.service'; import { FileToBase64Service } from '../file/file-to-base64.service'; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; -//Cordova -import { Camera, CameraOptions } from '@ionic-native/camera/ngx'; + import { ChatService } from '../chat.service'; import { ModalController } from '@ionic/angular'; import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchList } from 'src/app/models/search-document'; import { ProcessesService } from '../processes.service'; import { ToastService } from '../toast.service'; +import { Camera, CameraResultType, CameraSource, Photo} from '@capacitor/camera'; @Injectable({ providedIn: 'root' @@ -22,9 +22,9 @@ export class FileService { showLoader: boolean; files: Set; + photos: any[] = []; constructor( - private camera: Camera, private fileLoaderService: FileLoaderService, private fileToBase64Service: FileToBase64Service, private iab: InAppBrowser, @@ -34,26 +34,25 @@ export class FileService { private toastService: ToastService, ) { } - takePicture() { - const options: CameraOptions = { - quality: 50, - destinationType: this.camera.DestinationType.DATA_URL, - encodingType: this.camera.EncodingType.JPEG, - mediaType: this.camera.MediaType.PICTURE, - targetWidth: 720, - targetHeight: 720, - } + async takePicture() { + const capturedImage = await Camera.getPhoto({ + quality: 90, + // allowEditing: true, + resultType: CameraResultType.Uri, + source: CameraSource.Camera - this.camera.getPicture(options).then((imageData) => { - // imageData is either a base64 encoded string or a file URI - // If it's base64 (DATA_URL): m - //let base64Image = 'data:image/jpeg;base64,' + imageData; - - this.capturedImage = 'data:image/png;base64,'+imageData; - this.capturedImageTitle = new Date().getTime() + '.jpeg'; - }, (err) => { - /* console.log(err); */ }); + const response = await fetch(capturedImage.webPath!); + const blob = await response.blob(); + + this.photos.unshift({ + filepath: "soon...", + webviewPath: capturedImage.webPath + }); + + this.capturedImage = await this.convertBlobToBase64(blob); + this.capturedImageTitle = new Date().getTime() + '.jpeg'; + let data = { image:this.capturedImage, name: this.capturedImageTitle @@ -62,6 +61,15 @@ export class FileService { return data; } + convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => { + const reader = new FileReader; + reader.onerror = reject; + reader.onload = () => { + resolve(reader.result); + }; + reader.readAsDataURL(blob); + }); + loadPicture() { const input = this.fileLoaderService.createInput({ accept: ['image/apng', 'image/jpeg', 'image/png'] @@ -85,19 +93,24 @@ export class FileService { }; } - addCameraPictureToChat(roomId){ + async addCameraPictureToChat(roomId){ - const options: CameraOptions = { - quality: 50, - destinationType: this.camera.DestinationType.DATA_URL, - encodingType: this.camera.EncodingType.JPEG, - mediaType: this.camera.MediaType.PICTURE, - targetWidth: 720, - targetHeight: 720, - } + const capturedImage = await Camera.getPhoto({ + quality: 90, + // allowEditing: true, + resultType: CameraResultType.Uri, + source: CameraSource.Camera - this.camera.getPicture(options).then((imageData) => { - this.capturedImage = 'data:image/png;base64,'+imageData; + }); + const response = await fetch(capturedImage.webPath!); + const blob = await response.blob(); + + this.photos.unshift({ + filepath: "soon...", + webviewPath: capturedImage.webPath + }); + + this.capturedImage = await this.convertBlobToBase64(blob); this.capturedImageTitle = new Date().getTime() + '.jpeg'; let body = { @@ -121,29 +134,26 @@ export class FileService { this.toastService.badRequest("Não foi possível adicionar a fotografia!"); }); - }, (err) => { - this.toastService.badRequest("Não foi possível adicionar a fotografia!"); - }); - } - addPictureToChatMobile(roomId) { - alert('Here') + async addPictureToChatMobile(roomId) { - const options: CameraOptions = { + const capturedImage = await Camera.getPhoto({ quality: 90, - sourceType: this.camera.PictureSourceType.PHOTOLIBRARY, - destinationType: this.camera.DestinationType.DATA_URL, - encodingType: this.camera.EncodingType.JPEG, - mediaType: this.camera.MediaType.PICTURE, - targetWidth: 720, - targetHeight: 720, - correctOrientation: true - } + // allowEditing: true, + resultType: CameraResultType.Uri, + source: CameraSource.Photos - this.camera.getPicture(options).then((imageData) => { - let base64Image = 'data:image/jpeg;base64,' + imageData; - this.capturedImage = imageData; + }); + const response = await fetch(capturedImage.webPath!); + const blob = await response.blob(); + + this.photos.unshift({ + filepath: "soon...", + webviewPath: capturedImage.webPath + }); + + this.capturedImage = await this.convertBlobToBase64(blob); this.capturedImageTitle = new Date().getTime() + '.jpeg'; //const loader = this.toastService.loading(); @@ -161,21 +171,12 @@ export class FileService { }] } } - - console.log(this.capturedImage) - this.chatService.sendMessage(body).subscribe(res=> { //loader.remove(); //console.log(res); },(error) => { //loader.remove(); }); - - - }, (err) => { - //console.log(err); - }); - } addPictureToChat(roomId) { diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html index 9f77e4286..53f592363 100644 --- a/src/app/shared/chat/messages/messages.page.html +++ b/src/app/shared/chat/messages/messages.page.html @@ -117,13 +117,13 @@ - + - + diff --git a/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts b/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts index d03699f52..d89169481 100644 --- a/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts +++ b/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts @@ -97,7 +97,8 @@ export class ExpedientesPrPage implements OnInit { } goToExpediente(serialNumber:any){ - this.router.navigate(['/home/gabinete-digital/expedientes-pr',serialNumber,'gabinete-digital']); + /* this.router.navigate(['/home/gabinete-digital/expedientes-pr',serialNumber,'gabinete-digital']); */ + this.router.navigate(['/home/gabinete-digital/expediente', serialNumber, 'gabinete-digital']); } } diff --git a/src/app/shared/gabinete-digital/expedients/expedients.page.ts b/src/app/shared/gabinete-digital/expedients/expedients.page.ts index 5a45c172b..2f0237c92 100644 --- a/src/app/shared/gabinete-digital/expedients/expedients.page.ts +++ b/src/app/shared/gabinete-digital/expedients/expedients.page.ts @@ -37,7 +37,7 @@ export class ExpedientsPage implements OnInit { //Inicializar segment this.segment = "expedientes"; this.LoadList() - + this.router.events.forEach((event) => { if (event instanceof NavigationStart && event.url.startsWith('/home/gabinete-digital?expedientes=true')) { diff --git a/src/app/shared/popover/chat-options-popover/chat-options-popover.page.html b/src/app/shared/popover/chat-options-popover/chat-options-popover.page.html index a0042f5a1..e76aaf577 100644 --- a/src/app/shared/popover/chat-options-popover/chat-options-popover.page.html +++ b/src/app/shared/popover/chat-options-popover/chat-options-popover.page.html @@ -6,9 +6,9 @@
- + - +
diff --git a/src/app/shared/popover/opts-expediente/opts-expediente.page.html b/src/app/shared/popover/opts-expediente/opts-expediente.page.html index dc04af69d..c830407f6 100644 --- a/src/app/shared/popover/opts-expediente/opts-expediente.page.html +++ b/src/app/shared/popover/opts-expediente/opts-expediente.page.html @@ -14,6 +14,7 @@ +
@@ -22,18 +23,21 @@ +
- + +
- + +
diff --git a/src/app/shared/popover/opts-expediente/opts-expediente.page.ts b/src/app/shared/popover/opts-expediente/opts-expediente.page.ts index 17d9f16b8..b8d1bb688 100644 --- a/src/app/shared/popover/opts-expediente/opts-expediente.page.ts +++ b/src/app/shared/popover/opts-expediente/opts-expediente.page.ts @@ -66,6 +66,10 @@ export class OptsExpedientePage implements OnInit { }; } + openNewGroupPage(){ + + } + close() { if( window.innerWidth < 801) { this.popoverController.dismiss(); diff --git a/src/app/shared/publication/new-publication/new-publication.page.html b/src/app/shared/publication/new-publication/new-publication.page.html index f3d9dcd50..8b2e040d5 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.html +++ b/src/app/shared/publication/new-publication/new-publication.page.html @@ -27,8 +27,6 @@
-
Fotografia Anexada
-
image @@ -40,18 +38,6 @@
X
- -
- -
- -
- -
-
- Anexar Fotografia -
-
@@ -65,7 +51,9 @@

{{capturedImageTitle}}

- +
@@ -82,7 +70,7 @@
- +
@@ -95,7 +83,6 @@ - diff --git a/src/app/shared/publication/new-publication/new-publication.page.ts b/src/app/shared/publication/new-publication/new-publication.page.ts index a6beb44ca..50c3a3d32 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.ts +++ b/src/app/shared/publication/new-publication/new-publication.page.ts @@ -4,11 +4,11 @@ import { PublicationsService } from 'src/app/services/publications.service'; import { Publication } from 'src/app/models/publication'; import { Image } from 'src/app/models/image'; import { PhotoService } from 'src/app/services/photo.service'; -import { Camera, CameraOptions } from '@ionic-native/camera/ngx'; import { ToastService } from 'src/app/services/toast.service'; import { FormControl, FormGroup, Validators } from '@angular/forms'; import { FileLoaderService } from 'src/app/services/file/file-loader.service' import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service'; +import { Camera, CameraResultType, CameraSource, Photo} from '@capacitor/camera'; @Component({ selector: 'app-new-publication', templateUrl: './new-publication.page.html', @@ -38,16 +38,16 @@ export class NewPublicationPage implements OnInit { @Output() openPublicationDetails = new EventEmitter(); @Output() goBackToViewPublications = new EventEmitter(); @Output() goBacktoPublicationDetails = new EventEmitter(); - + guestPicture:any; - capturedImage:any; + capturedImage:any = ''; capturedImageTitle:any; + photos: any[] = []; constructor( public photoService: PhotoService, private publications: PublicationsService, - private camera: Camera, private toastService: ToastService, private fileLoaderService: FileLoaderService, private fileToBase64Service: FileToBase64Service @@ -60,11 +60,11 @@ export class NewPublicationPage implements OnInit { this.getPublicationDetail(); } this.setTitle(); - this.clear(); - this.takePicture(); + //this.clear(); + //this.takePicture(); } - getPublicationDetail() { + getPublicationDetail() { this.showLoader = true; //console.log(this.publicationId); /* console.log(this.folderId); */ @@ -88,30 +88,60 @@ export class NewPublicationPage implements OnInit { } - takePicture() { - const options: CameraOptions = { + async takePicture() { + const capturedImage = await Camera.getPhoto({ quality: 90, - destinationType: this.camera.DestinationType.DATA_URL, - encodingType: this.camera.EncodingType.JPEG, - mediaType: this.camera.MediaType.PICTURE, - targetWidth: 720, - targetHeight: 720, + // allowEditing: true, + resultType: CameraResultType.Uri, + source: CameraSource.Camera + }); + const response = await fetch(capturedImage.webPath!); + const blob = await response.blob(); + + this.photos.unshift({ + filepath: "soon...", + webviewPath: capturedImage.webPath + }); + this.capturedImage = await this.convertBlobToBase64(blob); + this.capturedImageTitle = new Date().getTime() + '.jpeg'; + //console.log(this.capturedImage); } - this.camera.getPicture(options).then((imageData) => { - - this.capturedImage = imageData; - this.capturedImageTitle = new Date().getTime() + '.jpeg'; - }, (err) => { - console.log(err); + convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => { + const reader = new FileReader; + reader.onerror = reject; + reader.onload = () => { + resolve(reader.result); + }; + reader.readAsDataURL(blob); }); - } - laodPicture() { + async laodPicture() { + const capturedImage = await Camera.getPhoto({ + resultType: CameraResultType.Uri, + source: CameraSource.Photos, + quality: 90, + width: 1080, + height: 720, + }); + + const response = await fetch(capturedImage.webPath!); + const blob = await response.blob(); + + this.photos.unshift({ + filepath: "soon...", + webviewPath: capturedImage.webPath + }); + + this.capturedImage = await this.convertBlobToBase64(blob); + this.capturedImageTitle = new Date().getTime() + '.jpeg'; + } + + /* laodPicture() { const input = this.fileLoaderService.createInput({ accept: ['image/apng', 'image/jpeg', 'image/png'] }) - + input.onchange = async () => { const file = this.fileLoaderService.getFirstFile(input) @@ -119,8 +149,7 @@ export class NewPublicationPage implements OnInit { this.capturedImage = imageData; this.capturedImageTitle = file.name }; - - } + } */ runValidation() { @@ -200,14 +229,14 @@ export class NewPublicationPage implements OnInit { console.log(this.publication); await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() this.toastService.successMessage() - + this.goBack(); } catch (error) { this.toastService.badRequest() } finally { loader.remove() } - + } else { this.publication = { DateIndex: this.publication.DateIndex, @@ -252,7 +281,7 @@ export class NewPublicationPage implements OnInit { FileBase64: this.capturedImage, FileExtension: 'jpeg', } - + const loader = this.toastService.loading() try { @@ -270,28 +299,6 @@ export class NewPublicationPage implements OnInit { } } - getPicture() { - const options: CameraOptions = { - quality: 90, - sourceType: this.camera.PictureSourceType.PHOTOLIBRARY, - destinationType: this.camera.DestinationType.DATA_URL, - encodingType: this.camera.EncodingType.JPEG, - mediaType: this.camera.MediaType.PICTURE, - targetWidth: 720, - targetHeight: 720, - } - - this.camera.getPicture(options).then((imageData) => { - // imageData is either a base64 encoded string or a file URI - // If it's base64 (DATA_URL): - let base64Image = 'data:image/jpeg;base64,' + imageData; - this.capturedImage = imageData; - this.capturedImageTitle = new Date().getTime() + '.jpeg'; - }, (err) => { - /* console.log(err); */ - }); - } - close(){ this.goBack(); } @@ -312,14 +319,14 @@ export class NewPublicationPage implements OnInit { } async goBack(){ - + if(this.publicationType == '2'){ this.goBackToViewPublications.emit(); } else { this.goBackToViewPublications.emit(); //this.goBacktoPublicationDetails.emit(); } - + } }