fix ios notifications
@@ -6,7 +6,7 @@ import { CapacitorConfig } from '@capacitor/cli';
|
||||
|
||||
const config: CapacitorConfig = {
|
||||
appId: 'com.capacitorjs.app.testapp',
|
||||
appName: 'capacitor-testapp',
|
||||
appName: 'Gabinete Digital',
|
||||
webDir: 'www',
|
||||
plugins: {
|
||||
SplashScreen: {
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<?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>CLIENT_ID</key>
|
||||
<string>800733765231-5da370m1mntjk7cg8cc2d331sp8cj91d.apps.googleusercontent.com</string>
|
||||
<key>REVERSED_CLIENT_ID</key>
|
||||
<string>com.googleusercontent.apps.800733765231-5da370m1mntjk7cg8cc2d331sp8cj91d</string>
|
||||
<key>API_KEY</key>
|
||||
<string>AIzaSyCDW6bjQSiSAVCYhai7nFV1wWnLMV_kBeM</string>
|
||||
<key>GCM_SENDER_ID</key>
|
||||
<string>800733765231</string>
|
||||
<key>PLIST_VERSION</key>
|
||||
<string>1</string>
|
||||
<key>BUNDLE_ID</key>
|
||||
<string>com.gpr.gabinetedigital.teste</string>
|
||||
<key>PROJECT_ID</key>
|
||||
<string>gabinete-digital-2020</string>
|
||||
<key>STORAGE_BUCKET</key>
|
||||
<string>gabinete-digital-2020.appspot.com</string>
|
||||
<key>IS_ADS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_ANALYTICS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_APPINVITE_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_GCM_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_SIGNIN_ENABLED</key>
|
||||
<true></true>
|
||||
<key>GOOGLE_APP_ID</key>
|
||||
<string>1:800733765231:ios:af4d35631d70473213779a</string>
|
||||
<key>DATABASE_URL</key>
|
||||
<string>https://gabinete-digital-2020.firebaseio.com</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -15,6 +15,7 @@
|
||||
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 */; };
|
||||
DAD1AB3F2ACF3A7F001D9958 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = DAD1AB3D2ACF39DE001D9958 /* GoogleService-Info.plist */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@@ -34,6 +35,8 @@
|
||||
DA6FE4D62ACEF2DA006F1E0D /* FirebaseCoreInternal.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = FirebaseCoreInternal.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
DA6FE4D72ACEF2DA006F1E0D /* FirebaseInstallations.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = FirebaseInstallations.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
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>"; };
|
||||
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 */
|
||||
|
||||
@@ -83,8 +86,10 @@
|
||||
504EC3061FED79650016851F /* App */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DA8422AF2AD03FBE00AC9118 /* App.entitlements */,
|
||||
50379B222058CBB4000EE86E /* capacitor.config.json */,
|
||||
504EC3071FED79650016851F /* AppDelegate.swift */,
|
||||
DAD1AB3D2ACF39DE001D9958 /* GoogleService-Info.plist */,
|
||||
504EC30B1FED79650016851F /* Main.storyboard */,
|
||||
504EC30E1FED79650016851F /* Assets.xcassets */,
|
||||
504EC3101FED79650016851F /* LaunchScreen.storyboard */,
|
||||
@@ -134,7 +139,7 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0920;
|
||||
LastUpgradeCheck = 0920;
|
||||
LastUpgradeCheck = 1420;
|
||||
TargetAttributes = {
|
||||
504EC3031FED79650016851F = {
|
||||
CreatedOnToolsVersion = 9.2;
|
||||
@@ -175,6 +180,7 @@
|
||||
50379B232058CBB4000EE86E /* capacitor.config.json in Resources */,
|
||||
504EC30D1FED79650016851F /* Main.storyboard in Resources */,
|
||||
2FAD9763203C412B000D30F8 /* config.xml in Resources */,
|
||||
DAD1AB3F2ACF3A7F001D9958 /* GoogleService-Info.plist in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -276,6 +282,7 @@
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
@@ -283,8 +290,10 @@
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
@@ -333,6 +342,7 @@
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
@@ -340,8 +350,10 @@
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
@@ -375,9 +387,10 @@
|
||||
baseConfigurationReference = FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
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 = 15;
|
||||
CURRENT_PROJECT_VERSION = 36;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS;
|
||||
INFOPLIST_FILE = App/Info.plist;
|
||||
@@ -403,9 +416,10 @@
|
||||
baseConfigurationReference = AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */;
|
||||
buildSettings = {
|
||||
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 = 15;
|
||||
CURRENT_PROJECT_VERSION = 36;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS;
|
||||
INFOPLIST_FILE = App/Info.plist;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?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>aps-environment</key>
|
||||
<string>development</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -12,23 +12,25 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
// Override point for customization after application launch.
|
||||
|
||||
// Specify the custom file path
|
||||
let customGoogleServiceInfoPlistPath = Bundle.main.path(forResource: "GoogleService-Info", ofType: "plist")
|
||||
// let customGoogleServiceInfoPlistPath = Bundle.main.path(forResource: "11", ofType: "plist")
|
||||
|
||||
// Check if the custom plist file exists
|
||||
if let filePath = customGoogleServiceInfoPlistPath,
|
||||
let fileOptions = FirebaseOptions(contentsOfFile: filePath) {
|
||||
FirebaseApp.configure(options: fileOptions)
|
||||
} else {
|
||||
// if let filePath = customGoogleServiceInfoPlistPath,
|
||||
// let fileOptions = FirebaseOptions(contentsOfFile: filePath) {
|
||||
// FirebaseApp.configure(options: fileOptions)
|
||||
// } else {
|
||||
// Handle the case where the custom plist file is not found
|
||||
print("Custom GoogleService-Info.plist not found or invalid.")
|
||||
// print("Custom GoogleService-Info.plist not found or invalid.")
|
||||
FirebaseApp.configure()
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
|
||||
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.
|
||||
@@ -66,9 +68,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
|
||||
NotificationCenter.default.post(name: .capacitorDidRegisterForRemoteNotifications, object: deviceToken)
|
||||
|
||||
Messaging.messaging().apnsToken = deviceToken
|
||||
}
|
||||
|
||||
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
|
||||
NotificationCenter.default.post(name: .capacitorDidFailToRegisterForRemoteNotifications, object: error)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 148 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 625 B |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 9.3 KiB |
|
After Width: | Height: | Size: 752 B |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 774 B |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 11 KiB |
@@ -1,36 +0,0 @@
|
||||
<?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>CLIENT_ID</key>
|
||||
<string>800733765231-5da370m1mntjk7cg8cc2d331sp8cj91d.apps.googleusercontent.com</string>
|
||||
<key>REVERSED_CLIENT_ID</key>
|
||||
<string>com.googleusercontent.apps.800733765231-5da370m1mntjk7cg8cc2d331sp8cj91d</string>
|
||||
<key>API_KEY</key>
|
||||
<string>AIzaSyCDW6bjQSiSAVCYhai7nFV1wWnLMV_kBeM</string>
|
||||
<key>GCM_SENDER_ID</key>
|
||||
<string>800733765231</string>
|
||||
<key>PLIST_VERSION</key>
|
||||
<string>1</string>
|
||||
<key>BUNDLE_ID</key>
|
||||
<string>com.gpr.gabinetedigital.teste</string>
|
||||
<key>PROJECT_ID</key>
|
||||
<string>gabinete-digital-2020</string>
|
||||
<key>STORAGE_BUCKET</key>
|
||||
<string>gabinete-digital-2020.appspot.com</string>
|
||||
<key>IS_ADS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_ANALYTICS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_APPINVITE_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_GCM_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_SIGNIN_ENABLED</key>
|
||||
<true></true>
|
||||
<key>GOOGLE_APP_ID</key>
|
||||
<string>1:800733765231:ios:af4d35631d70473213779a</string>
|
||||
<key>DATABASE_URL</key>
|
||||
<string>https://gabinete-digital-2020.firebaseio.com</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,36 +0,0 @@
|
||||
<?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>CLIENT_ID</key>
|
||||
<string>800733765231-5da370m1mntjk7cg8cc2d331sp8cj91d.apps.googleusercontent.com</string>
|
||||
<key>REVERSED_CLIENT_ID</key>
|
||||
<string>com.googleusercontent.apps.800733765231-5da370m1mntjk7cg8cc2d331sp8cj91d</string>
|
||||
<key>API_KEY</key>
|
||||
<string>AIzaSyCDW6bjQSiSAVCYhai7nFV1wWnLMV_kBeM</string>
|
||||
<key>GCM_SENDER_ID</key>
|
||||
<string>800733765231</string>
|
||||
<key>PLIST_VERSION</key>
|
||||
<string>1</string>
|
||||
<key>BUNDLE_ID</key>
|
||||
<string>com.gpr.gabinetedigital.teste</string>
|
||||
<key>PROJECT_ID</key>
|
||||
<string>gabinete-digital-2020</string>
|
||||
<key>STORAGE_BUCKET</key>
|
||||
<string>gabinete-digital-2020.appspot.com</string>
|
||||
<key>IS_ADS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_ANALYTICS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_APPINVITE_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_GCM_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_SIGNIN_ENABLED</key>
|
||||
<true></true>
|
||||
<key>GOOGLE_APP_ID</key>
|
||||
<string>1:800733765231:ios:af4d35631d70473213779a</string>
|
||||
<key>DATABASE_URL</key>
|
||||
<string>https://gabinete-digital-2020.firebaseio.com</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -2,16 +2,18 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>Privacy - Camera Usage Description</string>
|
||||
<key>NSPhotoLibraryAddUsageDescription</key>
|
||||
<string>Privacy - Photo Library Additions Usage Description</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>Privacy - Photo Library Usage Description</string>
|
||||
<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>capacitor-testapp</string>
|
||||
<string>Gabinete Digital</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
@@ -42,6 +44,8 @@
|
||||
<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>
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<?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>CLIENT_ID</key>
|
||||
<string>800733765231-5da370m1mntjk7cg8cc2d331sp8cj91d.apps.googleusercontent.com</string>
|
||||
<key>REVERSED_CLIENT_ID</key>
|
||||
<string>com.googleusercontent.apps.800733765231-5da370m1mntjk7cg8cc2d331sp8cj91d</string>
|
||||
<key>API_KEY</key>
|
||||
<string>AIzaSyCDW6bjQSiSAVCYhai7nFV1wWnLMV_kBeM</string>
|
||||
<key>GCM_SENDER_ID</key>
|
||||
<string>800733765231</string>
|
||||
<key>PLIST_VERSION</key>
|
||||
<string>1</string>
|
||||
<key>BUNDLE_ID</key>
|
||||
<string>com.gpr.gabinetedigital.teste</string>
|
||||
<key>PROJECT_ID</key>
|
||||
<string>gabinete-digital-2020</string>
|
||||
<key>STORAGE_BUCKET</key>
|
||||
<string>gabinete-digital-2020.appspot.com</string>
|
||||
<key>IS_ADS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_ANALYTICS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_APPINVITE_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_GCM_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_SIGNIN_ENABLED</key>
|
||||
<true></true>
|
||||
<key>GOOGLE_APP_ID</key>
|
||||
<string>1:800733765231:ios:af4d35631d70473213779a</string>
|
||||
<key>DATABASE_URL</key>
|
||||
<string>https://gabinete-digital-2020.firebaseio.com</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -11,6 +11,7 @@ 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 'CapacitorCommunityFcm', :path => '../../node_modules/@capacitor-community/fcm'
|
||||
pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
|
||||
pod 'CapacitorBrowser', :path => '../../node_modules/@capacitor/browser'
|
||||
pod 'CapacitorCamera', :path => '../../node_modules/@capacitor/camera'
|
||||
|
||||
@@ -46,19 +46,20 @@
|
||||
"@awesome-cordova-plugins/file": "^5.41.0",
|
||||
"@awesome-cordova-plugins/file-opener": "^5.41.0",
|
||||
"@awesome-cordova-plugins/multiple-document-picker": "^5.40.0",
|
||||
"@capacitor/android": "^4.6.2",
|
||||
"@capacitor-community/fcm": "^5.0.2",
|
||||
"@capacitor/android": "^5.4.2",
|
||||
"@capacitor/app": "^4.1.1",
|
||||
"@capacitor/browser": "^4.1.0",
|
||||
"@capacitor/camera": "^4.1.4",
|
||||
"@capacitor/core": "^3.3.2",
|
||||
"@capacitor/core": "^5.4.2",
|
||||
"@capacitor/device": "^4.1.0",
|
||||
"@capacitor/filesystem": "^4.1.4",
|
||||
"@capacitor/haptics": "^4.1.0",
|
||||
"@capacitor/ios": "^4.6.1",
|
||||
"@capacitor/ios": "^5.4.2",
|
||||
"@capacitor/keyboard": "^4.1.0",
|
||||
"@capacitor/local-notifications": "^4.1.4",
|
||||
"@capacitor/network": "^4.1.0",
|
||||
"@capacitor/push-notifications": "^4.1.2",
|
||||
"@capacitor/push-notifications": "^5.1.0",
|
||||
"@capacitor/share": "^4.1.0",
|
||||
"@capacitor/storage": "^1.2.5",
|
||||
"@fortawesome/angular-fontawesome": "^0.9.0",
|
||||
@@ -182,6 +183,7 @@
|
||||
"ts-jest-puppeteer": "^0.0.5",
|
||||
"tslib": "^2.0.0",
|
||||
"uuidv4": "^6.2.11",
|
||||
"webpack": "^5.88.2",
|
||||
"wordcloud": "^1.1.2",
|
||||
"ws": "^7.4.6",
|
||||
"zod": "^3.22.2",
|
||||
|
||||
@@ -164,8 +164,6 @@ export class HomePage implements OnInit {
|
||||
|
||||
this.logDeviceInfo();
|
||||
|
||||
this.notificationsService.onReciveForeground();
|
||||
this.notificationsService.onReciveBackground();
|
||||
|
||||
window.addEventListener('online', () => {
|
||||
this.backgroundservice.online()
|
||||
@@ -238,20 +236,20 @@ export class HomePage implements OnInit {
|
||||
}, 1000)
|
||||
|
||||
|
||||
/* if (!this.platform.is('desktop')) {
|
||||
App.addListener('appStateChange', ({ isActive }) => {
|
||||
if (isActive) {
|
||||
// The app is in the foreground.
|
||||
console.log('App is in the foreground');
|
||||
this.RochetChatConnectorService.connect()
|
||||
this.reloadComponent(true)
|
||||
} else {
|
||||
// The app is in the background.
|
||||
console.log('App is in the background');
|
||||
// You can perform actions specific to the background state here.
|
||||
}
|
||||
});
|
||||
} */
|
||||
/* if (!this.platform.is('desktop')) {
|
||||
App.addListener('appStateChange', ({ isActive }) => {
|
||||
if (isActive) {
|
||||
// The app is in the foreground.
|
||||
console.log('App is in the foreground');
|
||||
this.RochetChatConnectorService.connect()
|
||||
this.reloadComponent(true)
|
||||
} else {
|
||||
// The app is in the background.
|
||||
console.log('App is in the background');
|
||||
// You can perform actions specific to the background state here.
|
||||
}
|
||||
});
|
||||
} */
|
||||
|
||||
}
|
||||
|
||||
@@ -344,15 +342,15 @@ export class HomePage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
reloadComponent(self:boolean,urlToNavigateTo ?:string){
|
||||
reloadComponent(self: boolean, urlToNavigateTo?: string) {
|
||||
//skipLocationChange:true means dont update the url to / when navigating
|
||||
console.log("Current route I am on:",this.router.url);
|
||||
const url=self ? this.router.url :urlToNavigateTo;
|
||||
this.router.navigateByUrl('/',{skipLocationChange:true}).then(()=>{
|
||||
this.router.navigate([`/${url}`]).then(()=>{
|
||||
console.log(`After navigation I am on:${this.router.url}`)
|
||||
})
|
||||
})
|
||||
}
|
||||
console.log("Current route I am on:", this.router.url);
|
||||
const url = self ? this.router.url : urlToNavigateTo;
|
||||
this.router.navigateByUrl('/', { skipLocationChange: true }).then(() => {
|
||||
this.router.navigate([`/${url}`]).then(() => {
|
||||
console.log(`After navigation I am on:${this.router.url}`)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,11 +33,11 @@ export class InactivityPage implements OnInit {
|
||||
public alertController: AlertController,
|
||||
public ThemeService: ThemeService,
|
||||
public p: PermissionService,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
loop = false
|
||||
|
||||
ngOnInit() {}
|
||||
ngOnInit() { }
|
||||
|
||||
runloop() {
|
||||
|
||||
@@ -71,7 +71,7 @@ export class InactivityPage implements OnInit {
|
||||
async Login() {
|
||||
|
||||
if (this.validateUsername()) {
|
||||
if(this.validatePassword()) {
|
||||
if (this.validatePassword()) {
|
||||
|
||||
this.userattempt = {
|
||||
username: this.username,
|
||||
@@ -79,7 +79,7 @@ export class InactivityPage implements OnInit {
|
||||
domainName: environment.domain,
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
let attempt = await this.authService.login(this.userattempt, {saveSession: false})
|
||||
let attempt = await this.authService.login(this.userattempt, { saveSession: false })
|
||||
|
||||
if (attempt) {
|
||||
|
||||
@@ -88,7 +88,7 @@ export class InactivityPage implements OnInit {
|
||||
if (attempt.UserId == SessionStore.user.UserId) {
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
|
||||
if(this.p.userPermission(this.p.permissionList.Chat.access)){
|
||||
if (this.p.userPermission(this.p.permissionList.Chat.access)) {
|
||||
// this.authService.loginChat();
|
||||
}
|
||||
|
||||
@@ -119,18 +119,18 @@ export class InactivityPage implements OnInit {
|
||||
getToken() {
|
||||
this.notificatinsservice.requestPermissions();
|
||||
this.notificatinsservice.registrationError();
|
||||
this.notificatinsservice.getAndpostToken(this.username);
|
||||
// this.notificatinsservice.getAndpostToken(this.username);
|
||||
}
|
||||
|
||||
setCode(code: string) {
|
||||
|
||||
if(this.code.length < 4) {
|
||||
if (this.code.length < 4) {
|
||||
this.code.push(code)
|
||||
}
|
||||
|
||||
if(this.code.length == 4) {
|
||||
if (this.code.length == 4) {
|
||||
|
||||
if(!SessionStore.hasPin) {
|
||||
if (!SessionStore.hasPin) {
|
||||
//
|
||||
this.storePin()
|
||||
this.pinLogin()
|
||||
@@ -141,14 +141,14 @@ export class InactivityPage implements OnInit {
|
||||
}
|
||||
|
||||
clearCode() {
|
||||
this.code =[]
|
||||
this.code = []
|
||||
}
|
||||
|
||||
pinLogin() {
|
||||
|
||||
const code = this.code.join('')
|
||||
|
||||
if( SessionStore.validatePin(code)) {
|
||||
if (SessionStore.validatePin(code)) {
|
||||
|
||||
SessionStore.setInativity(true)
|
||||
this.goback()
|
||||
@@ -166,26 +166,26 @@ export class InactivityPage implements OnInit {
|
||||
|
||||
goback() {
|
||||
const pathName = this.SessionStore.user.UrlBeforeInactivity
|
||||
if(pathName) {
|
||||
this.router.navigate([pathName],{replaceUrl: true});
|
||||
if (pathName) {
|
||||
this.router.navigate([pathName], { replaceUrl: true });
|
||||
} else {
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
|
||||
if (this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)) {
|
||||
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
|
||||
if (this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0) {
|
||||
this.router.navigate(['/home/agenda']);
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
}
|
||||
//If user has access permission to both Chat and Action, goes to Chat by default.
|
||||
else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){
|
||||
else if ((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)) {
|
||||
this.router.navigate(['/home/chat']);
|
||||
}
|
||||
else if(this.p.userPermission(this.p.permissionList.Actions.access)){
|
||||
else if (this.p.userPermission(this.p.permissionList.Actions.access)) {
|
||||
this.router.navigate(['/home/publications']);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ export class LoginPage implements OnInit {
|
||||
userattempt: UserForm;
|
||||
code = []
|
||||
|
||||
hasPin: boolean
|
||||
hasPin: boolean
|
||||
loginPreference: string
|
||||
|
||||
sessionStore = SessionStore;
|
||||
@@ -56,16 +56,16 @@ export class LoginPage implements OnInit {
|
||||
private ChatService: ChatService,
|
||||
private platform: Platform,
|
||||
private FirstEnterService: FirstEnterService,
|
||||
private storage:Storage,
|
||||
private storage: Storage,
|
||||
private storageService: StorageService,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
ngOnInit() {}
|
||||
ngOnInit() { }
|
||||
|
||||
togglePassword() {
|
||||
this.showPassword = !this.showPassword;
|
||||
|
||||
if(this.passwordIcon == "eye") {
|
||||
if (this.passwordIcon == "eye") {
|
||||
this.passwordIcon = "eye-off";
|
||||
} else {
|
||||
this.passwordIcon = "eye";
|
||||
@@ -101,14 +101,14 @@ export class LoginPage implements OnInit {
|
||||
getToken() {
|
||||
this.notificatinsservice.requestPermissions();
|
||||
this.notificatinsservice.registrationError();
|
||||
this.notificatinsservice.getAndpostToken(this.username);
|
||||
// this.notificatinsservice.getAndpostToken(this.username);
|
||||
}
|
||||
|
||||
async Login() {
|
||||
|
||||
|
||||
if (this.validateUsername()) {
|
||||
if(this.validatePassword()) {
|
||||
if (this.validatePassword()) {
|
||||
|
||||
this.userattempt = {
|
||||
username: this.username.trim(),
|
||||
@@ -119,8 +119,8 @@ export class LoginPage implements OnInit {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
let attempt = await this.authService.login(this.userattempt, {saveSession: false})
|
||||
const data = await this.authService.loginContenteProduction(this.userattempt, {saveSession: true})
|
||||
let attempt = await this.authService.login(this.userattempt, { saveSession: false })
|
||||
const data = await this.authService.loginContenteProduction(this.userattempt, { saveSession: true })
|
||||
|
||||
|
||||
loader.remove()
|
||||
@@ -132,7 +132,7 @@ export class LoginPage implements OnInit {
|
||||
CPSession.save(data)
|
||||
this.changeProfileService.run();
|
||||
|
||||
if(attempt.ChatData) {
|
||||
if (attempt.ChatData) {
|
||||
|
||||
await this.authService.loginToChatWs();
|
||||
this.ChatService.setheader()
|
||||
@@ -167,16 +167,16 @@ export class LoginPage implements OnInit {
|
||||
|
||||
|
||||
|
||||
if(attempt.ChatData) {
|
||||
if (attempt.ChatData) {
|
||||
await this.authService.loginToChatWs();
|
||||
this.ChatService.setheader();
|
||||
this.ChatSystemService.loadChat();
|
||||
}
|
||||
this.storageService.remove("Notifications")
|
||||
this.getToken();
|
||||
this.getToken();
|
||||
|
||||
if(!this.platform.is('desktop') && !this.platform.is('mobileweb')) {
|
||||
if(this.sessionStore.hasPin) {
|
||||
if (!this.platform.is('desktop') && !this.platform.is('mobileweb')) {
|
||||
if (this.sessionStore.hasPin) {
|
||||
this.router.navigateByUrl('/home/events');
|
||||
} else {
|
||||
this.router.navigateByUrl('/pin', { replaceUrl: true });
|
||||
@@ -207,23 +207,23 @@ export class LoginPage implements OnInit {
|
||||
|
||||
goback() {
|
||||
const pathName = SessionStore.user.UrlBeforeInactivity
|
||||
if(pathName) {
|
||||
if (pathName) {
|
||||
this.router.navigate([pathName]);
|
||||
} else {
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
|
||||
if (this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)) {
|
||||
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
|
||||
if (this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0) {
|
||||
this.router.navigate(['/home/agenda']);
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
}
|
||||
//If user has access permission to both Chat and Action, goes to Chat by default.
|
||||
else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){
|
||||
else if ((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)) {
|
||||
this.router.navigate(['/home/chat']);
|
||||
}
|
||||
else if(this.p.userPermission(this.p.permissionList.Actions.access)){
|
||||
else if (this.p.userPermission(this.p.permissionList.Actions.access)) {
|
||||
this.router.navigate(['/home/publications']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ import { Capacitor } from '@capacitor/core';
|
||||
import { AngularFireMessaging } from '@angular/fire/messaging';
|
||||
import { NotificationHolderService } from 'src/app/store/notification-holder.service';
|
||||
|
||||
import { FCM } from '@capacitor-community/fcm';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -51,6 +53,9 @@ export class NotificationsService {
|
||||
private afMessaging: AngularFireMessaging,
|
||||
public NotificationHolderService: NotificationHolderService) {
|
||||
|
||||
this.onReciveForeground();
|
||||
this.onReciveBackground();
|
||||
|
||||
}
|
||||
|
||||
getTokenByUserIdAndId(user, userID) {
|
||||
@@ -65,10 +70,11 @@ export class NotificationsService {
|
||||
if (!this.isPushNotificationsAvailable) {
|
||||
return false
|
||||
}
|
||||
PushNotifications.requestPermissions().then(result => {
|
||||
PushNotifications.requestPermissions().then(async (result) => {
|
||||
if (result.receive === 'granted') {
|
||||
// Register with Apple / Google to receive push via APNS/FCM
|
||||
PushNotifications.register();
|
||||
this.getAndpostToken("")
|
||||
} else {
|
||||
// Show some error
|
||||
}
|
||||
@@ -77,19 +83,31 @@ export class NotificationsService {
|
||||
}
|
||||
}
|
||||
|
||||
getAndpostToken(username) {
|
||||
private getAndpostToken(username) {
|
||||
const geturl = environment.apiURL + 'notifications/token';
|
||||
|
||||
if (this.platform.is('mobile')) {
|
||||
if (!this.isPushNotificationsAvailable) {
|
||||
return false
|
||||
}
|
||||
if (this.platform.is('ios')) {
|
||||
FCM.getToken()
|
||||
.then(r => {
|
||||
this.postToken(r.token, geturl)
|
||||
this.token = r.token
|
||||
// alert(this.token)
|
||||
})
|
||||
.catch(err => console.log(err));
|
||||
} else {
|
||||
|
||||
PushNotifications.addListener('registration',
|
||||
(token: Token) => {
|
||||
this.postToken(token.value, geturl)
|
||||
this.token = token.value
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
PushNotifications.addListener('registration',
|
||||
(token: Token) => {
|
||||
this.postToken(token.value, geturl)
|
||||
this.token = token.value
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.afMessaging.requestToken.subscribe(
|
||||
(token) => {
|
||||
@@ -103,7 +121,6 @@ export class NotificationsService {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -148,14 +165,18 @@ export class NotificationsService {
|
||||
|
||||
PushNotifications.addListener('registrationError',
|
||||
(error: any) => {
|
||||
this.active = false
|
||||
this.active = false;
|
||||
|
||||
(() => {
|
||||
throw ("error" + error.error)
|
||||
})();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
onReciveForeground() {
|
||||
|
||||
if(this.platform.is('mobile')) {
|
||||
if (this.platform.is('mobile')) {
|
||||
|
||||
if (!this.isPushNotificationsAvailable) {
|
||||
return false
|
||||
@@ -174,9 +195,9 @@ export class NotificationsService {
|
||||
this.afMessaging.messages.subscribe((notification) => {
|
||||
this.storenotification(notification)
|
||||
this.notificationReceived.emit();
|
||||
this.eventtrigger.publishSomeData({
|
||||
notification: "recive"
|
||||
})
|
||||
this.eventtrigger.publishSomeData({
|
||||
notification: "recive"
|
||||
})
|
||||
// Handle the received message, e.g., show a notification
|
||||
});
|
||||
}
|
||||
@@ -190,7 +211,7 @@ export class NotificationsService {
|
||||
|
||||
onReciveBackground() {
|
||||
|
||||
if(this.platform.is('mobile')) {
|
||||
if (this.platform.is('mobile')) {
|
||||
if (!this.isPushNotificationsAvailable) {
|
||||
return false
|
||||
}
|
||||
@@ -285,7 +306,7 @@ export class NotificationsService {
|
||||
|
||||
notificatinsRoutes = (notification) => {
|
||||
|
||||
console.log('BACK BACK',notification)
|
||||
console.log('BACK BACK', notification)
|
||||
|
||||
if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) {
|
||||
|
||||
@@ -336,8 +357,14 @@ export class NotificationsService {
|
||||
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes-pr") {
|
||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.IdObject, 'gabinete-digital']));
|
||||
} else if (notification.notification.data.Service === "chat") {
|
||||
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "roomId": notification.notification.data.IdObject, } };
|
||||
this.zone.run(() => this.router.navigate(['/home/chat'], navigationExtras));
|
||||
|
||||
this.zone.run(() => this.router.navigate(['/home/chat']));
|
||||
|
||||
setTimeout(() => {
|
||||
this.zone.run(() => this.router.navigate(['/home/chat'], navigationExtras));
|
||||
}, 200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||