Configuring Mobile pushes with OneSignal & Retainly #
STEP 1: Setup and configure OneSignal mobile SDK #
You can quickly setup OneSignal with this instruction Mobile Quickstart
STEP 2: Create OneSignal integration in Retainly #
To create a new integration connection with OneSignal Mobile Push in Retainly, follow these steps:
- Open Retainly and click on the ‘Settings’ icon at the bottom section of the sidebar menu
- Choose the ‘Integrations’ option.
- Look for and select the ‘OneSignal Mobile Push’ integration.
- Initiate the creation of a new connection.
For the credentials needed to set up this integration connection, you will need to visit your OneSignal account. Here’s how:
- Go to Your App in your OneSignal account.
- Select ‘Settings’
- From there, navigate to ‘Keys & IDs’ to find the required credentials.
STEP 3: Choose a way to identify your customers #
When preparing to send communications to your customers, you have two options to identify them: using the OneSignal Player ID or your own external ID.
Option 1: Identify customers with OneSignal Player ID
- The OneSignal Player ID can serve as a unique identifier for your customers. You can obtain this ID using the ‘getDeviceState’ and ‘getUserId’ methods as outlined in the OneSignal SDK documentation. Frontend SDKs
- Once you have obtained the OneSignal Player ID, you should update your Retainly customer records to include a field for this ID.
Option 2: Identify customers with External ID
- Alternatively, you can identify your customers by setting an external ID in OneSignal. This external ID should be a unique identifier already in your Retainly database or will be available soon.
- You’ll need to configure OneSignal to use this external ID, following the instructions in the OneSignal documentation. External User ID (legacy)
- It’s crucial that you set up the Retainly Uniq ID as the external ID or ensure that this ID will be sent to Retainly as a separate field.
STEP 4: Create a Mobile push template in Retainly #
To create a mobile push template using the OneSignal integration you’ve set up, follow these steps:
- Go to ‘Templates’ and select ‘Mobile push’. Click on the ‘Create’ button.
- From the available integrations, choose the OneSignal integration you previously set up.
- If you chose Option 2 (External ID) as the method to identify your customers (as described in step 3), make sure to tick the box labeled “Use external ID”. Additionally, ensure that the ‘Send to’ field corresponds to the appropriate customer ID field, based on the option you selected in step 3.
- Next, customize the look and feel of your template to your liking.
- Once you’re satisfied with your configuration, click ‘Save’ to store this new template.
STEP 5: Configure workflow for sending #
Send Mobile Pushes with “Mobile push“ workflow node
Configuring Mobile Pushes with Firebase #
STEP 1: Set Up Firebase SDK on Your Mobile App #
- The first step to being able to send push notifications to your mobile app is to set up Firebase SDK. This includes creating a Firebase project and registering your app with that project.Follow these instructions in Firebase’s official documentation to set up Firebase SDK on your mobile app.
- Once the Firebase SDK is set up, your app can register for notifications and get the FCM device token. The FCM device token is unique for each app-device combination and is required to send push notifications to the specific instance of the app on a device.Here’s the link to the official documentation showing how to get the FCM device token on Android. For iOS, refer to this documentation.
- The app should then send this FCM device token to your server or directly to Retainly.
STEP 2: Update Customer Records in Retainly System #
After obtaining the FCM device token, it must be saved in Retainly. This process may vary depending on your specific integration with Retainly. Typically, this would involve making an API call or using a provided SDK or interface to update the customer record.
STEP 3: Create a Mobile Push Template in Retainly #
- Navigate to the Mobile Push section and choose to create a new template.
- In the “Send To” field, input the FCM device token previously saved.
- For the “Sender” field, select “Firebase Integration”. You will need the Server Key from your Firebase project settings (Project Settings > Cloud Messaging > Server Key).
- Fill out other required fields like title, message, etc., according to your needs.
STEP 4: Use the Template in the Workflow #
Once you have saved the template, you can use it to send mobile push notifications in your workflows. Remember, the workflow should trigger the push notification to be sent to the FCM device token saved earlier. And with the Firebase integration set up, Retainly will send the notification via Firebase Cloud Messaging.
Remember to test your push notifications to make sure everything is working correctly. If there are any issues, check that your FCM device token and Firebase server key are correctly configured.
For further details, it is recommended to refer to the official Firebase Cloud Messaging Documentation.
Conclusion #
Congratulations! If you’ve reached this point in the Retainly Mobile Push Integration Guide, you should have a comprehensive understanding of how to successfully implement and manage push notifications in your mobile application through Retainly’s platform.