Skip to content

Commit c119c94

Browse files
indirection: modify the accessibility of the packageName using the binding class
1 parent cfc9023 commit c119c94

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lib/notifications/receive.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ class NotificationService {
149149
await addFcmToken(connection, token: token);
150150

151151
case TargetPlatform.iOS:
152-
final appBundleId = await ZulipBinding.instance.getAppBundleId(); // TODO(#407) find actual value live
153-
await addApnsToken(connection, token: token, appid: appBundleId);
152+
// TODO(#407) find actual value live
153+
await addApnsToken(connection, token: token, appid: (await ZulipBinding.instance.packageInfo)?.packageName ?? "com.zulip.flutter");
154154

155155
case TargetPlatform.linux:
156156
case TargetPlatform.macOS:

test/api/core_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ void main() {
460460
});
461461
}
462462

463-
const packageInfo = PackageInfo(version: '0.0.1', buildNumber: '1');
463+
const packageInfo = PackageInfo(version: '0.0.1', buildNumber: '1', packageName: 'com.zulip.flutter.test');
464464

465465
const testCases = [
466466
('ZulipFlutter/0.0.1+1 (Android 14)', AndroidDeviceInfo(release: '14', sdkInt: 34), ),

test/model/store_test.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ void main() {
10321032
if (defaultTargetPlatform == TargetPlatform.android) {
10331033
checkLastRequestFcm(token: '012abc');
10341034
} else {
1035-
checkLastRequestApns(token: '012abc', appid:await testBinding.getAppBundleId());
1035+
checkLastRequestApns(token: '012abc', appid:(await testBinding.packageInfo)?.packageName?? 'com.zulip.flutter.test');
10361036
}
10371037

10381038
if (defaultTargetPlatform == TargetPlatform.android) {
@@ -1071,7 +1071,7 @@ void main() {
10711071
if (defaultTargetPlatform == TargetPlatform.android) {
10721072
checkLastRequestFcm(token: '012abc');
10731073
} else {
1074-
checkLastRequestApns(token: '012abc', appid:await testBinding.getAppBundleId());
1074+
checkLastRequestApns(token: '012abc', appid:(await testBinding.packageInfo)?.packageName?? 'com.zulip.flutter.test');
10751075
}
10761076

10771077
if (defaultTargetPlatform == TargetPlatform.android) {

test/notifications/receive_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void main() {
3434
group('tokens', () {
3535
test('APNs token registration using correct app bundle ID', () async {
3636
await init();
37-
check(await testBinding.getAppBundleId())
37+
check((await testBinding.packageInfo)?.packageName?? 'com.zulip.flutter.test')
3838
.equals('com.zulip.flutter.test');
3939
}, );
4040
});

0 commit comments

Comments
 (0)