@@ -35,26 +35,6 @@ public void Initialize()
3535 Instance = this ;
3636 }
3737
38- public void Show ( string title , string message )
39- {
40- Intent intent = new Intent ( AndroidApp . Context , typeof ( MainActivity ) ) ;
41- intent . PutExtra ( TitleKey , title ) ;
42- intent . PutExtra ( MessageKey , message ) ;
43-
44- PendingIntent pendingIntent = PendingIntent . GetActivity ( AndroidApp . Context , pendingIntentId ++ , intent , PendingIntentFlags . UpdateCurrent ) ;
45-
46- NotificationCompat . Builder builder = new NotificationCompat . Builder ( AndroidApp . Context , channelId )
47- . SetContentIntent ( pendingIntent )
48- . SetContentTitle ( title )
49- . SetContentText ( message )
50- . SetLargeIcon ( BitmapFactory . DecodeResource ( AndroidApp . Context . Resources , Resource . Drawable . xamagonBlue ) )
51- . SetSmallIcon ( Resource . Drawable . xamagonBlue )
52- . SetDefaults ( ( int ) NotificationDefaults . Sound | ( int ) NotificationDefaults . Vibrate ) ;
53-
54- Notification notification = builder . Build ( ) ;
55- manager . Notify ( messageId ++ , notification ) ;
56- }
57-
5838 public void SendNotification ( string title , string message , DateTime ? notifyTime = null )
5939 {
6040 if ( ! channelInitialized )
@@ -89,6 +69,26 @@ public void ReceiveNotification(string title, string message)
8969 NotificationReceived ? . Invoke ( null , args ) ;
9070 }
9171
72+ public void Show ( string title , string message )
73+ {
74+ Intent intent = new Intent ( AndroidApp . Context , typeof ( MainActivity ) ) ;
75+ intent . PutExtra ( TitleKey , title ) ;
76+ intent . PutExtra ( MessageKey , message ) ;
77+
78+ PendingIntent pendingIntent = PendingIntent . GetActivity ( AndroidApp . Context , pendingIntentId ++ , intent , PendingIntentFlags . UpdateCurrent ) ;
79+
80+ NotificationCompat . Builder builder = new NotificationCompat . Builder ( AndroidApp . Context , channelId )
81+ . SetContentIntent ( pendingIntent )
82+ . SetContentTitle ( title )
83+ . SetContentText ( message )
84+ . SetLargeIcon ( BitmapFactory . DecodeResource ( AndroidApp . Context . Resources , Resource . Drawable . xamagonBlue ) )
85+ . SetSmallIcon ( Resource . Drawable . xamagonBlue )
86+ . SetDefaults ( ( int ) NotificationDefaults . Sound | ( int ) NotificationDefaults . Vibrate ) ;
87+
88+ Notification notification = builder . Build ( ) ;
89+ manager . Notify ( messageId ++ , notification ) ;
90+ }
91+
9292 void CreateNotificationChannel ( )
9393 {
9494 manager = ( NotificationManager ) AndroidApp . Context . GetSystemService ( AndroidApp . NotificationService ) ;
0 commit comments