Skip to content

Commit 044534b

Browse files
committed
add config push notification on iOS
change app id from com.dfa.flutterChatDemo -> com.duytq.flutterchatdemo on iOS
1 parent 4f008d3 commit 044534b

File tree

5 files changed

+46
-30
lines changed

5 files changed

+46
-30
lines changed

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
03E80A4E2123CF78000CBC08 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 03E80A4D2123CF78000CBC08 /* GoogleService-Info.plist */; };
1110
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1211
31FEF151F1859E1D774F983A /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F87C65FAE473F13774A7A898 /* libPods-Runner.a */; };
1312
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
@@ -22,6 +21,7 @@
2221
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
2322
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
2423
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
24+
D207AAF322D6495700F97ACD /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = D207AAF222D6495600F97ACD /* GoogleService-Info.plist */; };
2525
/* End PBXBuildFile section */
2626

2727
/* Begin PBXCopyFilesBuildPhase section */
@@ -40,7 +40,6 @@
4040
/* End PBXCopyFilesBuildPhase section */
4141

4242
/* Begin PBXFileReference section */
43-
03E80A4D2123CF78000CBC08 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = SOURCE_ROOT; };
4443
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
4544
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
4645
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
@@ -59,6 +58,8 @@
5958
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
6059
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6160
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
61+
D207AAF222D6495600F97ACD /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
62+
D207AAF422D64B6100F97ACD /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
6263
F87C65FAE473F13774A7A898 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
6364
/* End PBXFileReference section */
6465

@@ -120,7 +121,8 @@
120121
97C146F01CF9000F007C117D /* Runner */ = {
121122
isa = PBXGroup;
122123
children = (
123-
03E80A4D2123CF78000CBC08 /* GoogleService-Info.plist */,
124+
D207AAF422D64B6100F97ACD /* Runner.entitlements */,
125+
D207AAF222D6495600F97ACD /* GoogleService-Info.plist */,
124126
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
125127
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
126128
97C146FA1CF9000F007C117D /* Main.storyboard */,
@@ -187,6 +189,12 @@
187189
TargetAttributes = {
188190
97C146ED1CF9000F007C117D = {
189191
CreatedOnToolsVersion = 7.3.1;
192+
DevelopmentTeam = FF3XTSVPAA;
193+
SystemCapabilities = {
194+
com.apple.Push = {
195+
enabled = 1;
196+
};
197+
};
190198
};
191199
};
192200
};
@@ -214,12 +222,12 @@
214222
buildActionMask = 2147483647;
215223
files = (
216224
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
217-
03E80A4E2123CF78000CBC08 /* GoogleService-Info.plist in Resources */,
218225
9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */,
219226
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
220227
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
221228
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
222229
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
230+
D207AAF322D6495700F97ACD /* GoogleService-Info.plist in Resources */,
223231
);
224232
runOnlyForDeploymentPostprocessing = 0;
225233
};
@@ -452,7 +460,9 @@
452460
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
453461
buildSettings = {
454462
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
463+
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
455464
CURRENT_PROJECT_VERSION = 1;
465+
DEVELOPMENT_TEAM = FF3XTSVPAA;
456466
ENABLE_BITCODE = NO;
457467
FRAMEWORK_SEARCH_PATHS = (
458468
"$(inherited)",
@@ -464,7 +474,7 @@
464474
"$(inherited)",
465475
"$(PROJECT_DIR)/Flutter",
466476
);
467-
PRODUCT_BUNDLE_IDENTIFIER = com.dfa.flutterChatDemo;
477+
PRODUCT_BUNDLE_IDENTIFIER = com.duytq.flutterchatdemo;
468478
PRODUCT_NAME = "$(TARGET_NAME)";
469479
VERSIONING_SYSTEM = "apple-generic";
470480
};
@@ -475,7 +485,9 @@
475485
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
476486
buildSettings = {
477487
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
488+
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
478489
CURRENT_PROJECT_VERSION = 1;
490+
DEVELOPMENT_TEAM = FF3XTSVPAA;
479491
ENABLE_BITCODE = NO;
480492
FRAMEWORK_SEARCH_PATHS = (
481493
"$(inherited)",
@@ -487,7 +499,7 @@
487499
"$(inherited)",
488500
"$(PROJECT_DIR)/Flutter",
489501
);
490-
PRODUCT_BUNDLE_IDENTIFIER = com.dfa.flutterChatDemo;
502+
PRODUCT_BUNDLE_IDENTIFIER = com.duytq.flutterchatdemo;
491503
PRODUCT_NAME = "$(TARGET_NAME)";
492504
VERSIONING_SYSTEM = "apple-generic";
493505
};

