-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from breez/android-notifications
android notifications docs
- Loading branch information
Showing
3 changed files
with
21 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
# Android: using foreground service | ||
For Android, the app is required to use a foreground service to process reliably notifications in the background. | ||
|
||
## Implementation steps | ||
#### 1. Integrate foreground service | ||
Add FirebaseMessagingService to your Android project. This service allows your app to process the incoming push notification. Then use the foreground service to process the notification in the background. | ||
#### 2. Wake-up the app | ||
When a push notification is received, the FirebaseMessagingService will be triggered, running the forground service. | ||
#### 3. Connect with Breez SDK | ||
In the foreground service, establish a connection with the Breez SDK to process the incoming payment. | ||
#### 4. Wait for payment completion | ||
Once connected, the app should wait for completion status from the Breez SDK that the payment has been received. | ||
#### 5. Display a notification | ||
After confirming the payment, display a notification. | ||
|
||
## Reference implementation | ||
For a complete reference, see how we implemented it in c-breez wallet: [BreezFcmService.kt](https://github.com/breez/c-breez/blob/main/android/app/src/main/kotlin/com/cBreez/client/BreezFcmService.kt). |
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