Skip to content
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

Notification service for Android #737

Merged
merged 11 commits into from
Dec 18, 2023
Merged

Notification service for Android #737

merged 11 commits into from
Dec 18, 2023

Conversation

erdemyerebasmaz
Copy link
Collaborator

@roeierez Created a draft PR to make it easier to review progress.

Copy link
Member

@roeierez roeierez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skeleton looks good. I think it is ready to fill in with details.
Also I think since in contrary to iOS here we get silent push so perhaps we can raise a local notification at the end with the same message we do in iOS.

Copy link
Member

@roeierez roeierez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

android/app/build.gradle Outdated Show resolved Hide resolved
override fun onMessageReceived(remoteMessage: RemoteMessage) {
Log.d(TAG, "From: ${remoteMessage.from}")

// Check if message contains a data payload.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this logic in Breez mobile needed to still be able to handle notifications in flutter? https://github.com/breez/breezmobile/blob/master/android/app/src/main/java/com/breez/client/BreezFirebaseMessagingService.java#L48

return ForegroundInfo(
NOTIFICATION_ID_PAYMENT_RECEIVED,
createNotification(
"Incoming payment",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this showing during the payment? If so perhaps "Receiving payment..." ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is the initial message of notification. I was referencing iOS notification, we should change it there as well.

@erdemyerebasmaz erdemyerebasmaz force-pushed the android-notification branch 2 times, most recently from a4e0f56 to baedeed Compare December 16, 2023 00:21
@erdemyerebasmaz erdemyerebasmaz force-pushed the android-notification branch 5 times, most recently from fcfdcde to ee0e07e Compare December 18, 2023 11:43
@erdemyerebasmaz erdemyerebasmaz marked this pull request as ready for review December 18, 2023 11:43
erdemyerebasmaz and others added 8 commits December 18, 2023 14:44
- Handle notifications only if app is in the background or killed
- Create BreezNotificationService
  - Create separate notification for each paymentHash
  - Handle status notification separately
- Create JobManager
- Rename BreezFCMService to BreezFcmService
- Prevent running job for existing payment
- Read mnemonics from Keystore
  - Increase minSdkVersion to 24
- Use shared instance for BreezSdk
- Stop job after 1 minute
- Declare ndkVersion as flutter.ndkVersion
roeierez and others added 3 commits December 18, 2023 14:46
ctd. Remove Flutter implementation for background messages & workmanager
Set hydrated_bloc to fix 9.1.2 version due to a regression on 9.1.3
@erdemyerebasmaz erdemyerebasmaz merged commit 76c2df6 into main Dec 18, 2023
1 check passed
@erdemyerebasmaz erdemyerebasmaz deleted the android-notification branch December 19, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants