SMS send without notification message

magalt

Member
Licensed User
Longtime User
Hi all
With the code

Dim SmsOk As PhoneSms
SmsOk.Send(NumTel.Text, Msg.Text)
Msgbox ("The message was send", "Ok")

I can send SMS at NumTel.

Add today: with 'SmsOk.Send' I sent SMS and my provider sent me a notification message

The matter, with my provider, is the cost of notification message.

Exist a way, programmatically, for not require and receive this notification message?

Thanks
 
Last edited:

krishna

New Member
Licensed User
Longtime User
suppress message notification

I too face the same issue.
Can you suggest some way to suppress the message by the service provider.
even if it involves suppressing all push messages
I am still :BangHead: on this issue

This is not "unique" to one operator.

This is done by every operator in india

I am including the image how it looks like
 

Attachments

  • PUSH SI.jpg
    PUSH SI.jpg
    30.5 KB · Views: 781
Last edited:
Upvote 0

susu

Well-Known Member
Licensed User
Longtime User
I confirm that I can send sms without any notification.
 
Upvote 0

genesi

Active Member
Licensed User
Longtime User
I confirm that I can send sms without any notification.
Hi ,what instructions you use?

I use Send (PhoneNumber ,Text) (lib 1.75) and my provider (TIM) recive a notification request ( cost 16 cent) ,the same problem of Krishna

sorry my english :sign0013:
 
Upvote 0

Roger Garstang

Well-Known Member
Licensed User
Longtime User
Are you guys sure you don't have anything enabled like Delivery or Read Notification in your SMS settings? It seems like it would be very wrong/crooked/corrupt for a provider to send you messages that cost you money. Carriers here in the US don't even charge for them if from them direct for billing, etc. Most people don't even worry about it because carriers are forcing us on Unlimited plans by offering only a few choices.
 
Upvote 0

genesi

Active Member
Licensed User
Longtime User
Are you guys sure you don't have anything enabled like Delivery or Read Notification in your SMS settings?
Check the settings was the first thing and the notification is disabled.
Other tests have confirmed that sending SMS with your phone does not involve the notification.
Send an SMS with SMS.send active notification
My provider do not tell me What receive (Es. *N#numberphone)
I apologize for my English
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please try this code and see if the notification message is sent:
B4X:
Sub SendSms(PhoneNumber As String, Text As String)
   Dim ps As PhoneSms
   Dim r As Reflector
   r.Target = r.RunStaticMethod("android.telephony.SmsManager", "getDefault", Null, Null)
   r.RunMethod4("sendTextMessage", Array As Object(PhoneNumber, Null, Text, Null, Null), _
      Array As String("java.lang.String", "java.lang.String", "java.lang.String", _
         "android.app.PendingIntent", "android.app.PendingIntent"))
End Sub
 
Upvote 0

genesi

Active Member
Licensed User
Longtime User
I tried and seems to work, no notification recived ,do other tests to make sure:icon_clap:
Thanks Erel
 
Last edited:
Upvote 0

volvomann

Active Member
Licensed User
Longtime User
I tried and seems to work, no notification recived ,do other tests to make sure:icon_clap:
Thanks Erel

How did you send message whith the code above, i tried it but cood not figur it out can you please tell me.
I hade tried and tried an app that send message and dont get notifacition mesages but inn my phonebill it was spent a lot off money for the notification.
 
Upvote 0

volvomann

Active Member
Licensed User
Longtime User
You should just add this sub to your code (reference Phone and Reflection libraries) and then call SendSms("23232323", "message text...").

Ok thank you it works find. There is another question
When i recive sms whith this code evrything works find for 5-10 sek then
sms sound pling and errormesage aplication PKK dontanswer cam on the device can you help with that too :sign0089:


main

B4X:
Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
    Dim strPhoneNumber, strPhoneBody As String
   Dim Button1 As Button
   Dim EditText1 As EditText
    Dim bnr As String
   
   End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
StartService(callsms)
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub


Sub MessageReceived
   strPhoneNumber = callsms.MessageFrom1
   strPhoneBody =   callsms.MessageBody1    
   Msgbox(strPhoneBody,strPhoneNumber)
  'StopService(callsms)
End Sub

Sub btnShow_Click
End Sub

Sub Button2_Click
   ExitApplication
End Sub



Sub Button1_Click
   Dim c As PhoneCalls
   Dim s As PhoneSms  
   bnr=EditText1.Text
   If bnr="" Then
   Msgbox("Ingen bilnummer","Test PKK")
   Else 
   SendSms("xxxxxxx", "message text...")
   
   End If
End Sub


Sub SendSms(PhoneNumber As String, Text As String)
    Dim ps As PhoneSms
    Dim r As Reflector
    r.Target = r.RunStaticMethod("android.telephony.SmsManager", "getDefault", Null, Null)
    r.RunMethod4("sendTextMessage", Array As Object(PhoneNumber, Null, Text, Null, Null), _
     Array As String("java.lang.String", "java.lang.String", "java.lang.String", _
     "android.app.PendingIntent", "android.app.PendingIntent"))
End Sub

calsms service

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    
Dim MessageFrom1 As String
Dim MessageBody1 As String
Dim si As SmsInterceptor
   
End Sub
Sub Service_Create
   si.Initialize2("si",999)
     
End Sub

Sub Service_Start
 
End Sub

Sub SI_MessageReceived (From As String, Body As String) As Boolean
    MessageFrom1 = From 'here we give the Process_global variable the value From. (From As String)
    MessageBody1 = Body 'here we give the Process_global variable the value Body. (Body As String)
    CallSub("Main","MessageReceived") ' I will explain this later.   
   ToastMessageShow(MessageFrom1, True)
   Return True
    
    'CallSub("Main","MessageReceived") ' I will explain this later.


End Sub
 
Last edited:
Upvote 0
Top