Sub fm_MessageArrived (Message As RemoteMessage)
provider.Initialize
DownloadAndSaveJPG("https://www.xxxxxxxxxxxx.net/notifichestudio/" & Main.manager.GetString("utente") & "/dentista4.png")
testotitle=Message.GetData.Get("title")
testobody=Message.GetData.Get("body")
testonote=Message.GetData.Get("notedomani")
appoimage=Message.GetData.Get("image")
ToastMessageShow(Message.GetData.Get("image"),False)
'Sleep(2000)
'Spostato in jobdone
'BigPicture_Notification
End Sub
Sub BigPicture_Notification
Dim n As NB6
smiley = LoadBitmapResize(File.DirAssets, "smiley2.png", 24dip, 24dip, False)
n.Initialize("custom sound", Application.LabelName, "DEFAULT").SmallIcon(smiley)
Dim FileName As String = "tada.mp3"
File.Copy(File.DirAssets, FileName, provider.SharedFolder, FileName)
Dim in As Intent
in.Initialize(in.ACTION_VIEW, "")
provider.SetFileUriAsIntentData(in, FileName)
n.SmallIcon(LoadBitmapResize(File.DirAssets, "smiley.png", 32dip, 32dip, True))
'disable the default sound
n.SetDefaults(False, True, True)
'set custom sound
n.CustomSound(provider.GetFileUri(FileName))
Dim b As Bitmap = LoadBitmap(File.DirInternal, "dentista4.png")
n.BigPictureStyle(b.Resize(256dip, 256dip, True), b, testotitle, testobody)
n.Color(0xFF00AEFF)
n.AddButtonAction(smiley, "Note di domani", MyReceiver2, "note")
Dim cs As CSBuilder
n.AddButtonAction(smiley, cs.Initialize.Color(Colors.Red).Bold.Append("Altre informazioni...").PopAll, MyReceiver2, "altro")
Dim Notification As Notification = n.Build(testotitle, testobody, "tag", Main)
Notification.Notify(3)
End Sub
Sub DownloadAndSaveJPG (Link2 As String)
Dim j As HttpJob
j.Initialize("", Me)
j.Download(Link2)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Dim out As OutputStream = File.OpenOutput(File.DirInternal, "dentista4.png", False)
File.Copy2(j.GetInputStream, out)
out.Close '<------ very important
ProgressDialogHide
'ToastMessageShow("DOWNLOAD",True)
BigPicture_Notification
End If
j.Release
End Sub