-
Notifications
You must be signed in to change notification settings - Fork 318
notif: package info indirection #1143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -149,8 +149,7 @@ class NotificationService { | |||||||||||||||
await addFcmToken(connection, token: token); | ||||||||||||||||
|
||||||||||||||||
case TargetPlatform.iOS: | ||||||||||||||||
const appBundleId = 'com.zulip.flutter'; // TODO(#407) find actual value live | ||||||||||||||||
await addApnsToken(connection, token: token, appid: appBundleId); | ||||||||||||||||
await addApnsToken(connection, token: token, appid: (await ZulipBinding.instance.packageInfo)?.packageName?? 'com.zulip.flutter'); | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bumping #1143 (comment) Let's include a It would be helpful to structure this with an if-statement first.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. makes sense! |
||||||||||||||||
|
||||||||||||||||
case TargetPlatform.linux: | ||||||||||||||||
case TargetPlatform.macOS: | ||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1032,7 +1032,7 @@ void main() { | |||||
if (defaultTargetPlatform == TargetPlatform.android) { | ||||||
checkLastRequestFcm(token: '012abc'); | ||||||
} else { | ||||||
checkLastRequestApns(token: '012abc', appid: 'com.zulip.flutter'); | ||||||
checkLastRequestApns(token: '012abc', appid: 'com.zulip.flutter.test'); | ||||||
} | ||||||
|
||||||
if (defaultTargetPlatform == TargetPlatform.android) { | ||||||
|
@@ -1071,7 +1071,7 @@ void main() { | |||||
if (defaultTargetPlatform == TargetPlatform.android) { | ||||||
checkLastRequestFcm(token: '012abc'); | ||||||
} else { | ||||||
checkLastRequestApns(token: '012abc', appid: 'com.zulip.flutter'); | ||||||
checkLastRequestApns(token: '012abc', appid: 'com.zulip.flutter.test'); | ||||||
} | ||||||
|
||||||
if (defaultTargetPlatform == TargetPlatform.android) { | ||||||
|
@@ -1082,6 +1082,22 @@ void main() { | |||||
checkLastRequestFcm(token: '456def'); | ||||||
} | ||||||
})); | ||||||
|
||||||
|
||||||
test('fallback to default appBundleId in case packageInfo is null', ()async{ | ||||||
// This tests the case where packageInfo is null | ||||||
// and default appBundleId gets passed to the [NotificationService.registerToken] method | ||||||
Comment on lines
+1088
to
+1089
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally the comment shouldn't be needed here, as the test code itself would be self-explanatory in most cases. It would be better to have comments on the exact places where something might not be obvious to a reader. |
||||||
|
||||||
prepareStore(); | ||||||
connection.prepare(json: {}); | ||||||
|
||||||
if(defaultTargetPlatform == TargetPlatform.iOS){ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check doesn't seem right. Because the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit:
Suggested change
Please also check for other spots for issues like this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found these instructions in testAndroidIos function : what do you think of replicating them in the above test. It will look something like this: prepareStore();
|
||||||
testBinding.packageInfoResult=null; | ||||||
await NotificationService.registerToken(connection, token: '012abc'); | ||||||
checkLastRequestApns(token: '012abc', appid: 'com.zulip.flutter'); | ||||||
addTearDown(testBinding.reset); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Usually this is called at the beginning of the test. |
||||||
} | ||||||
}); | ||||||
}); | ||||||
} | ||||||
|
||||||
|
Uh oh!
There was an error while loading. Please reload this page.