As of release 19.0, new Twixl apps can only use Google Firebase for sending out push notifications.
We chose to adopt Firebase 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. Create a Firebase project for your app
Unless you already created a Firebase project for setting up push notifications for Android, start by creating a Firebase project for your app by following steps 1 to 3 here.
2. 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.plist
file and save it. You'll need it in your build setting on the platform.
3. Configure your app to use Apple Push Notifications service (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 recommended way to configure Firebase for Twixl apps, because this key never expires.
- Follow the steps to create a p8 private key here. Write down the Key ID, the Team ID and download 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.
- Select the saved key, and click Open.
- Add the Key ID and Team ID click the Upload button.
4. Configuring iOS push settings on the Twixl platform
- On the Twixl platform, go to your app, then navigate to the build settings section.
- In the build setting for your app, upload the Service Account File that you downloaded in step 2 (
GoogleService-Info.plist
) .
5. Create a new build using the Twixl Publisher macOS app
- Create a build using the build setting you just updated. 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.
6. 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 October 31st, 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 October 31st, it is mandatory to move to Firebase.
7. 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.