@@ -35,26 +35,6 @@ public void Initialize()
35
35
Instance = this ;
36
36
}
37
37
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
-
58
38
public void SendNotification ( string title , string message , DateTime ? notifyTime = null )
59
39
{
60
40
if ( ! channelInitialized )
@@ -89,6 +69,26 @@ public void ReceiveNotification(string title, string message)
89
69
NotificationReceived ? . Invoke ( null , args ) ;
90
70
}
91
71
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
+
92
92
void CreateNotificationChannel ( )
93
93
{
94
94
manager = ( NotificationManager ) AndroidApp . Context . GetSystemService ( AndroidApp . NotificationService ) ;
0 commit comments