Repository navigation
fix: [SDK-5698] let initialize and login reach native #1205
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
base: main
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -9,7 +9,6 @@ import 'package:onesignal_flutter/src/location.dart'; | |
| import 'package:onesignal_flutter/src/notifications.dart'; | ||
| import 'package:onesignal_flutter/src/session.dart'; | ||
| import 'package:onesignal_flutter/src/user.dart'; | ||
| import 'package:onesignal_flutter/src/utils.dart'; | ||
|
|
||
| export 'src/defines.dart'; | ||
| export 'src/inappmessage.dart'; | ||
|
|
@@ -49,7 +48,6 @@ class OneSignal { | |
| /// The initializer accepts an [appId] which the developer can get | ||
| /// from the OneSignal consoleas well as a dictonary of [launchOptions] | ||
| static Future<void> initialize(String appId) async { | ||
| if (isMissing(appId, 'initialize: appId')) return; | ||
| await _channel.invokeMethod('OneSignal#initialize', {'appId': appId}); | ||
| await Future.wait([ | ||
|
Collaborator
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:
Contributor
Author
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. Noted, and agreed it matches calling |
||
| InAppMessages.lifecycleInit(), | ||
|
|
@@ -64,7 +62,6 @@ class OneSignal { | |
| /// The act of logging a user into the OneSignal SDK will switch the | ||
| /// user context to that specific user. | ||
| static Future<void> login(String externalId) async { | ||
| if (isMissing(externalId, 'login: externalId')) return; | ||
| return await _channel.invokeMethod('OneSignal#login', { | ||
| 'externalId': externalId, | ||
| }); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking: no test covers
initialize('')now. Could you add one asserting''is forwarded and the lifecycle methods still run? As is, restoring the old guard would still pass the suite.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, and the part that matters is your point that restoring the old guard would still pass the suite as written. Not added yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now added in 685a8eb. Asserts
''is forwarded and that the lifecycle methods still run. Revert-checked: restoring the guard turns it red, which was your actual point.