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

[Bug]: onNotificationReceived not work for me #2177

Open
1 task done
S00raj-hcbs opened this issue Aug 16, 2024 · 1 comment
Open
1 task done

[Bug]: onNotificationReceived not work for me #2177

S00raj-hcbs opened this issue Aug 16, 2024 · 1 comment

Comments

@S00raj-hcbs
Copy link

S00raj-hcbs commented Aug 16, 2024

What happened?

@keep
public class MyNotificationExtenderService implements INotificationServiceExtension {

@Override
public void onNotificationReceived(INotificationReceivedEvent event) {
    IDisplayableMutableNotification notification = event.getNotification();
    if (notification.getActionButtons() != null) {
        for (IActionButton button : notification.getActionButtons()) {
            // you can modify your action buttons here
            Log.d("OneSignalDebug", button.getText());
            Log.d("OneSignalDebug", button.getIcon());
            Log.d("OneSignalDebug", button.getId());
        }
    }
    notification.setExtender(builder -> builder.setColor(0xFF0000FF)); }}

Steps to reproduce?

i want notification app is killed or background.

What did you expect to happen?

i have use this code but not get any value when app is kill or background mode.

OneSignal Android SDK version

5.1.17 to 5.1.20

Android version

14

Specific Android models

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jinliu9508
Copy link
Contributor

Hello @S00raj-hcbs, have you modified the manifest as this documentation suggests? Be sure to use the fully name spaced class when you do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants