You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature description:
I am using the following code in xamarin.forms page to send notification
CrossLocalNotifications.Current.Show("title", "body");
it is working fine. But in the body, if I have long text how to show?.
In a few places, I found that use the following code in the main activity of the Android project
String longText = "...";
Notification noti = new Notification.Builder(this).
.setStyle(new Notification.BigTextStyle().bigText(longText))
but NotificationBuilder class doesn't supports in xamarin.forms project.
How should I set this from xamarin.forms project?. Please help me out
This whould be a Feature Request, were you want that the plugin is changing the Notification Style when your text is to long.
This needs to be done directly in the plugin and no in your Xamarin.Forms project.
@DoktorAerzt , maybe 4 or 5 lines I need to show in the notification. can i achieve my requirement by using BigTextStyle(). If yes how and where I need to set? my requirement like
Hi @DoktorAerzt , following code will work. I am not understanding how to do pull request. can u add the following code at line number 33
please do help
if(body.Length > 30)
{
builder.SetStyle(new NotificationCompat.BigTextStyle().BigText(body));
}
HI @edsnider please look into this just one line of code we need to change here
builder.SetStyle(new Notification.BigTextStyle().BigText(body));
and update package from 23 to 28
please do consider this
Activity
DoktorAerzt commentedon Mar 6, 2019
This whould be a Feature Request, were you want that the plugin is changing the Notification Style when your text is to long.
This needs to be done directly in the plugin and no in your Xamarin.Forms project.
sagarmp02 commentedon Mar 6, 2019
Thank u for your reply @DoktorAerzt . Authors, please look into this request
DoktorAerzt commentedon Mar 6, 2019
The point is, how long needs the long text to be that the normal notification is to small and that you need BigTextStyle() ?
sagarmp02 commentedon Mar 6, 2019
@DoktorAerzt , maybe 4 or 5 lines I need to show in the notification. can i achieve my requirement by using BigTextStyle(). If yes how and where I need to set? my requirement like

DoktorAerzt commentedon Mar 6, 2019
I never worked with BigTextStyle() so i don´t know if this will help you or if this is what you need. But you need to add a check at this line https://github.com/edsnider/localnotificationsplugin/blob/master/src/Plugin.LocalNotifications.Android/LocalNotificationsImplementation.cs#L33 and then if the body is greater/longer than let´s say 30 Chars then you need to use the BigTextStyle()
I don´t have the time to test this out and to make this changes.
After you make this changes you need to make an pull request.
sagarmp02 commentedon Mar 6, 2019
Hi @DoktorAerzt , following code will work. I am not understanding how to do pull request. can u add the following code at line number 33
please do help
if(body.Length > 30)
{
builder.SetStyle(new NotificationCompat.BigTextStyle().BigText(body));
}
sagarmp02 commentedon Mar 8, 2019
HI @edsnider please look into this just one line of code we need to change here
builder.SetStyle(new Notification.BigTextStyle().BigText(body));
and update package from 23 to 28
please do consider this