PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Use in main the thread
  • Managing errors
  • Differences between GO mode and runtime
  • Required permissions
  • Folder of SMSs sent
  • SMS sent by the user
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Sends an SMS. The characteristics of this SMS have been specified in the SMS structure.
Remark: To send SMS messages with an attachment, use SMSRunApp.
Versions 15 and later
Android This function is now available for Android applications.
New in version 15
Android This function is now available for Android applications.
Android This function is now available for Android applications.
Versions 18 and later
Android Widget This function is now available in Android widget mode.
New in version 18
Android Widget This function is now available in Android widget mode.
Android Widget This function is now available in Android widget mode.
Example
// Initialisation de la structure SMS pour un numéro classique
SMS.Number = "0610203040"
SMS.Message = "J'envoie des SMS avec WINDEV Mobile!"
 
// Envoi du SMS
ResEnvoi is boolean = SMSSend()
 
// Erreur rencontrée?
IF ResEnvoi = False THEN
Error(ErrorInfo(errMessage))
END
// Initialisation de la structure SMS pour un numéro court
SMS.Number = "3040"
SMS.Message = "J'envoie des SMS avec WINDEV Mobile!"
SMS.NumberType = smsNationalNumber
 
// Envoi du SMS
ResEnvoi is boolean = SMSSend()
 
// Erreur rencontrée?
IF ResEnvoi = False THEN
Error(ErrorInfo(errMessage))
END
Syntax
<Result> = SMSSend()
<Result>: Boolean
  • True if the SMS was sent,
  • False otherwise. To get the details of the error, use ErrorInfo with the errMessage constant.
Remarks

Use in main the thread

If SMSSend is run in the main application thread, an hourglass (infinite progress bar) will be displayed when the message is sent. To specify the message to be displayed in the hourglass, use the NextTitle function just before the SMSSendfunction.

Managing errors

SMSSend throws an error in the following cases:
  • the recipient number is invalid,
  • the message to send is too long,
  • the SMS center is overloaded.
  • ...

Differences between GO mode and runtime

In mode GO (simulation on the development station), a WLanguage error is generated when calling the SMSSendfunction.
The SMS functions can be used during a GO on the Android emulator. To simulate the sending of SMS messages to the emulator, see the documentation of the Android SDK : https://developer.android.com/studio/run/emulator#console

Required permissions

The call to this function modifies the permissions required by the application.
Required permission: SEND_SMS

Folder of SMSs sent

The sms/sent folder that can be found on some Android devices is not automatically filled when an SMS is sent.

SMS sent by the user

If the SMS must be actually sent by the user from the native application of the device (Android or iPhone/iPad), use SMSRunApp.
Component: wd270android.aar
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment