-
Notifications
You must be signed in to change notification settings - Fork 1
Notification Styles
levching edited this page Apr 15, 2020
·
3 revisions
A basic notification usually includes a title, a line of text, and one or more actions the user can perform in response. To provide even more information, you can also create large, expandable notifications by applying one of several notification templates as described on this page.
To add an image in your notification, pass an instance of AN_NotificationCompat.BigPictureStyle to SetStyle().
using SA.Android.App;
using SA.Android.SupportV4.App;
...
var builder = new AN_NotificationCompat.Builder();
builder.SetContentText("BigPictureStyle");
builder.SetContentTitle("BigPictureStyle title");
var bigPictureStyle = new AN_NotificationCompat.BigPictureStyle();
Texture2D bigPicture = GetBigPicture();
Texture2D largeIcon = BigLargeIcon();
bigPictureStyle.BigPicture(bigPicture);
bigPictureStyle.BigLargeIcon(largeIcon);
builder.SetStyle(bigPictureStyle);
builder.SetDefaults(AN_Notification.DEFAULT_ALL);
Apply AN_NotificationCompat.BigTextStyle to display text in the expanded content area of the notification:
using SA.Android.App;
using SA.Android.SupportV4.App;
...
var builder = new AN_NotificationCompat.Builder();
builder.SetContentText("BigTextStyle");
builder.SetContentTitle("BigTextStyle Title");
var bigTextStyle = new AN_NotificationCompat.BigTextStyle();
bigTextStyle.BigText("This is test big text style");
builder.SetStyle(bigTextStyle);
builder.SetDefaults(AN_Notification.DEFAULT_ALL);
Reliable and high-quality Unity Development service. Let's Talk!
Website | AssetStore | LinkedIn | Youtube | Scripting Reference
- Build Info
- Dark Mode
- Package Info
- Runtime Permissions
- Run External App
- Immersive Mode
- PackageManager
- Popups & Preloaders
- Rate Us Dialog
- Activity
- Intent
- Settings Page
- Media Player
- Date Picker Dialog
- Time Picker Dialog
- Locale
- Wheel Picker Dialog
- Developer Console Setup
- Connecting to The Service
- Purchase Flow
- Transactions Validation
- Subscriptions
- Licensing
- Getting Started
- Games Sing-in
- Server-side API Access
- Leaderboards
- Achievements
- Saved Games
- Image Manager
- Settings Intent