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

error: cannot find symbol notificationBuilder.addAction #83

Open
nilaybrahmbhatt opened this issue Jan 5, 2024 · 1 comment
Open

error: cannot find symbol notificationBuilder.addAction #83

nilaybrahmbhatt opened this issue Jan 5, 2024 · 1 comment

Comments

@nilaybrahmbhatt
Copy link

I got this error in latest react native version 0.73.1.

Screenshot 2024-01-05 at 6 43 44 PM
@BhavyaCodeAlchemy
Copy link

I got same error in latest react native version 0.73.2

- Solution :

Open the NotificationHelper.java file located at node_modules/@supersami/rn-foreground-service/android/src/main/java/com/supersami/foregroundservice/NotificationHelper.java.

- Locate the following two lines :

notificationBuilder.addAction(R.drawable.redbox_top_border_background, bundle.getString("buttonText", "Button"), pendingBtnIntent);

notificationBuilder.addAction(R.drawable.redbox_top_border_background, bundle.getString("button2Text", "Button"), pendingBtn2Intent);

- Replace them with :

notificationBuilder.addAction(com.facebook.react.R.drawable.redbox_top_border_background, bundle.getString("buttonText", "Button"), pendingBtnIntent);

notificationBuilder.addAction(com.facebook.react.R.drawable.redbox_top_border_background, bundle.getString("button2Text", "Button"), pendingBtn2Intent);

- Open package.json and add the following line to the "scripts" section :

"scripts": {
"postinstall": "patch-package" // <--- Add
}

- Install the patch-package library :

npm i patch-package

- After the installation is complete, run the following command to apply the patch :

npx patch-package @supersami/rn-foreground-service

"This issue has been resolved in my case."

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

No branches or pull requests

2 participants