Sub Process_Globals
Private buddy As BroadcastBuddy
End Sub
Sub AppStart (Args() As String)
Dim apiKey As String = "bb_live_YOUR_API_KEY"
buddy.Initialize(apiKey)
' 1. Check live hotline status
Wait For (buddy.SessionStatus) Complete (statusRes As Map)
Log("Hotline Status: " & statusRes)
' 2. Verify recipient number on WhatsApp
Wait For (buddy.IsOnWhatsApp("233240001122")) Complete (checkRes As Map)
Log("Is on WhatsApp: " & checkRes.Get("exists"))
' 3. Send a text message
Wait For (buddy.SendMessage("233240001122", "🚀 Hello from BroadcastBuddy B4X Library!")) Complete (msgRes As Map)
Log("Message Sent: " & msgRes.Get("success"))
' 4. Send an interactive multi-choice poll
Dim pollOptions As List
pollOptions.Initialize
pollOptions.Add("Option A: B4A Mobile")
pollOptions.Add("Option B: B4J Server")
pollOptions.Add("Option C: B4i iOS")
Wait For (buddy.SendPoll("233240001122", "Which B4X platform do you use most?", pollOptions, False)) Complete (pollRes As Map)
Log("Poll Sent: " & pollRes.Get("success"))
' 5. Send an image with caption
Wait For (buddy.SendImage("233240001122", "https://example.com/receipt.png", "Your Payment Receipt #1092", "receipt.png")) Complete (imgRes As Map)
Log("Image Sent: " & imgRes.Get("success"))
' 6. Send a PDF invoice
Wait For (buddy.SendDocument("233240001122", "https://example.com/invoice.pdf", "Invoice_2026.pdf", "Your monthly invoice")) Complete (docRes As Map)
Log("Document Sent: " & docRes.Get("success"))
End Sub