-
Notifications
You must be signed in to change notification settings - Fork 68
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
Implementation of full screen intent #458
Comments
@thudugala, I managed to make this work by using native notifications. However, I would like to rely fully on your library as there's some functionality I needed. How can I send an example to further assist you? Thanks! |
@echolumaque you can do a PR with your change? |
I'm not that well versed with the your library's code and it would definitely took me a long time to understand it. Perhaps a blank project would work? |
Sure just attach a sample project here 🙂 |
@thudugala, you can clone this project and let me know if you have any questions: https://github.com/echolumaque/FullScreenIntentNotification Relevant files:
On MainActivity, you can see these code: protected override void OnCreate(Bundle? savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetShowWhenLocked(true);
SetTurnScreenOn(true);
} I believe it is necessary to wake the device and actually show the activity. More context here: https://stackoverflow.com/a/69314329/13061894. Also, I believe ShowForAllUsers must be set to true in the Activity attribute. These permissions are also required: <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" /> Attached video is how it works: To replicate:
|
@echolumaque try version 11.0.1-preview01 Make sure to set LaunchApp var request = new NotificationRequest
{
NotificationId = notificationId,
Title = title,
Android =
{
LaunchApp = new AndroidLaunch(),
}
} |
@thudugala, I've tried your instructions and unfortunately, it only just sent the notification on the status bar 😢. Tested both in simulator (Pixel 3a XL - Android 12), and physical device (Samsung Galaxy A71 - Android 12). Here's my notification create code: [ConfigureAwait(false)]
public async Task ScheduleNotification(string description, DateTime notifiyTime)
{
var randomIndex = Random.Shared.Next(14);
var notificationIcon = new AndroidIcon { ResourceName = "notif_icon" };
var notificationRequest = new NotificationRequest
{
Android = new AndroidOptions
{
ChannelId = "com.group10.healthmate",
IconLargeName = notificationIcon,
IconSmallName = notificationIcon,
IsGroupSummary = true,
LaunchApp = new AndroidLaunch(),
Priority = AndroidPriority.Max,
VibrationPattern = [200, 300, 200, 300, 200, 300],
VisibilityType = AndroidVisibilityType.Public
},
CategoryType = NotificationCategoryType.Alarm,
Description = description,
Group = "com.group10.healthmate",
//Image = new NotificationImage
//{
// FilePath
//},
NotificationId = Guid.NewGuid().GetHashCode(),
Schedule = new NotificationRequestSchedule
{
Android = new AndroidScheduleOptions
{
AlarmType = AndroidAlarmType.RtcWakeup,
},
NotifyTime = notifiyTime,
RepeatType = NotificationRepeat.No
},
Subtitle = notificationSubtitles[randomIndex],
Title = notificationTitles[randomIndex]
};
await _notificationService.Show(notificationRequest);
} Please let me know if there's help that I can do. Thanks again. |
@echolumaque hey can attach the full project sample? |
@thudugala , hello sorry for the late reply. The project is still the same (https://github.com/echolumaque/FullScreenIntentNotification). I just pushed the changes so you can try it out. Please take a pull and let me know if how can I be of help. Thanks again! |
@echolumaque Check my last commit: https://github.com/pkozak2/FullScreenIntentNotification |
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: