- VERSION 5.02.05

- Se cambio el timer del envio de la ubicacion a 300 seg (5 minutos)
This commit is contained in:
2025-02-12 12:49:07 -06:00
parent e27e841cbb
commit cf93616b4b
3 changed files with 54 additions and 3 deletions

View File

@@ -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)