App Inventor Extensions


SMS Receiver Extension SDK 34 ready!

See the App Inventor Extensions document about how to use an App Inventor Extension.

For questions about this extension or bug reports please start a new thread in the App Inventor community. Thank you.

For feature requests please contact me by email. To be a sponsor of a new method already is possible starting from only 10 USD! With your contribution you will help the complete App Inventor community. Thank you.

Jul 3th, 2024: Version 1: initial version.

Note: As this extension is already using functionality from SDK 34 we have to wait, until App Inventor targets SDK 34 before we can use it in production. However you already can test it on the SDK 34 test server.

Description

SMS Receiver extension.
Use this extension to receive SMS while your app is not running. You have 3 different possibilities to trigger an action after an SMS has received depending on property StartMode

  1. Only Notification
    Display a notification. After clicking the notification, the app will be started and screen "LockScreen" will be opened. In case that screen does not exist, Screen1 will be opened.
  2. Start Above Lock Screen or Notification
    If the device is locked, the screen called "LockScreen" of the app will be opened above the lockscreen of the device! After closing the app, the device still will be locked. If the device is unlocked, display a notification. After clicking the notification, the app will be started and screen "LockScreen" will be opened. This is the recommended start mode to not disturb the user while using other apps, see also here.
  3. Start Always
    The app will always start and open the screen called "LockScreen" no matter the state of the device. This might be annoying if the user is in a phone call or using another app. For this mode, additionally the permission "Appear On Top" is required.

Note: Displaying an app above the lockscreen (also known as full screen intent) requires for Android 14+ devices additionally full screen intent permission. After each app update this permission needs to be refreshed again! Its use is restricted: For apps targeting Android 14 (API level 34) or higher, apps that are allowed to use this permission are limited to those that provide calling and alarms only. You can use method HasFullScreenIntentPermission to check if your app has the permission; if not or if your app has not been approved for default enabling use of full screen intents you can use method AskForFullScreenIntentPermission to launch the settings page where users can grant the permission.

Required permissions: android.permission.RECEIVE_SMS, android.permission.SYSTEM_ALERT_WINDOW, android.permission.POST_NOTIFICATIONS, android.permission.DISABLE_KEYGUARD, android.permission.WAKE_LOCK, android.permission.USE_FULL_SCREEN_INTENT

Note: To publish an app in Google Play using the sensitive permission RECEIVE_SMS might be a challenge. You have to find a good use case, see also here.

Properties


Returns/Specifies the notification color.


Returns/Specifies the SmallIcon for notification. Recommended size is 96x96.


StartMode after SMS has been received.
Possible values are: 1, 2 or 3. (1 = Only notification, 2 = Start Above Lock Screen or Notification, 3 = Start Always).

Methods


Returns true, if post notifications permission has been granted, else false. Required starting from API Level 33.


Ask for Post Notifications permission. Required starting from API Level 33.


If user likes to always start the app, special permission is required. Using this method, you can check, if the permission has been granted.


Open Appear On Top Settings to enable always starting the app. Required starting from API Level 23.


Returns true, if full screen intent permission has been granted, else false. Required starting from API Level 34.


Ask for Full Screen Intent permission. Required starting from API Level 34 for apps that did not complete the Google Play declaration or have not been approved for default enabling use of full screen intents.


Cancel the current notification.

Example App: Receive SMS

Blocks Screen1




Blocks LockScreen


Screenshots

The example app gives a short overview about its purpose and asks for 2 basic permissions to receive sms and post notifications







Depending on the start mode, further permissions are required. Both Start Modes "Start Above Lock Screen or Notification" and "Start Always" require Full Screen Alert permission. Start Mode "Start Always" requires Allways On Top permission.







Test

Tested successfully on Samsung Galaxy A54 running Android 14 and Google Nexus 5X running Android 8.1.

For questions about App Inventor,
please ask in the App Inventor community.Thank you.

Buy the SMS Receiver extension for App Inventor


You can buy this extension (aix file).
With your payment you accept the terms and conditions below.

Payment options

1. Paypal

Please transfer 12 USD via Paypal
to Pura Vida Apps

2. Bitcoin

After having received your payment I will be happy to send the download link to you. Please let me know your Google account! I usually will send the download link not later than 24 hours after having received your payment.
Thank you! Taifun


Terms and Conditions

Back to top of page ...


Home | Snippets | Tutorials | Extensions | Links | Search | Privacy Policy | Contact