ios/GoogleService-Info.plist renamed to ios/Runner/GoogleService-Info.plist

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,36 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>AD_UNIT_ID_FOR_BANNER_TEST</key>
6-
<string>ca-app-pub-3940256099942544/2934735716</string>
7-
<key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>
8-
<string>ca-app-pub-3940256099942544/4411468910</string>
95
<key>CLIENT_ID</key>
10-
<string>347976604232-13h782ee23otgsaaiidgeb43jnp1jepd.apps.googleusercontent.com</string>
6+
<string>347976604232-tkt67s3gule9mfekuegqprqai45f12km.apps.googleusercontent.com</string>
117
<key>REVERSED_CLIENT_ID</key>
12-
<string>com.googleusercontent.apps.347976604232-13h782ee23otgsaaiidgeb43jnp1jepd</string>
8+
<string>com.googleusercontent.apps.347976604232-tkt67s3gule9mfekuegqprqai45f12km</string>
9+
<key>ANDROID_CLIENT_ID</key>
10+
<string>347976604232-cs3athvek5l2ehqjudkhpj0qq8rgp8i9.apps.googleusercontent.com</string>
1311
<key>API_KEY</key>
1412
<string>AIzaSyAdn3U0F35xhx2zUFfz6XPOcNm50erGZS0</string>
1513
<key>GCM_SENDER_ID</key>
1614
<string>347976604232</string>
1715
<key>PLIST_VERSION</key>
1816
<string>1</string>
1917
<key>BUNDLE_ID</key>
20-
<string>com.dfa.flutterChatDemo</string>
18+
<string>com.duytq.flutterchatdemo</string>
2119
<key>PROJECT_ID</key>
2220
<string>flutterchatdemo</string>
2321
<key>STORAGE_BUCKET</key>
2422
<string>flutterchatdemo.appspot.com</string>
2523
<key>IS_ADS_ENABLED</key>
26-
<true></true>
24+
<false></false>
2725
<key>IS_ANALYTICS_ENABLED</key>
2826
<false></false>
2927
<key>IS_APPINVITE_ENABLED</key>
30-
<false></false>
28+
<true></true>
3129
<key>IS_GCM_ENABLED</key>
3230
<true></true>
3331
<key>IS_SIGNIN_ENABLED</key>
3432
<true></true>
3533
<key>GOOGLE_APP_ID</key>
36-
<string>1:347976604232:ios:f43eb2afc88737b9</string>
34+
<string>1:347976604232:ios:2a379f1827e4427b</string>
3735
<key>DATABASE_URL</key>
3836
<string>https://flutterchatdemo.firebaseio.com</string>
3937
</dict>

ios/Runner/Info.plist

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@
1818
<string>1.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
21+
<key>CFBundleURLTypes</key>
22+
<array>
23+
<dict>
24+
<key>CFBundleTypeRole</key>
25+
<string>Editor</string>
26+
<key>CFBundleURLSchemes</key>
27+
<array>
28+
<string>com.googleusercontent.apps.347976604232-tkt67s3gule9mfekuegqprqai45f12km</string>
29+
</array>
30+
</dict>
31+
</array>
2132
<key>CFBundleVersion</key>
2233
<string>1</string>
2334
<key>LSRequiresIPhoneOS</key>
@@ -26,22 +37,9 @@
2637
<string>LaunchScreen</string>
2738
<key>UIMainStoryboardFile</key>
2839
<string>Main</string>
29-
<key>CFBundleURLTypes</key>
30-
<array>
31-
<dict>
32-
<key>CFBundleTypeRole</key>
33-
<string>Editor</string>
34-
<key>CFBundleURLSchemes</key>
35-
<array>
36-
<string>com.googleusercontent.apps.347976604232-13h782ee23otgsaaiidgeb43jnp1jepd</string>
37-
</array>
38-
</dict>
39-
</array>
4040
<key>UISupportedInterfaceOrientations</key>
4141
<array>
4242
<string>UIInterfaceOrientationPortrait</string>
43-
<string>UIInterfaceOrientationLandscapeLeft</string>
44-
<string>UIInterfaceOrientationLandscapeRight</string>
4543
</array>
4644
<key>UISupportedInterfaceOrientations~ipad</key>
4745
<array>

ios/Runner/Runner.entitlements

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>aps-environment</key>
6+
<string>development</string>
7+
</dict>
8+
</plist>

lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class MainScreenState extends State<MainScreen> {
8787

8888
void showNotification(message) async {
8989
var androidPlatformChannelSpecifics = new AndroidNotificationDetails(
90-
'com.dfa.flutterchatdemo',
90+
Platform.isAndroid ? 'com.dfa.flutterchatdemo': 'com.duytq.flutterchatdemo',
9191
'Flutter chat demo',
9292
'your channel description',
9393
playSound: true,

0 commit comments

Comments
 (0)