This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Support android shortcut badges on supported devices when app is closed #703
Closed
Conversation
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
@@ -23,7 +23,7 @@ | |||
<engines> | |||
<engine name="cordova" version=">=3.6.3" /> | |||
<engine name="cordova-android" version=">=4.0.0" /> | |||
<engine name="cordova-ios" version=">=4.0.0" /> | |||
<engine name="cordova-ios" version=">=3.9.2" /> |
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.
Nope, for version 1.6.0 and greater of this plugin we'll only support cordova-ios 4.0.0 or greater. Please revert line.
@yossale looks good but please make the required changes and squash your commits. |
PR #624 offers similar functionality, but also supports updating the badge from the javascript app itself. |
@@ -191,16 +192,32 @@ private Bundle normalizeExtras(Bundle extras) { | |||
return newExtras; | |||
} | |||
|
|||
private void updateBadge(Context context, String badge) { | |||
|
|||
int count = badge == null ? 0 : Integer.parseInt(badge); |
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.
This would make it impossible to keep the badge count unchanged (eg. when it's not set)
This thread has been automatically locked. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Update android shortcut badge even when app is closed (on supported devices - HTC, LG, Samsung)
Description
Adding android shortcut badges support. Similarly to the cordova-plugin-badge behaviour, only it works even when the app is closed, and updated from the Java, not the js.
Related Issue
"Notification" Event Not Firing When Closed Through App Launcher
Android badge count
Motivation and Context
Most major Android Launchers now support badges, which are a useful way to keep users engaged with one's app, specially when users are not visiting it too often. However, in the current situation, badges are only updated when the app is either in the foreground/background, which is usually not the case (Specially if your app is a "twice a week kind" of app)
How Has This Been Tested?
It has been tested on Samsung galaxy S5, HTC X9, and One Plus (which doesnt support badges, we tested to make sure nothing breaks in that case)
Screenshots (if appropriate):
Types of changes
Checklist: