I am trying to show a notificaction using two action buttons with NB6 library and Myreceiver module but when I compile, I get an error. ¿Some idea?
My code in Firebasemessaging when I received a notification:
Module Myreceiver
Thanks.
B4A:
B4A Versión: 11.80
Parseando código. (0.15s)
Java Versión: 11
Building folders structure. (0.13s)
Compilando código. (1.07s)
Compilado códigos de diseños. (0.00s)
Organizando librerías. (0.00s)
(AndroidX SDK)
Compilando los recursos (0.14s)
Enlazando los recursos (0.56s)
Compilando el código del motor de depuración. Error
B4A line: 58
n.AddButtonAction(SMILEY, \
shell\src\b4a\accesscontrol\firebasemessaging_subs_0.java:61: error: cannot find symbol
_n.runClassMethod (b4a.accesscontrol.nb6.class, "_addbuttonaction" /*RemoteObject*/ ,(Object)(_smiley),(Object)(RemoteObject.createImmutable(("Action 1"))),(Object)((firebasemessaging.mostCurrent._myreceiver.getObject())),(Object)(RemoteObject.createImmutable("action 1")));
^
symbol: method getObject()
location: variable _myreceiver of type myreceiver
1 error
My code in Firebasemessaging when I received a notification:
B4X:
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ${Message.GetData}"$)
Dim n As NB6
Dim SMILEY As Bitmap
SMILEY=LoadBitmap(File.DirAssets,"ICONO.png")
n.Initialize("default", Application.LabelName, "DEFAULT").SmallIcon(SMILEY)
n.AddButtonAction(SMILEY, "Action 1", MyReceiver, "action 1")
Dim cs As CSBuilder
n.AddButtonAction(Null, cs.Initialize.Color(Colors.Red).Bold.Append("Action 2").PopAll, MyReceiver, "action 2")
n.DeleteAction(MyReceiver, "delete action")
n.Build("Actions", "Actions", "tag", Main).Notify(1)
End Sub
Module Myreceiver
B4X:
Sub Process_Globals
End Sub
'Called when an intent is received.
'Do not assume that anything else, including the starter service, has run before this method.
Private Sub Receiver_Receive (FirstTime As Boolean, StartingIntent As Intent)
If StartingIntent.IsInitialized Then
Dim cs As CSBuilder
cs.Initialize.Bold.Size(20).Append($"Action: ${StartingIntent.Action}"$).PopAll
Log(cs)
ToastMessageShow(cs, True)
End If
End Sub
Thanks.