Texting Component


Properties

googleVoiceEnabled
  If this property is true, then SendMessage will attempt to send messages over WiFi, using Google voice.
Data type: boolean
Designer Writable true <texting name="textingName" googleVoiceEnabled="true">
Code Writeable true textingName.googleVoiceEnabled = true
Code Readable true let variable = textingName.googleVoiceEnabled

message
  The message that will be sent when the SendMessage method is called. The maximum length of a standard SMS message is usually 170. It may be less for languages using diacritical marks.
Data type: string
Designer Writable true <texting name="textingName" message="Test message">
Code Writeable true textingName.message = "Test message"
Code Readable true let variable = textingName.message

phoneNumber
  The number that the message will be sent to when the SendMessage method is called. The number is a text string with the specified digits (e.g., 6505551212). Dashes, dots, and parentheses may be included (e.g., (650)-555-1212) but will be ignored; spaces should not be included.
Data type: string
Designer Writable true <texting name="textingName" phoneNumber="0423148610">
Code Writeable true textingName.phoneNumber = "0423148610"
Code Readable true let variable = textingName.phoneNumber

receivingEnabled
  If set to 'off' no messages will be received. If set to 'foreground' or 'always' the component will respond to messages if it is running. In the case of 'foreground', messages received while the app is not running are discarded. In the case of 'always', messages receive while the app is not running will show a notification. Selecting the notification will bring up the app and signal the MessageReceived event. Messages received when the app is dormant will be queued, and so several MessageReceived events might appear when the app awakens. As an app developer, it would be a good idea to give your users control over this property, so they can make their phones ignore text messages when your app is installed.
Data type: string
Designer Writable true <texting name="textingName" receivingEnabled="foreground">
Code Writeable true textingName.receivingEnabled = "foreground"
Code Readable true let variable = textingName.receivingEnabled

class
  The styling class of the the component
Data type: string
Designer Writable true <texting name="textingName" class="Test class">
Code Writeable false
Code Readable false

id
  The styling id of the the component
Data type: string
Designer Writable true <texting name="textingName" id="Test id">
Code Writeable false
Code Readable false

name
  The name of the component that will be used to refer to it in code.
Data type: string
Designer Writable true <texting name="textingName" name="testComponent">
Code Writeable false
Code Readable false

Methods

Method name Description Parameters
sendMessage THIS DOESN'T WORK. IT'S A PERMISSIONS THING. SAME HAPPENS IN OFFICIAL APP INVENTOR BLOCKS. https://community.appinventor.mit.edu/t/error-908-permission-receive-sms/7426/5 Launch the phone's default text messaging app with the message and phone number prepopulated.
textingName.sendMessage()
sendMessageDirect THIS DOESN'T WORK. IT'S A PERMISSIONS THING. SAME HAPPENS IN OFFICIAL APP INVENTOR BLOCKS. https://community.appinventor.mit.edu/t/error-908-permission-receive-sms/7426/5 Send a text message. Using this block will add dangerous permissions that will require additional approval if your app is submitted to the Google Play Store.
textingName.sendMessageDirect()
addEventListener Method used to create event listeners.
See Events below for samples.
eventName string
eventCallbackFunction callback

Events

Event name Description Parameters
messageReceived THIS DOESN'T WORK. IT'S A PERMISSIONS THING. SAME HAPPENS IN OFFICIAL APP INVENTOR BLOCKS. https://community.appinventor.mit.edu/t/error-908-permission-receive-sms/7426/5 Event that's raised when a text message is received by the phone. Using this block will add dangerous permissions that will require additional approval if your app is submitted to the Google Play Store.
textingName.addEventListener(
    "messageReceived",
    function (number, messageText) {
        //Your code here
    }
)
number string
messageText string