📐
Thunkable Docs
Build an AppDrag and Drop DocsSnap to Place Docs
Snap to Place
Snap to Place
  • 👋Welcome to Thunkable Docs
  • 👶Getting Started
    • Signing In
    • Your Thunkable Projects Page
    • Tutorials
    • Live Test your App
  • 🆕Create New Project
    • Project Settings
    • Project Assets and Sizes
  • Thunkable Sample Projects
  • Public Gallery of Projects
  • 🛠️ Components
  • 🔘User Interface
  • Button
  • Label
  • Text Input
  • List Viewer
  • Web Viewer
  • Switch
  • Slider
  • Alert
  • Loading Icon
  • Date Input
  • Time Input
  • PDF Reader
  • Rating
  • 📊Data Viewers
  • Data Viewer List
  • Data Viewer Grid
  • Custom Data Viewer Layout
  • Data Sources
  • 📐Layout
  • Top Tab Navigator
  • Bottom Tab Navigator
  • Stack Navigator
  • Drawer Navigator
  • Screen
  • Row
  • Column
  • 📷 Image
  • Image
  • Photo Library
  • Camera
  • Barcode Scanner
  • Image Recognizer
  • Animation by Lottie
  • Video
  • Video Recorder
  • 🗄️ Data
  • Local Storage
  • Local DB
  • Realtime DB by Firebase
  • Airtable
  • Media DB by Cloudinary
  • File Picker
  • Web API
  • 🌍Location
  • Maps by Google and Apple
  • Location Sensor
  • 💲Monetization
  • Ads by AdMob
  • In-App Purchase
  • 🌐Sensors
  • Gyroscope
  • Magnetometer
  • Accelerometer
  • Timer
  • Bluetooth Low Energy
  • 🔊Voice
  • Sound
  • Text to Speech
  • Speech Recognizer
  • Translator
  • Audio Recorder
  • 🤝Social
  • Share
  • Email Sign In by Firebase
  • Push Notifications by One Signal
  • 🎮Gaming
  • Canvas
  • Sprites
  • Sprite Gallery
  • Canvas Label
  • 🤖Gaming Blocks🎮
  • Events
  • Motion
  • Looks
  • Direction
  • Sensing
  • Add & Remove
  • Stage
  • Canvas Label
  • 🤖Blocks
  • Control
  • Logic
  • Math
  • Text
  • Lists
  • Color
  • Objects
  • Device
  • Variables
  • Functions
  • "Any Component" Blocks
  • 🖥️ App Services & Emulators
  • 🔒App Data Privacy
  • ➕Make Copy
  • 📥Download
  • 📤Share
  • 📱Publish
  • Publish to App Store (iOS)
    • TestFlight Overview
      • TestFlight in Depth
  • Publish to Play Store (Android) with AAB
  • Publish as a Web App
  • Generate Screenshots
  • 🔎Troubleshooting
    • Login Issues
    • FAQs
  • 📏Intro to Spacing
  • 🖼️ Intro to Sizing
  • 🔤Fonts
  • 💾Managing Storage
  • 📝Bugs and Product Feedback
  • Snap to Place Hour of Code Videos
Powered by GitBook
On this page
  • Overview
  • Thunkable + OneSignal
  • Add Push Notifications to your app
  • Properties
  • Geolocation Permissions
  • Create a OneSignal Account
  • Create a OneSignal App
  • Android Configuration
  • Android Testing
  • Toggle Location Permission (Android Only)
  • iOS Configuration
  • Generate a p8 Certificate
  • Add Push Notifications to the App Identifier
  • Download your Provisioning Profile
  • OneSignal
  • Generate a Provisioning Profile
  • iOS Testing
  • Send Push Notifications
  • Blocks
  • Functions

Was this helpful?

Export as PDF

Push Notifications by One Signal

PreviousEmail Sign In by FirebaseNext🎮Gaming

Last updated 6 months ago

Was this helpful?

Overview

Push notifications are one of the biggest advantages of mobile apps over mobile websites since they can send messages to users without the app being open.

When a user first opens an app with push notifications enabled they receive an alert prompting them to enable push notifications. Once they accept they are a subscriber of your app's push notifications.

Thunkable + OneSignal

Thunkable utilizes the services of to facilitate push notifications from your app. OneSignal is a free service that supports unlimited devices and notifications. You can learn more about their features here: .

To send push notifications to your app's users, you must link your Thunkable app to your OneSignal apps (iOS and/or Android). Once you've added your OneSignal App IDs into Thunkable, the work in Thunkable is done, and the remainder of the management takes place in third-party platforms (OneSignal, Apple Developer, and Firebase, depending on the platform).

Push notifications are one of the biggest advantages that mobile apps have over mobile websites, since they can send messages to users without the app being open.

However, annoying notifications---those that are irrelevant and too frequent---can be dismissed or blocked easily. We highly recommend sending notifications only when the content is relevant to the user. Examples of this include an e-commerce app notifying users of a sale, or a game notifying users of new levels and features.

Push Notifications cannot be tested with the Thunkable Live app on iOS You can test Push Notifications on iOS by publishing your app to TestFlight and downloading it from there.

Add Push Notifications to your app

To add Push Notifications to your app :

  1. Drag and drop the component onto any screen.

That's it. There are no blocks needed.

  1. Click Push Notification at the bottom of the screen

  1. The Push Notification settings modal opens. This is where you will enter your OneSignal Android App ID and OneSignal iOS App ID to configure the connection between OneSignal and your Thunkable project.

Properties

Property
Description
Data Type

Android App ID

App ID for Android from OneSignal

Text

