|
| 1 | +--- |
| 2 | +title: OneSignal |
| 3 | +slug: /concepts/alerts-notification/one-signal |
| 4 | +sidebar_position: 3 |
| 5 | +tags: [Actions, Alerts & Notifications, Integration] |
| 6 | +keywords: [FlutterFlow, Actions, Alerts & Notifications, OneSignal] |
| 7 | +--- |
| 8 | + |
| 9 | + |
| 10 | +# OneSignal |
| 11 | + |
| 12 | +Integrating OneSignal lets you send emails and SMS (text messages) to your users. This can help you |
| 13 | +get more engagement, make more sales, and keep users coming back. After you set up OneSignal, you'll |
| 14 | +be able to easily add users to or remove them from OneSignal's subscription list. |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +:::note[Prerequisites] |
| 19 | +- Before you begin, make sure the project is on **Blaze plan** on Firebase. |
| 20 | +- [**Create an Account**](https://dashboard.onesignal.com/signup) on OneSignal |
| 21 | +::: |
| 22 | + |
| 23 | +## Initial Setup |
| 24 | +Here's a detailed, step-by-step guide to help you integrate OneSignal: |
| 25 | + |
| 26 | +### Setup in OneSignal |
| 27 | + |
| 28 | +1. To get started, you need an app created on OneSignal. You can create one from |
| 29 | + the [dashboard](https://dashboard.onesignal.com/apps). |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | +1. After creating your app, activate the services you need, like SMS and Email. Go to your app |
| 34 | + settings by clicking **App > Settings > Platforms** and then select **Activate** for the services |
| 35 | + you want to use. |
| 36 | + |
| 37 | + * If you're planning to use SMS, you'll need a [Twilio](https://twilio.com/) account and then |
| 38 | + follow the steps from the official [SMS Quickstart documentation](https://documentation.onesignal.com/docs/twilio-setup#step-2-twilio-account-setup). |
| 39 | + <figure> |
| 40 | + <img src="https://firebasestorage.googleapis.com/v0/b/ecommerceflow-docs/o/activate-SMS-service.gif?alt=media&token=b655cf4b-0c4c-4e0a-99bb-be8cebc85997"></img> |
| 41 | + <figcaption class="centered-caption">SMS Configuration</figcaption> |
| 42 | + </figure> |
| 43 | + * For sending emails, configure your settings as per the guidelines provided in the OneSignal |
| 44 | + [documentation](https://documentation.onesignal.com/docs/email-quickstart). |
| 45 | + |
| 46 | +### Setup in FlutterFlow |
| 47 | +To enable OneSignal in FlutterFlow: |
| 48 | +1. Navigate to **Settings and Integrations** > **Integrations** > **OneSignal**. |
| 49 | + |
| 50 | +2. Switch on the **Enable OneSignal** toggle. |
| 51 | + |
| 52 | +3. Gather your credentials: |
| 53 | + - *App ID**: Find this in your OneSignal dashboard under **Settings > Keys & IDs > |
| 54 | + OneSignal App ID**. |
| 55 | + - **API Key**: Located in the same section as the App ID, under **Rest API Key**. |
| 56 | + - **User Key**: Go to your user profile icon, then **Account & API Keys > User Auth Key**. |
| 57 | + - Click **Deploy**. |
| 58 | + |
| 59 | +<figure> |
| 60 | + <div class="video-container"><iframe src="https://www.loom. |
| 61 | +com/embed/55a72de8e15e418581cc8b49fc108b12?sid=052ead4c-96e4-4e9a-95c5-40162eb0d5fc" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div> |
| 62 | + <figcaption class="centered-caption"></figcaption> |
| 63 | +</figure> |
| 64 | + |
| 65 | +4. Now, at appropriate event in your app, you can [add an action](#adding-onesignal-action) that adds the user to the OneSignal's subscription. |
| 66 | + |
| 67 | +5. To test SMS functionality, follow the continuation of the instructions in the [SMS documentation](https://documentation.onesignal.com/docs/sending-sms-messages#sending-sms-notifications-from-dashboard). |
| 68 | + |
| 69 | +6. To try out sending Emails, continue with instructions |
| 70 | + from [here](https://documentation.onesignal.com/docs/sending-email#sending-email-notifications-from-dashboard). |
| 71 | + |
| 72 | + |
| 73 | +## Types of OneSignal action |
| 74 | + |
| 75 | +There are two main actions you can utilize in OneSignal: |
| 76 | + |
| 77 | +- **Add**: This lets you add users with their details like Email Address, Phone Number, and Tags. |
| 78 | +- **Dismiss**: Use this to remove a user from the subscription list. |
| 79 | + |
| 80 | +### Adding OneSignal action |
| 81 | + |
| 82 | +To add a OneSignal action, such as adding a user, follow these steps: |
| 83 | + |
| 84 | +1. Select the **Widget** (e.g., Button, etc.) on which you want to add the action. |
| 85 | + |
| 86 | +2. Select **Actions** from the Properties Panel (the right menu). |
| 87 | + |
| 88 | +3. Search and select the **OneSignal** (under Integration) action. |
| 89 | + |
| 90 | +4. Select the [Type](#types-of-onesignal-action) of the action. |
| 91 | + |
| 92 | +5. To add a user, enable the subscription options you want. You can set the value directly or use |
| 93 | +a variable. Remember, phone numbers should be in the [E.164 format](https://documentation.onesignal.com/docs/sms-faq#what-is-the-e164-format). |
| 94 | + |
| 95 | +6. Optionally, add Tags for more personalized messaging. For example, you could tag users based on |
| 96 | +their spending amount to target them with specific emails or SMS messages about their purchases. |
| 97 | + |
| 98 | +<figure> |
| 99 | + <div class="video-container"><iframe src="https://www.loom. |
| 100 | +com/embed/f06e63054a2b4c94883994b61182b7d2?sid=647d815a-d53d-41dc-a569-8cc3186eb6f7" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div> |
| 101 | + <figcaption class="centered-caption"></figcaption> |
| 102 | +</figure> |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | +You can find out if the user was successfuly added to the subscription by navigating to **OneSignal dashboard > App > Audience > Subscriptions**. |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | +:::info[OneSignal for Supabase Users] |
| 112 | +Currently, our OneSignal integration supports only Firebase authentication. If you want to use [**Supabase authentication**](../../ff-integrations/authentication/supabase-auth/initial-setup.md), you may need to use [**custom code**](../../ff-concepts/adding-customization/custom-code.md) to notify your users. |
| 113 | +::: |
| 114 | + |
| 115 | + |
| 116 | + |
0 commit comments