fix ios notifications

This commit is contained in:
Lorito Tiago
2023-10-09 14:15:21 +01:00
parent 76f8ac976a
commit cca49822b3
70 changed files with 7451 additions and 44713 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = { const config: CapacitorConfig = {
appId: 'com.capacitorjs.app.testapp', appId: 'com.capacitorjs.app.testapp',
appName: 'capacitor-testapp', appName: 'Gabinete Digital',
webDir: 'www', webDir: 'www',
plugins: { plugins: {
SplashScreen: { 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>
+17 -3
View File
@@ -15,6 +15,7 @@
504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC3101FED79650016851F /* LaunchScreen.storyboard */; }; 504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC3101FED79650016851F /* LaunchScreen.storyboard */; };
50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; }; 50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; };
A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */; }; 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 */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
@@ -34,6 +35,8 @@
DA6FE4D62ACEF2DA006F1E0D /* FirebaseCoreInternal.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = FirebaseCoreInternal.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 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; }; 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; }; 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>"; }; 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 */ /* End PBXFileReference section */
@@ -83,8 +86,10 @@
504EC3061FED79650016851F /* App */ = { 504EC3061FED79650016851F /* App */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
DA8422AF2AD03FBE00AC9118 /* App.entitlements */,
50379B222058CBB4000EE86E /* capacitor.config.json */, 50379B222058CBB4000EE86E /* capacitor.config.json */,
504EC3071FED79650016851F /* AppDelegate.swift */, 504EC3071FED79650016851F /* AppDelegate.swift */,
DAD1AB3D2ACF39DE001D9958 /* GoogleService-Info.plist */,
504EC30B1FED79650016851F /* Main.storyboard */, 504EC30B1FED79650016851F /* Main.storyboard */,
504EC30E1FED79650016851F /* Assets.xcassets */, 504EC30E1FED79650016851F /* Assets.xcassets */,
504EC3101FED79650016851F /* LaunchScreen.storyboard */, 504EC3101FED79650016851F /* LaunchScreen.storyboard */,
@@ -134,7 +139,7 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastSwiftUpdateCheck = 0920; LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 0920; LastUpgradeCheck = 1420;
TargetAttributes = { TargetAttributes = {
504EC3031FED79650016851F = { 504EC3031FED79650016851F = {
CreatedOnToolsVersion = 9.2; CreatedOnToolsVersion = 9.2;
@@ -175,6 +180,7 @@
50379B232058CBB4000EE86E /* capacitor.config.json in Resources */, 50379B232058CBB4000EE86E /* capacitor.config.json in Resources */,
504EC30D1FED79650016851F /* Main.storyboard in Resources */, 504EC30D1FED79650016851F /* Main.storyboard in Resources */,
2FAD9763203C412B000D30F8 /* config.xml in Resources */, 2FAD9763203C412B000D30F8 /* config.xml in Resources */,
DAD1AB3F2ACF3A7F001D9958 /* GoogleService-Info.plist in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@@ -276,6 +282,7 @@
CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES; CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_EMPTY_BODY = YES;
@@ -283,8 +290,10 @@
CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_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_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -333,6 +342,7 @@
CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES; CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_EMPTY_BODY = YES;
@@ -340,8 +350,10 @@
CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_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_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -375,9 +387,10 @@
baseConfigurationReference = FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */; baseConfigurationReference = FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 15; CURRENT_PROJECT_VERSION = 36;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS;
INFOPLIST_FILE = App/Info.plist; INFOPLIST_FILE = App/Info.plist;
@@ -403,9 +416,10 @@
baseConfigurationReference = AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */; baseConfigurationReference = AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 15; CURRENT_PROJECT_VERSION = 36;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS;
INFOPLIST_FILE = App/Info.plist; INFOPLIST_FILE = App/Info.plist;
+8
View File
@@ -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>
+13 -7
View File
@@ -12,23 +12,25 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Override point for customization after application launch. // Override point for customization after application launch.
// Specify the custom file path // 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 // Check if the custom plist file exists
if let filePath = customGoogleServiceInfoPlistPath, // if let filePath = customGoogleServiceInfoPlistPath,
let fileOptions = FirebaseOptions(contentsOfFile: filePath) { // let fileOptions = FirebaseOptions(contentsOfFile: filePath) {
FirebaseApp.configure(options: fileOptions) // FirebaseApp.configure(options: fileOptions)
} else { // } else {
// Handle the case where the custom plist file is not found // 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() FirebaseApp.configure()
} //}
return true return true
} }
func applicationWillResignActive(_ application: UIApplication) { 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. // 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. // 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) { func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
NotificationCenter.default.post(name: .capacitorDidRegisterForRemoteNotifications, object: deviceToken) NotificationCenter.default.post(name: .capacitorDidRegisterForRemoteNotifications, object: deviceToken)
Messaging.messaging().apnsToken = deviceToken
} }
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) { func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
NotificationCenter.default.post(name: .capacitorDidFailToRegisterForRemoteNotifications, object: error) NotificationCenter.default.post(name: .capacitorDidFailToRegisterForRemoteNotifications, object: error)
} }
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long
@@ -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>
+11 -7
View File
@@ -2,16 +2,18 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>NSCameraUsageDescription</key> <key>FirebaseAppDelegateProxyEnabled</key>
<string>Privacy - Camera Usage Description</string> <true/>
<key>NSPhotoLibraryAddUsageDescription</key> <key>UNUserNotificationCenterDelegate</key>
<string>Privacy - Photo Library Additions Usage Description</string> <string>YourApp.NotificationDelegate</string>
<key>NSPhotoLibraryUsageDescription</key> <key>UIBackgroundModes</key>
<string>Privacy - Photo Library Usage Description</string> <array>
<string>remote-notification</string>
</array>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>capacitor-testapp</string> <string>Gabinete Digital</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
@@ -42,6 +44,8 @@
<string>This app needs your location to test the location feature of the Google Maps plugin.</string> <string>This app needs your location to test the location feature of the Google Maps plugin.</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>Used to capture audio for image picker plugin</string> <string>Used to capture audio for image picker plugin</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Privacy - Photo Library Additions Usage Description</string>
<key>NSPhotoLibraryUsageDescription</key> <key>NSPhotoLibraryUsageDescription</key>
<string>Used to demonstrate image picker plugin</string> <string>Used to demonstrate image picker plugin</string>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
-36
View File
@@ -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
View File
@@ -11,6 +11,7 @@ install! 'cocoapods', :disable_input_output_paths => true
def capacitor_pods def capacitor_pods
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios' pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :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 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
pod 'CapacitorBrowser', :path => '../../node_modules/@capacitor/browser' pod 'CapacitorBrowser', :path => '../../node_modules/@capacitor/browser'
pod 'CapacitorCamera', :path => '../../node_modules/@capacitor/camera' pod 'CapacitorCamera', :path => '../../node_modules/@capacitor/camera'
+7287 -44350
View File
File diff suppressed because it is too large Load Diff
+6 -4
View File
@@ -46,19 +46,20 @@
"@awesome-cordova-plugins/file": "^5.41.0", "@awesome-cordova-plugins/file": "^5.41.0",
"@awesome-cordova-plugins/file-opener": "^5.41.0", "@awesome-cordova-plugins/file-opener": "^5.41.0",
"@awesome-cordova-plugins/multiple-document-picker": "^5.40.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/app": "^4.1.1",
"@capacitor/browser": "^4.1.0", "@capacitor/browser": "^4.1.0",
"@capacitor/camera": "^4.1.4", "@capacitor/camera": "^4.1.4",
"@capacitor/core": "^3.3.2", "@capacitor/core": "^5.4.2",
"@capacitor/device": "^4.1.0", "@capacitor/device": "^4.1.0",
"@capacitor/filesystem": "^4.1.4", "@capacitor/filesystem": "^4.1.4",
"@capacitor/haptics": "^4.1.0", "@capacitor/haptics": "^4.1.0",
"@capacitor/ios": "^4.6.1", "@capacitor/ios": "^5.4.2",
"@capacitor/keyboard": "^4.1.0", "@capacitor/keyboard": "^4.1.0",
"@capacitor/local-notifications": "^4.1.4", "@capacitor/local-notifications": "^4.1.4",
"@capacitor/network": "^4.1.0", "@capacitor/network": "^4.1.0",
"@capacitor/push-notifications": "^4.1.2", "@capacitor/push-notifications": "^5.1.0",
"@capacitor/share": "^4.1.0", "@capacitor/share": "^4.1.0",
"@capacitor/storage": "^1.2.5", "@capacitor/storage": "^1.2.5",
"@fortawesome/angular-fontawesome": "^0.9.0", "@fortawesome/angular-fontawesome": "^0.9.0",
@@ -182,6 +183,7 @@
"ts-jest-puppeteer": "^0.0.5", "ts-jest-puppeteer": "^0.0.5",
"tslib": "^2.0.0", "tslib": "^2.0.0",
"uuidv4": "^6.2.11", "uuidv4": "^6.2.11",
"webpack": "^5.88.2",
"wordcloud": "^1.1.2", "wordcloud": "^1.1.2",
"ws": "^7.4.6", "ws": "^7.4.6",
"zod": "^3.22.2", "zod": "^3.22.2",
-2
View File
@@ -164,8 +164,6 @@ export class HomePage implements OnInit {
this.logDeviceInfo(); this.logDeviceInfo();
this.notificationsService.onReciveForeground();
this.notificationsService.onReciveBackground();
window.addEventListener('online', () => { window.addEventListener('online', () => {
this.backgroundservice.online() this.backgroundservice.online()
+1 -1
View File
@@ -119,7 +119,7 @@ export class InactivityPage implements OnInit {
getToken() { getToken() {
this.notificatinsservice.requestPermissions(); this.notificatinsservice.requestPermissions();
this.notificatinsservice.registrationError(); this.notificatinsservice.registrationError();
this.notificatinsservice.getAndpostToken(this.username); // this.notificatinsservice.getAndpostToken(this.username);
} }
setCode(code: string) { setCode(code: string) {
+1 -1
View File
@@ -101,7 +101,7 @@ export class LoginPage implements OnInit {
getToken() { getToken() {
this.notificatinsservice.requestPermissions(); this.notificatinsservice.requestPermissions();
this.notificatinsservice.registrationError(); this.notificatinsservice.registrationError();
this.notificatinsservice.getAndpostToken(this.username); // this.notificatinsservice.getAndpostToken(this.username);
} }
async Login() { async Login() {
+31 -4
View File
@@ -15,6 +15,8 @@ import { Capacitor } from '@capacitor/core';
import { AngularFireMessaging } from '@angular/fire/messaging'; import { AngularFireMessaging } from '@angular/fire/messaging';
import { NotificationHolderService } from 'src/app/store/notification-holder.service'; import { NotificationHolderService } from 'src/app/store/notification-holder.service';
import { FCM } from '@capacitor-community/fcm';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -51,6 +53,9 @@ export class NotificationsService {
private afMessaging: AngularFireMessaging, private afMessaging: AngularFireMessaging,
public NotificationHolderService: NotificationHolderService) { public NotificationHolderService: NotificationHolderService) {
this.onReciveForeground();
this.onReciveBackground();
} }
getTokenByUserIdAndId(user, userID) { getTokenByUserIdAndId(user, userID) {
@@ -65,10 +70,11 @@ export class NotificationsService {
if (!this.isPushNotificationsAvailable) { if (!this.isPushNotificationsAvailable) {
return false return false
} }
PushNotifications.requestPermissions().then(result => { PushNotifications.requestPermissions().then(async (result) => {
if (result.receive === 'granted') { if (result.receive === 'granted') {
// Register with Apple / Google to receive push via APNS/FCM // Register with Apple / Google to receive push via APNS/FCM
PushNotifications.register(); PushNotifications.register();
this.getAndpostToken("")
} else { } else {
// Show some error // Show some error
} }
@@ -77,12 +83,22 @@ export class NotificationsService {
} }
} }
getAndpostToken(username) { private getAndpostToken(username) {
const geturl = environment.apiURL + 'notifications/token'; const geturl = environment.apiURL + 'notifications/token';
if (this.platform.is('mobile')) { if (this.platform.is('mobile')) {
if (!this.isPushNotificationsAvailable) { if (!this.isPushNotificationsAvailable) {
return false 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', PushNotifications.addListener('registration',
(token: Token) => { (token: Token) => {
@@ -90,6 +106,8 @@ export class NotificationsService {
this.token = token.value this.token = token.value
} }
); );
}
} else { } else {
this.afMessaging.requestToken.subscribe( this.afMessaging.requestToken.subscribe(
(token) => { (token) => {
@@ -103,7 +121,6 @@ export class NotificationsService {
} }
); );
} }
} }
@@ -148,7 +165,11 @@ export class NotificationsService {
PushNotifications.addListener('registrationError', PushNotifications.addListener('registrationError',
(error: any) => { (error: any) => {
this.active = false this.active = false;
(() => {
throw ("error" + error.error)
})();
} }
); );
} }
@@ -336,8 +357,14 @@ export class NotificationsService {
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes-pr") { 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'])); this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.IdObject, 'gabinete-digital']));
} else if (notification.notification.data.Service === "chat") { } else if (notification.notification.data.Service === "chat") {
let navigationExtras: NavigationExtras = { queryParams: { "roomId": notification.notification.data.IdObject, } }; let navigationExtras: NavigationExtras = { queryParams: { "roomId": notification.notification.data.IdObject, } };
this.zone.run(() => this.router.navigate(['/home/chat']));
setTimeout(() => {
this.zone.run(() => this.router.navigate(['/home/chat'], navigationExtras)); this.zone.run(() => this.router.navigate(['/home/chat'], navigationExtras));
}, 200);
} }
} }
File diff suppressed because one or more lines are too long