AlpVir Well-Known Member Licensed User Longtime User Jun 15, 2024 #1 How to send the same WhatsApp message to 3 or 4 different contacts registered in a SQLite archive? The following code sends only one message and forgets the others. [CODE lang="b4x" ] TxtWA="Lorem ipsum dolor sit amet, consectetur adipisci elit, sed do eiusmod" rs=db.ExecQuery ("SELECT * FROM ....") For i=0 To rs.RowCount-1 rs.Position=i Dim Intent1 As Intent Intent1.Initialize(Intent1.ACTION_VIEW, "https://api.whatsapp.com/send?phone=" & rs.GetString("Telefono") & "&text=" & TxtWA ) Intent1.SetComponent("android/com.android.internal.app.ResolverActivity") StartActivity(Intent1) Next rs.close[/CODE]
How to send the same WhatsApp message to 3 or 4 different contacts registered in a SQLite archive? The following code sends only one message and forgets the others. [CODE lang="b4x" ] TxtWA="Lorem ipsum dolor sit amet, consectetur adipisci elit, sed do eiusmod" rs=db.ExecQuery ("SELECT * FROM ....") For i=0 To rs.RowCount-1 rs.Position=i Dim Intent1 As Intent Intent1.Initialize(Intent1.ACTION_VIEW, "https://api.whatsapp.com/send?phone=" & rs.GetString("Telefono") & "&text=" & TxtWA ) Intent1.SetComponent("android/com.android.internal.app.ResolverActivity") StartActivity(Intent1) Next rs.close[/CODE]
Alexander Stolte Expert Licensed User Longtime User Jun 15, 2024 #2 It's not possible. You can only send one message to one contact per api call. You have to wait until the user is back in the app to send the next message to whatsapp Upvote 0
It's not possible. You can only send one message to one contact per api call. You have to wait until the user is back in the app to send the next message to whatsapp
AlpVir Well-Known Member Licensed User Longtime User Jun 15, 2024 #3 It is a pity. According to what you say it should be possible: 1) set the parameters for the first call 2) enter WhatsApp 3) press the WhatApp send button 4) exit WhatsApp (important) 5) set the parameters for the second call 6) enter into WhatsApp again 7) press the WhatApp send button 8) etc. etc. I would also be willing to adopt such a solution, however cumbersome. In fact, I'm surprised that the code I posted doesn't already do what I described. Upvote 0
It is a pity. According to what you say it should be possible: 1) set the parameters for the first call 2) enter WhatsApp 3) press the WhatApp send button 4) exit WhatsApp (important) 5) set the parameters for the second call 6) enter into WhatsApp again 7) press the WhatApp send button 8) etc. etc. I would also be willing to adopt such a solution, however cumbersome. In fact, I'm surprised that the code I posted doesn't already do what I described.
Mariano Ismael Castro Active Member Licensed User Longtime User Jun 15, 2024 #4 Affordable WhatsApp API for Messaging Campaigns | GREEN-API Service 🟢 Get an Alternative and Budget-Friendly Access to WhatsApp API 💡 🚀 GREEN-API Service — seamless WhatsApp integration with any programming language: PHP, JavaScript, 1C, Python, Java, C#, VBA. green-api.com You can take a look at that API, use WhatsApp Web to send messages and other things. [B4X] GreenApi - WhatsApp API Green API is a platform that allows you to send and receive WhatsApp messages through a stable API. 1. It is possible to send and receive text, photos and videos without the need to purchase and monitor a phone 2. Stable WhatsApp API works without a phone and your number is safe when using... www.b4x.com You can use my library, as for the demo project I am updating it Upvote 0
Affordable WhatsApp API for Messaging Campaigns | GREEN-API Service 🟢 Get an Alternative and Budget-Friendly Access to WhatsApp API 💡 🚀 GREEN-API Service — seamless WhatsApp integration with any programming language: PHP, JavaScript, 1C, Python, Java, C#, VBA. green-api.com You can take a look at that API, use WhatsApp Web to send messages and other things. [B4X] GreenApi - WhatsApp API Green API is a platform that allows you to send and receive WhatsApp messages through a stable API. 1. It is possible to send and receive text, photos and videos without the need to purchase and monitor a phone 2. Stable WhatsApp API works without a phone and your number is safe when using... www.b4x.com You can use my library, as for the demo project I am updating it
AlpVir Well-Known Member Licensed User Longtime User Jun 15, 2024 #5 I downloaded the suggested library but it doesn't seem to be right for me as it seems intended to send a message to only one contact. As a further difficulty I add that my app does not use B4X Pages. Could you check if it is really possible to achieve what you want using the library in question ? Attachments Screenshot_20240615_182610.jpg 160.4 KB · Views: 560 Upvote 0
I downloaded the suggested library but it doesn't seem to be right for me as it seems intended to send a message to only one contact. As a further difficulty I add that my app does not use B4X Pages. Could you check if it is really possible to achieve what you want using the library in question ?
Mariano Ismael Castro Active Member Licensed User Longtime User Jun 15, 2024 #6 AlpVir said: I downloaded the suggested library but it doesn't seem to be right for me as it seems intended to send a message to only one contact. As a further difficulty I add that my app does not use B4X Pages. Could you check if it is really possible to achieve what you want using the library in question ? Click to expand... I'm going to prepare a basic example and share it with you. Upvote 0
AlpVir said: I downloaded the suggested library but it doesn't seem to be right for me as it seems intended to send a message to only one contact. As a further difficulty I add that my app does not use B4X Pages. Could you check if it is really possible to achieve what you want using the library in question ? Click to expand... I'm going to prepare a basic example and share it with you.
AlpVir Well-Known Member Licensed User Longtime User Jun 15, 2024 #7 Thank you. Something very very simple. A text ("Lorem ipsum etc. etc") Two phone numbers One button Maximum delay in shipping 1 or 2 minutes No B4X Pages Upvote 0
Thank you. Something very very simple. A text ("Lorem ipsum etc. etc") Two phone numbers One button Maximum delay in shipping 1 or 2 minutes No B4X Pages
Mariano Ismael Castro Active Member Licensed User Longtime User Jun 15, 2024 #8 AlpVir said: A text ("Lorem ipsum etc. etc") Two phone numbers One button Click to expand... Don't forget to replace the keys It can work on B4XPages and non-B4XPages projects. This example works in B4J and B4A Attachments SendMultiSMS_GreenApi.zip SendMultiSMS_GreenApi.zip 9.2 KB · Views: 529 Upvote 0
AlpVir said: A text ("Lorem ipsum etc. etc") Two phone numbers One button Click to expand... Don't forget to replace the keys It can work on B4XPages and non-B4XPages projects. This example works in B4J and B4A
AlpVir Well-Known Member Licensed User Longtime User Jun 15, 2024 #9 Unknown type: countinginputstream Missing a library reference? Upvote 0
AlpVir Well-Known Member Licensed User Longtime User Jun 15, 2024 #10 My app does not use B4X Pages !!! The app in question is "SONO QUI" (I am here) Upvote 0
Mariano Ismael Castro Active Member Licensed User Longtime User Jun 15, 2024 #11 This example is not B4XPage Attachments SendMultiSMS_GreenApi2.zip SendMultiSMS_GreenApi2.zip 9.6 KB · Views: 463 Upvote 0
AlpVir Well-Known Member Licensed User Longtime User Jun 15, 2024 #12 greenApi.Initialize(Me, "GreenApi", myIdInstance,myApiTokenInstance , xui.DefaultFolder) ? Main - 34: Too many parameters. Upvote 0
greenApi.Initialize(Me, "GreenApi", myIdInstance,myApiTokenInstance , xui.DefaultFolder) ? Main - 34: Too many parameters.
Mariano Ismael Castro Active Member Licensed User Longtime User Jun 15, 2024 #13 AlpVir said: greenApi.Initialize(Me, "GreenApi", myIdInstance,myApiTokenInstance , xui.DefaultFolder) ? Main - 34: Too many parameters. Click to expand... You do not have the correct version of the library Attachments B4XGreenApiFree.b4xlib B4XGreenApiFree.b4xlib 6.5 KB · Views: 434 Upvote 0
AlpVir said: greenApi.Initialize(Me, "GreenApi", myIdInstance,myApiTokenInstance , xui.DefaultFolder) ? Main - 34: Too many parameters. Click to expand... You do not have the correct version of the library
AlpVir Well-Known Member Licensed User Longtime User Jun 15, 2024 #14 It appears to me that there is only one version of the library, the "1". It also turns out that you have to call that library with greenApi.Initialize(Me,"GreenApi",myIdInstance,myApiTokenInstance) Click to expand... and not with greenApi.Initialize(Me, "GreenApi", myIdInstance,myApiTokenInstance , xui.DefaultFolder) Click to expand... Having said this, it seems to me that the library is not for me because, if I have understood correctly, it requires that each user of the app in which this library is implemented must register their WhatsApp number. And this would be too complicated for users of my app. In any case I tried your code and the result is negative. This is the log *** Service (starter) Create *** ** Service (starter) Start ** ** Activity (main) Create (first time) ** ** Activity (main) Resume ** *** Receiver (httputils2service) Receive (first time) *** ResponseError. Reason: Forbidden, Response: <html> <head><title>403 Forbidden</title></head> <body bgcolor="white"> <center><h1>403 Forbidden</h1></center> <hr><center>nginx/1.14.0 (Ubuntu)</center> </body> </html> Message ID false ** Activity (main) Pause, UserClosed = true ** Click to expand... The only changes to your code were greenApi.Initialize(Me,"GreenApi",myIdInstance,myApiTokenInstance) Click to expand... And For Each WhatsAppNumber As String In Array("+39348xxxxxxx") Click to expand... My app is "SONO QUI" but I don't know if it is available outside of Italy. You simply have to send a certain text to 3 or 4 (no more) WhatsApp contacts within a few minutes. Thanks for your patience Upvote 0
It appears to me that there is only one version of the library, the "1". It also turns out that you have to call that library with greenApi.Initialize(Me,"GreenApi",myIdInstance,myApiTokenInstance) Click to expand... and not with greenApi.Initialize(Me, "GreenApi", myIdInstance,myApiTokenInstance , xui.DefaultFolder) Click to expand... Having said this, it seems to me that the library is not for me because, if I have understood correctly, it requires that each user of the app in which this library is implemented must register their WhatsApp number. And this would be too complicated for users of my app. In any case I tried your code and the result is negative. This is the log *** Service (starter) Create *** ** Service (starter) Start ** ** Activity (main) Create (first time) ** ** Activity (main) Resume ** *** Receiver (httputils2service) Receive (first time) *** ResponseError. Reason: Forbidden, Response: <html> <head><title>403 Forbidden</title></head> <body bgcolor="white"> <center><h1>403 Forbidden</h1></center> <hr><center>nginx/1.14.0 (Ubuntu)</center> </body> </html> Message ID false ** Activity (main) Pause, UserClosed = true ** Click to expand... The only changes to your code were greenApi.Initialize(Me,"GreenApi",myIdInstance,myApiTokenInstance) Click to expand... And For Each WhatsAppNumber As String In Array("+39348xxxxxxx") Click to expand... My app is "SONO QUI" but I don't know if it is available outside of Italy. You simply have to send a certain text to 3 or 4 (no more) WhatsApp contacts within a few minutes. Thanks for your patience
Mariano Ismael Castro Active Member Licensed User Longtime User Jun 15, 2024 #15 AlpVir said: Having said this, it seems to me that the library is not for me because, if I have understood correctly, it requires that each user of the app in which this library is implemented must register Click to expand... True, that's how it is This is bad +39348xxxxxxx, The correct is 39348xxxxxxx Upvote 0
AlpVir said: Having said this, it seems to me that the library is not for me because, if I have understood correctly, it requires that each user of the app in which this library is implemented must register Click to expand... True, that's how it is This is bad +39348xxxxxxx, The correct is 39348xxxxxxx
AlpVir Well-Known Member Licensed User Longtime User Jun 16, 2024 #16 Okay. Having established that the Green Api library isn't right for me, is there any other solution? Thanks anyway for the support. Upvote 0
Okay. Having established that the Green Api library isn't right for me, is there any other solution? Thanks anyway for the support.