As of release 19.0, new Twixl apps will only be able to use Firebase-based configurations for sending out push notifications.
We chose to adopt Firebase fully on both iOS and Android because of the flexibility it offers for more advanced users that want to build marketing campaigns across platforms in a unified way.
1. Configure Firebase for a new Twixl app
New apps created with Twixl Publisher 19 and up will only allow you to configure push notifications through Google Firebase.
Create a Firebase Project
First create a Firebase project that will host the iOS and the Android applications. Follow these steps to set up a Firebase project.
Add an iOS app to the project
- In Project Settings, select the General tab.
- Add an iOS app.
- Fill in the Apple Bundle ID (that should correspond to the Bundle ID in the build settings, a reverse DNS name like
com.mycompany.myapp), and optionally specify an app nickname.
- Click Register to continue.
- Download the
GoogleService-Info.plistfile and save it. You'll need it in your build setting on the platform.
- Configure the iOS app to use the Apple Push Notification Servers (APNS)
There are two ways to configure Firebase to connect to APNS: through the use of a private key that never expires, or through the use of certificates issued from Apple's Developer Portal. The approach of using a private key is the supported way to configure Firebase, because this key never expires.
- Follow the steps to create a p8-key. Take a note of the Key ID, the Team ID and save the key as a p8 file.
- Upload this p8 key to the Firebase console.
- Inside your project in the Firebase console, select the gear icon, select Project Settings, and then select the Cloud Messaging tab.
- At the bottom part of the page, select the iOS app.
- In APNs authentication key under Apple app configuration, click the Upload button.
- Browse to the location where you saved your key, select it, and click Open.
- Add the Key ID and Team ID click the Upload button.
Configuring the Twixl Platform to use Firebase.
- On the Twixl Platform page of your app, in the Main menu select "Push Notifications"
- Upload the Service Account File (
GoogleService-Info.plist) created in step 2.
Creating a build.
- Create a build with build settings that have configurations for push notifications. Install the build, via TestFlight (iOS), or directly on the device (Android).
- Start up the app, then exit it. Start up the app a second time. It should prompt for push notification permissions.
- You can register as a test device and send push notifications as documented here.
2. What about push notifications for an existing app ?
When you already have a Twixl app configured with Push Notifications, the existing configuration will continue to work through September 30th, 2023.
If you need to change the settings of the app, the only way to do so is to convert the push notifications setup to use Firebase, based on the documentation above. Note that to continue to use push notifications after September 30th, it is mandatory to move to Firebase.
3. Testing Push Notifications on iOS
To test push notifications, first create a build and upload it to App Store Connect.
In the TestFlight tab there will be a list of all the builds uploaded. In the "Internal Testing" section it is possible to add a user that is a member of you App Store Connect team to test. Invite that member (possibly yourself) and they will receive an invitation e-mail from TestFlight to install the app. Use TestFlight on an iOS device to install the application.
Upon first run, the push notifications are not activated yet, so force quit the app and run it a second time. This time permission will be asked and the device will be registered to receive push notifications.
It is possible to register as a test device. After that, on the Twixl platform, you can send the first push notification to this specific test device.
If this works properly, then it is safe to assume the app is ready to be distributed and all users will be able to receive push notifications.
Push notifications can only be tested with Twixl production apps. Develoment apps are not supported.