Skip to content

Commit

Permalink
(Android): Don't display app icon for large notification icon on Andr…
Browse files Browse the repository at this point in the history
…oid. Resolves #343.
  • Loading branch information
dpa99c committed Mar 16, 2020
1 parent 432126d commit accf88e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* (Android): Don't display app icon for large notification icon on Android. Resolves [#343](https://github.com/dpa99c/cordova-plugin-firebasex/issues/343).

# Version 9.0.1-cli
* Document `cli_build` branch.
* *BREAKING CHANGE*: Remove Firebase Inapp Messaging and Google Tag Manager SDK components due to causing Cordova CLI build issues.
Expand Down
19 changes: 9 additions & 10 deletions src/android/FirebasePluginMessagingService.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,17 +287,16 @@ private void sendMessage(RemoteMessage remoteMessage, Map<String, String> data,
}

int largeIconResID;
if (customLargeIconResID != 0) {
largeIconResID = customLargeIconResID;
Log.d(TAG, "Large icon: custom="+icon);
}else if (defaultLargeIconResID != 0) {
Log.d(TAG, "Large icon: default="+defaultLargeIconName);
largeIconResID = defaultLargeIconResID;
} else {
Log.d(TAG, "Large icon: application");
largeIconResID = getApplicationInfo().icon;
if (customLargeIconResID != 0 || defaultLargeIconResID != 0) {
if (customLargeIconResID != 0) {
largeIconResID = customLargeIconResID;
Log.d(TAG, "Large icon: custom="+icon);
}else{
Log.d(TAG, "Large icon: default="+defaultLargeIconName);
largeIconResID = defaultLargeIconResID;
}
notificationBuilder.setLargeIcon(BitmapFactory.decodeResource(getApplicationContext().getResources(), largeIconResID));
}
notificationBuilder.setLargeIcon(BitmapFactory.decodeResource(getApplicationContext().getResources(), largeIconResID));
}

// Color
Expand Down

0 comments on commit accf88e

Please sign in to comment.