-
Notifications
You must be signed in to change notification settings - Fork 232
Open
Description
What happened?
Followed instructions here and created a .java file in com.package.name now I have 2 files there MainActivity.java And NotificationServiceExtension.java
<meta-data android:name="com.onesignal.NotificationServiceExtension"
android:value="com.bonfire.cdis.NotificationServiceExtension" />
Steps to reproduce?
Use flutter 3.4.2
Follow instructions here https://documentation.onesignal.com/docs/service-extensions#android-notification-service-extension
Run the app
What did you expect to happen?
Expected to successfully run the app and receive notification when app is in foreground or background.
OneSignal Flutter SDK version
3.4.2
Which platform(s) are affected?
- iOS
- Android
Relevant log output
Launching lib\main.dart on sdk gphone x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:24: error: cannot find symbol
builder.setColor(new BigInteger("FF00FF00", 16).intValue());
^
symbol: class BigInteger
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:26: error: cannot find symbol
Spannable spannableTitle = new SpannableString(notification.getTitle());
^
symbol: class Spannable
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:26: error: cannot find symbol
Spannable spannableTitle = new SpannableString(notification.getTitle());
^
symbol: class SpannableString
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:27: error: cannot find symbol
spannableTitle.setSpan(new ForegroundColorSpan(Color.RED),0,notification.getTitle().length(),0);
^
symbol: class ForegroundColorSpan
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:27: error: cannot find symbol
spannableTitle.setSpan(new ForegroundColorSpan(Color.RED),0,notification.getTitle().length(),0);
^
symbol: variable Color
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:30: error: cannot find symbol
Spannable spannableBody = new SpannableString(notification.getBody());
^
symbol: class Spannable
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:30: error: cannot find symbol
Spannable spannableBody = new SpannableString(notification.getBody());
^
symbol: class SpannableString
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:31: error: cannot find symbol
spannableBody.setSpan(new ForegroundColorSpan(Color.BLUE),0,notification.getBody().length(),0);
^
symbol: class ForegroundColorSpan
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:31: error: cannot find symbol
spannableBody.setSpan(new ForegroundColorSpan(Color.BLUE),0,notification.getBody().length(),0);
^
symbol: variable Color
location: class NotificationServiceExtension
9 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7s
Exception: Gradle task assembleDebug failed with exit code 1
Code of Conduct
- I agree to follow this project's Code of Conduct
bugrevealingbme
Metadata
Metadata
Assignees
Labels
No labels