iOS App ID

App ID for iOS from OneSignal

Text

Geolocation Enable (Android Only)

Toggle whether your end user is asked for permission to share their location

True/False

Geolocation Permissions

OneSignal allows you to push messages to users in certain locations. You will need permission from your end users to register their location to use this feature. You can toggle whether you request geolocation permissions from your end users in the Push Notifications settings panel.

  1. The remainder of this document will assist you with:

Create a OneSignal Account

  1. Click Sign Up.

  2. Create your account and complete the OneSignal onboarding.

Create a OneSignal App

  1. If you didn't create an app as part of the OneSignal onboarding, navigate to your OneSignal dashboard and click + New App/Website.

If you intend to send push notifications to your app's users on Android and iOS you will need to create a new app in OneSignal for each, Android and iOS.

  1. Enter your app name. We recommend including the platform in your app name, for example, Employee Directory - Android or Employee Directory - iOS.

  2. Select Apple iOS (APNs) or Google Android (FCM).

  1. Click Next: Configure Your Platform.

  2. Follow the platform-specific configuration instructions below:

Android Configuration

  1. To continue sending messages in 2024, you need to provide updated authentication credentials from Firebase for all apps created in OneSignal before September 1, 2023:

    1. In your Firebase project, go to Project settings and the Service accounts tab to download your private key JSON.

    2. In your OneSignal App Settings, upload the private key file you just downloaded

  2. Select Native Android as your target SDK.

  3. Click Save & Continue

  1. Copy Your App ID.

  1. In the Android App ID field, paste Your App ID that you copied from OneSignal in step 3.

  1. Click the Live Test on Device icon and open the Thunkable Live app on your device.

  2. Return to your OneSignal tab.

  3. Click Check Subscribed Users.

  1. If the configuration is successful, you will see a congratulations message.

  2. Click Done.

Android Testing

To test Android push notifications, download the app to your Android device and send a test message through OneSignal to see the push notification in action.

Toggle Location Permission (Android Only)

If you enable Geolocation Permissions, when you publish your app, ensure that you indicate that you're tracking location when you publish your app.

iOS Configuration

Generate a p8 Certificate

  1. When you get to the section titled "Provisioning Profiles," return to these instructions.

Add Push Notifications to the App Identifier

  1. In your Apple Developer account, select Identifiers under the Certificates, IDs & Profiles heading.

  2. Select your app from the list of Identifiers.

  3. Scroll down the list of app capabilities, and place a checkmark next to Push Notifications.

  4. Click Save.

  5. Select your app from the list of Identifiers again.

  6. Scroll down the list of app capabilities, until you get to Push Notifications again.

  7. Click the associated Configure button.

  8. Under Production SSL Certificate, click Create Certificate.

  9. Under Upload a Certificate Signing Request, click Choose File.

  10. Select the Certificate Signing Request (CSR) you downloaded from Thunkable as part of the publishing process.

  11. Click Continue.

  12. Click Download to download your iOS certificate.

Download your Provisioning Profile

  1. Select your app from the list of Profiles.

  2. Click Edit.

  3. Click Save.

  4. Click Download

OneSignal

  1. In OneSignal, select Native iOS as your target SDK.

  2. Click Save & Continue.

  1. Copy Your App ID.

  1. Return to the Blocks tab of your Thunkable project. Do not close the OneSignal tab.

  2. Click on the icon at the bottom of your design screen to open the Push Notifications dialog and paste this ID into the iOS App ID field.

Generate a Provisioning Profile

iOS Testing

To test iOS push notifications, you have to publish to TestFlight. This requires the provisioning profile with push notifications enabled.

Send Push Notifications

Blocks

Functions

User ID

The first time your app is opened on a new device, it is automatically assigned a unique push notification user ID. This block returns the user's push notification user ID that can be used to send a notification to a specific user with a web API call.

This feature may only be available for Creators on certain Thunkable plans. Please refer to our pricing page for more information: .

Go to .

A Google Service Account is a special type of account from Google that applications use to make authorized calls to a variety of APIs, including Firebase Cloud Messaging APIs. For more details, see Google's own . In order to send push notifications to Android devices, you will need a Service Account to generate a private key for OneSignal to utilize.

If you don't already have one, create a account. Instructions for getting started with Firebase are available here: .

Follow OneSignal's instructions to generate Firebase Cloud Messaging API Credentials for sending Android App Notifications here: .

More information on these steps is available here: .

OneSignal is a powerful choice of push provider. With their platform, you can setup for your users to be pushed notifications . This is optional, however. This also means you need to make a conscious decision as to whether or not to track your Android users geographical locations. These tracking data can be accessed via the OneSignal dashboard. This feature can be toggled on and off in the Push Notifications settings by clicking on the icon at the bottom of your design screen.

Follow OneSignal's instructions to generate a p8 certificate: .

Access your Apple Developer account’s .

You require a new provisioning profile with push notifications enabled to publish to the App Store. See OneSignal's instructions here: .

Once you have your platforms configured in OneSignal you can create and sent push notifications to your app's users. Follow OneSignal's instructions here: .

Thunkable pricing
Creating a OneSignal Account
Creating a OneSignal App
Configuring for Android
Configuring for iOS
OneSignal
Android Configuration
iOS Configuration
documentation on Service Accounts
Firebase
Firebase Account Setup
Android: Firebase Credentials
Android: Firebase Credentials
based on their locations
iOS: p8 Token-Based Connection to APNs
Profiles
Generate a Provisioning Profile
Sending Messages
OneSignal
OneSignal pricing page
One Signal is the world leader in push notifications and they offer their service for free.