From 06d1d08f6dffaadd1ac71c1c09bb027631fb1130 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Wed, 5 May 2021 08:40:59 +0200 Subject: [PATCH] Push notifications are working on iOS --- ios/Runner.xcodeproj/project.pbxproj | 59 ++++++++++++++++----- ios/Runner/Runner.entitlements | 8 +++ ios/config/comunic/GoogleService-Info.plist | 34 ++++++++++++ 3 files changed, 87 insertions(+), 14 deletions(-) create mode 100644 ios/Runner/Runner.entitlements create mode 100644 ios/config/comunic/GoogleService-Info.plist diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 1acc48e..d3da37a 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -11,6 +11,7 @@ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 6B56B0EAFAE8328410BF4F0C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F57A07BDAAD5F07639423EE8 /* Pods_Runner.framework */; }; 8F2AEBBC26394110007DF92A /* LaunchScreenForez.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8F2AEBBA26394110007DF92A /* LaunchScreenForez.storyboard */; }; + 8FFF7880264272F1002E5895 /* config in Resources */ = {isa = PBXBuildFile; fileRef = 8FFF787F264272F1002E5895 /* config */; }; 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; @@ -45,6 +46,8 @@ 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 8CF757033A070BF5F6AD7355 /* Pods-Runner.debug-comunic.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug-comunic.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug-comunic.xcconfig"; sourceTree = ""; }; 8F2AEBBB26394110007DF92A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreenForez.storyboard; sourceTree = ""; }; + 8FEFC7EA26405694003B7DF3 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; + 8FFF787F264272F1002E5895 /* config */ = {isa = PBXFileReference; lastKnownFileType = folder; path = config; sourceTree = ""; }; 9731915131511AD49411A740 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -87,6 +90,7 @@ 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( + 8FFF787F264272F1002E5895 /* config */, 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, @@ -106,6 +110,7 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( + 8FEFC7EA26405694003B7DF3 /* Runner.entitlements */, 8F2AEBBA26394110007DF92A /* LaunchScreenForez.storyboard */, 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, @@ -164,6 +169,7 @@ 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, + 8FFF788226427350002E5895 /* Copy GoogleService-Info.plist to the correct location */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, @@ -189,7 +195,7 @@ TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; - DevelopmentTeam = A9JXUMT7RC; + DevelopmentTeam = QRU542F2B8; }; }; }; @@ -218,6 +224,7 @@ buildActionMask = 2147483647; files = ( 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 8FFF7880264272F1002E5895 /* config in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, @@ -265,6 +272,24 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 8FFF788226427350002E5895 /* Copy GoogleService-Info.plist to the correct location */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Copy GoogleService-Info.plist to the correct location"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "setopt KSH_ARRAYS BASH_REMATCH\nenvironment=\"default\"\n\n# Regex to extract the scheme name from the Build Configuration\n# We have named our Build Configurations as Debug-dev, Debug-prod etc.\n# Here, dev and prod are the scheme names. This kind of naming is required by Flutter for flavors to work.\n# We are using the $CONFIGURATION variable available in the XCode build environment to extract \n# the environment (or flavor)\n# For eg.\n# If CONFIGURATION=\"Debug-prod\", then environment will get set to \"prod\".\nif [[ $CONFIGURATION =~ -([^-]*)$ ]]; then\nenvironment=${BASH_REMATCH[1]}\nfi\n\necho $environment\n\n# Name and path of the resource we're copying\nGOOGLESERVICE_INFO_PLIST=GoogleService-Info.plist\nGOOGLESERVICE_INFO_FILE=${PROJECT_DIR}/config/${environment}/${GOOGLESERVICE_INFO_PLIST}\n\n# Make sure GoogleService-Info.plist exists\necho \"Looking for ${GOOGLESERVICE_INFO_PLIST} in ${GOOGLESERVICE_INFO_FILE}\"\nif [ ! -f $GOOGLESERVICE_INFO_FILE ]\nthen\necho \"No GoogleService-Info.plist found. Please ensure it's in the proper directory.\"\nexit 1\nfi\n\n# Get a reference to the destination location for the GoogleService-Info.plist\n# This is the default location where Firebase init code expects to find GoogleServices-Info.plist file\nPLIST_DESTINATION=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app\necho \"Will copy ${GOOGLESERVICE_INFO_PLIST} to final destination: ${PLIST_DESTINATION}\"\n\n# Copy over the prod GoogleService-Info.plist for Release builds\ncp \"${GOOGLESERVICE_INFO_FILE}\" \"${PLIST_DESTINATION}\"\n# unsetopt KSH_ARRAYS\n"; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -277,7 +302,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n"; }; C9EE070942D44B728369915C /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; @@ -456,8 +481,9 @@ APP_DISPLAY_NAME = Comunic; APP_LAUNCH_STORYBOARD_NAME = LaunchScreen; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = S8QB4VV633; + DEVELOPMENT_TEAM = QRU542F2B8; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -469,7 +495,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = org.communiquons.comunic; + PRODUCT_BUNDLE_IDENTIFIER = org.PierreHubert.comunic; PRODUCT_NAME = "$(TARGET_NAME)"; VERSIONING_SYSTEM = "apple-generic"; }; @@ -535,8 +561,9 @@ APP_DISPLAY_NAME = "#Forez"; APP_LAUNCH_STORYBOARD_NAME = LaunchScreenForez; ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-forez"; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = A9JXUMT7RC; + DEVELOPMENT_TEAM = QRU542F2B8; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -548,7 +575,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = org.communiquons.forez; + PRODUCT_BUNDLE_IDENTIFIER = org.PierreHubert.forez; PRODUCT_NAME = "$(TARGET_NAME)"; VERSIONING_SYSTEM = "apple-generic"; }; @@ -608,8 +635,9 @@ APP_DISPLAY_NAME = "#Forez"; APP_LAUNCH_STORYBOARD_NAME = LaunchScreenForez; ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-forez"; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = A9JXUMT7RC; + DEVELOPMENT_TEAM = QRU542F2B8; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -621,7 +649,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = org.communiquons.forez; + PRODUCT_BUNDLE_IDENTIFIER = org.PierreHubert.forez; PRODUCT_NAME = "$(TARGET_NAME)"; VERSIONING_SYSTEM = "apple-generic"; }; @@ -681,8 +709,9 @@ APP_DISPLAY_NAME = "#Forez"; APP_LAUNCH_STORYBOARD_NAME = LaunchScreenForez; ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-forez"; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = S8QB4VV633; + DEVELOPMENT_TEAM = QRU542F2B8; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -694,7 +723,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = org.communiquons.forez; + PRODUCT_BUNDLE_IDENTIFIER = org.PierreHubert.forez; PRODUCT_NAME = "$(TARGET_NAME)"; VERSIONING_SYSTEM = "apple-generic"; }; @@ -807,8 +836,9 @@ APP_DISPLAY_NAME = Comunic; APP_LAUNCH_STORYBOARD_NAME = LaunchScreen; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = A9JXUMT7RC; + DEVELOPMENT_TEAM = QRU542F2B8; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -820,7 +850,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = org.communiquons.comunic; + PRODUCT_BUNDLE_IDENTIFIER = org.PierreHubert.comunic; PRODUCT_NAME = "$(TARGET_NAME)"; VERSIONING_SYSTEM = "apple-generic"; }; @@ -833,8 +863,9 @@ APP_DISPLAY_NAME = Comunic; APP_LAUNCH_STORYBOARD_NAME = LaunchScreen; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = A9JXUMT7RC; + DEVELOPMENT_TEAM = QRU542F2B8; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -846,7 +877,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = org.communiquons.comunic; + PRODUCT_BUNDLE_IDENTIFIER = org.PierreHubert.comunic; PRODUCT_NAME = "$(TARGET_NAME)"; VERSIONING_SYSTEM = "apple-generic"; }; diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements new file mode 100644 index 0000000..903def2 --- /dev/null +++ b/ios/Runner/Runner.entitlements @@ -0,0 +1,8 @@ + + + + + aps-environment + development + + diff --git a/ios/config/comunic/GoogleService-Info.plist b/ios/config/comunic/GoogleService-Info.plist new file mode 100644 index 0000000..4e1cc51 --- /dev/null +++ b/ios/config/comunic/GoogleService-Info.plist @@ -0,0 +1,34 @@ + + + + + CLIENT_ID + 1007877315904-umuhjlq7qfcdn8f24kjddhpmlb67gvpd.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.1007877315904-umuhjlq7qfcdn8f24kjddhpmlb67gvpd + API_KEY + AIzaSyBzcEJVIHvHl-viG19qR3LFhb6aYj5EZXM + GCM_SENDER_ID + 1007877315904 + PLIST_VERSION + 1 + BUNDLE_ID + org.PierreHubert.comunic + PROJECT_ID + comunic-ae92c + STORAGE_BUCKET + comunic-ae92c.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:1007877315904:ios:469f6c61859712260aeea5 + + \ No newline at end of file