-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Resolve push notification dependency loop #14702
Merged
alex-mechler
merged 9 commits into
main
from
jules-resolvePushNotificationDependencyLoop
Feb 15, 2023
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b1044ad
don't bundle notification type in PushNotification export
Julesssss 66f0d8f
use separate import for NotificationType, resolving dependency loop
Julesssss 1e62140
further separate the PushNotification import loop
Julesssss 227de27
remove Push notification dependency loop
Julesssss 4ac8a3d
Merge branch 'main' into jules-resolvePushNotificationDependencyLoop
Julesssss 007f60c
invoke PushNotification.init from outside module
Julesssss dd81bc2
Merge branch 'main' into jules-resolvePushNotificationDependencyLoop
Julesssss 465282a
revert notification type refactor
Julesssss 3e4d0ec
Merge branch 'main' into jules-resolvePushNotificationDependencyLoop
Julesssss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,6 @@ import {UrbanAirship, EventType, iOS} from 'urbanairship-react-native'; | |
import lodashGet from 'lodash/get'; | ||
import Log from '../../Log'; | ||
import NotificationType from './NotificationType'; | ||
import PushNotification from '.'; | ||
import * as Report from '../../actions/Report'; | ||
|
||
const notificationEventActionMap = {}; | ||
|
||
|
@@ -109,12 +107,6 @@ function register(accountID) { | |
// Regardless of the user's opt-in status, we still want to receive silent push notifications. | ||
Log.info(`[PUSH_NOTIFICATIONS] Subscribing to notifications for account ID ${accountID}`); | ||
UrbanAirship.setNamedUser(accountID.toString()); | ||
|
||
// When the user logged out and then logged in with a different account | ||
// while the app is still in background, we must resubscribe to the report | ||
// push notification in order to render the report click behaviour correctly | ||
Comment on lines
-113
to
-115
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 attempted to simplify this comment here |
||
PushNotification.init(); | ||
Report.subscribeToReportCommentPushNotifications(); | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 that this is actually called outside of the module, I think it makes sense to export it from the non-native file. But I'm not 100% sure it's necessary