mirror of
https://github.com/KeymonSoft/Guna_Preventa.git
synced 2026-04-17 21:06:32 +00:00
- VERSION 5.02.05
- Se cambio el timer del envio de la ubicacion a 300 seg (5 minutos)
This commit is contained in:
@@ -5238,6 +5238,57 @@ Sub EnviarPDFWhatsAppNumero(NumeroTelefono As String)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub EnviarPDFWhatsAppNumero2(NumeroTelefono As String)
|
||||
If NumeroTelefono.Length = 10 Then NumeroTelefono = "521" & NumeroTelefono ' Agregamos el 521 si es que falta.
|
||||
' Ruta del archivo PDF
|
||||
Dim RutaArchivo As String = Starter.fFileProvider.SharedFolder & "/" & archivoTicketPDF
|
||||
Log(RutaArchivo)
|
||||
|
||||
' Verificar si el archivo existe
|
||||
If File.Exists(Starter.fFileProvider.SharedFolder, archivoTicketPDF) Then
|
||||
' Paso 1: Abrir WhatsApp con el número específico
|
||||
Dim UriWhatsApp As String = "https://wa.me/" & NumeroTelefono
|
||||
Dim IntentWhatsApp As Intent
|
||||
IntentWhatsApp.Initialize(IntentWhatsApp.ACTION_VIEW, UriWhatsApp)
|
||||
|
||||
' Verificar si WhatsApp está instalado
|
||||
' If IntentWhatsApp.ResolveActivity(PackageManager) Is Nothing Then
|
||||
' ToastMessageShow("WhatsApp no está instalado.", True)
|
||||
' Return
|
||||
' End If
|
||||
|
||||
' Iniciar el Intent para abrir WhatsApp
|
||||
StartActivity(IntentWhatsApp)
|
||||
|
||||
' Paso 2: Mostrar un mensaje para compartir el archivo manualmente
|
||||
ToastMessageShow("Por favor, comparte el archivo manualmente en WhatsApp.", True)
|
||||
|
||||
' Esperar un momento para que WhatsApp se abra
|
||||
Sleep(3000)
|
||||
|
||||
' Paso 3: Compartir el archivo desde tu aplicación
|
||||
Dim Uri0 As Object = Starter.fFileProvider.GetFileUri(archivoTicketPDF)
|
||||
|
||||
' Crear un Intent para compartir el archivo
|
||||
Dim Intent1 As Intent
|
||||
Intent1.Initialize(Intent1.ACTION_SEND, "")
|
||||
|
||||
' Establecer el tipo MIME del archivo (PDF)
|
||||
Intent1.SetType("application/pdf")
|
||||
|
||||
' Agregar el URI del archivo al Intent
|
||||
Intent1.PutExtra("android.intent.extra.STREAM", Uri0)
|
||||
|
||||
' Establecer permisos de lectura para la aplicación que recibe el archivo
|
||||
Intent1.Flags = 1 ' FLAG_GRANT_READ_URI_PERMISSION
|
||||
|
||||
' Iniciar el Intent para compartir el archivo
|
||||
StartActivity(Intent1)
|
||||
Else
|
||||
ToastMessageShow("El archivo PDF no existe.", True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub b_envioPDF_Click
|
||||
PDFGENERAR
|
||||
EnviarPDFWhatsAppNumero(et_numeroPDF.Text)
|
||||
|
||||
@@ -77,11 +77,11 @@ ModuleClosedNodes26=
|
||||
ModuleClosedNodes27=
|
||||
ModuleClosedNodes3=
|
||||
ModuleClosedNodes4=5,8,9,10,11,12,13
|
||||
ModuleClosedNodes5=175,176,177,180,181
|
||||
ModuleClosedNodes5=175,176,177,180
|
||||
ModuleClosedNodes6=
|
||||
ModuleClosedNodes7=5,6,8,9,10,11
|
||||
ModuleClosedNodes8=
|
||||
ModuleClosedNodes9=
|
||||
NavigationStack=C_Cliente,Class_Globals,109,0,C_Cliente,b_enviarTicket_Click,5162,0,C_Cliente,b_geopass_Click,1188,0,C_Cliente,Guardar_Click,2140,0,C_Cliente,Impresion2,2299,0,C_Cliente,Impresion,2501,0,C_Cliente,B_GUARDA_C_Click,2784,0,C_Cliente,b_codigoAutorizacion_Click,4934,0,C_Cliente,b_envioPDF_Click,5242,6,C_Cliente,JobDone,1281,6
|
||||
NavigationStack=C_Cliente,B_GUARDA_C_Click,2784,0,C_Cliente,b_codigoAutorizacion_Click,4934,0,Main,Process_Globals,18,0,B4XMainPage,B4XPage_Created,170,0,C_Cliente,enviaTicket,5194,0,Starter,Application_Error,138,0,Starter,Process_Globals,18,0,C_Cliente,EnviarPDFWhatsAppNumero2,5196,0,C_Cliente,EnviarPDFWhatsAppNumero,5196,0
|
||||
SelectedBuild=0
|
||||
VisibleModules=25,2,14,26,5,10,15,20,4
|
||||
|
||||
@@ -22,7 +22,7 @@ Sub Process_Globals
|
||||
Dim server As String = "http://187.189.244.154:1782"
|
||||
' Dim server As String = "http://10.0.0.205:1782"
|
||||
Dim Timer1 As Timer
|
||||
Dim Interval As Int = 10
|
||||
Dim Interval As Int = 300
|
||||
Dim ruta As String = File.DirInternal
|
||||
'Para los Logs
|
||||
Private logs As StringBuilder
|
||||
|
||||
Reference in New Issue
Block a user