Closed callmejm closed 3 years ago
Hi @callmejm. We'd be glad to assist.
Is your icon showing up in greyscale, or simply a grey box? Please see this for a solution: https://clevertap.com/blog/fixing-notification-icon-for-android-lollipop-and-above/
the icon I put inside mipmap is png format, but still same, a grey box
On Fri, 7 May 2021 at 10:37, Pushy @.***> wrote:
Hi @callmejm https://github.com/callmejm. We'd be glad to assist.
Is your icon showing up in greyscale, or simply a grey box? Please see this for a solution:
https://clevertap.com/blog/fixing-notification-icon-for-android-lollipop-and-above/
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pushy-me/pushy-flutter/issues/30#issuecomment-834016397, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVCTXMX4FQLFHXBXQOWSC3TMNG6BANCNFSM44IPHNAA .
Hi @callmejm, Basically, that's happening because your notification icon is not transparent.
Please read the article again as it explains this very clearly: https://clevertap.com/blog/fixing-notification-icon-for-android-lollipop-and-above/
You must modify your notification icon to be fully transparent, with the visible logo in white pixels.
The Android system ignores all non-alpha channels in action icons and in the main notification icon. You should assume that these icons will be alpha-only. The system draws notification icons in white and action icons in dark gray.
how to show ios notification on foreground instead of alert? I have added this code on AppDelegate.swift
if #available(iOS 10.0, *) { UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate }
On Fri, 7 May 2021 at 10:54, Pushy @.***> wrote:
Closed #30 https://github.com/pushy-me/pushy-flutter/issues/30.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pushy-me/pushy-flutter/issues/30#event-4699058335, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVCTXOT4KEH76T3DGENBNDTMNI5VANCNFSM44IPHNAA .
Hi @callmejm,
1) For in-app iOS 10+ notification banners, please also add this method override to your AppDelegate.swift
:
// Display in-app notification banners (iOS 10+) and invoke notification handler
@available(iOS 10.0, *)
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
// Call the notification handler, if defined
Pushy.shared?.notificationHandler?(notification.request.content.userInfo, {(UIBackgroundFetchResult) in})
// Show in-app banner (no sound or badge)
completionHandler([.alert])
}
2) Import the Pushy iOS SDK
and UserNotifications
by adding the following to the top of AppDelegate.swift
:
import Pushy
import UserNotifications
3) Your AppDelegate
class will need to inherit UNUserNotificationCenterDelegate
.
@pushy-me the grey out issue still exist, I already follow the instructions to generate the icon, but the icon still grey box. I have put icon into all mipmap folder and named ic_notification
Hi @callmejm,
- For in-app iOS 10+ notification banners, please also add this method override to your
AppDelegate.swift
:// Display in-app notification banners (iOS 10+) and invoke notification handler @available(iOS 10.0, *) func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { // Call the notification handler, if defined Pushy.shared?.notificationHandler?(notification.request.content.userInfo, {(UIBackgroundFetchResult) in}) // Show in-app banner (no sound or badge) completionHandler([.alert]) }
- Import the
Pushy iOS SDK
andUserNotifications
by adding the following to the top ofAppDelegate.swift
:import Pushy import UserNotifications
- Your
AppDelegate
class will need to inheritUNUserNotificationCenterDelegate
.
cant import Pushy , getting No such module 'Pushy'
Hi @callmejm, In Objective-C (Flutter iOS), please import Pushy as follows:
@import Pushy
Please let us know if it works.
I have set
Pushy.setNotificationIcon('ic_notification');
afterPushy.listen();
and put all ic_notification.png to all mipmap folder , but the notification is still grey out.