Push notification integration
Learn how to integrate push notifications for the Cordova Braze SDK.
Prerequisites
Before you start, you need to integrate the Cordova Braze SDK into your iOS or Android app.
Basic push features
By default, basic push notification features are enabled in the Braze Cordova plugin. You can disable these features by customizing your XML configurations. For more in-depth native push notification features, see the iOS and Android push notification guides.
Extended push features
Anytime you add, remove, or update your Cordova plugins, Cordova will overwrite the Podfile in your Xcode project. This means you’ll need to repeat this process anytime you modify your Cordova plugins.
Rich push notifications
Step 1: Create a notification service extension
In your Xcode project, create a notification service extension. For a full walkthrough, see iOS Rich Push Notifications Tutorial.
Step 2: Add a new target
Open your Podfile and add BrazeNotificationService
to the notification service extension target you just created. If BrazeNotificationService
is already added to a target, remove it before continuing. To avoid duplicate symbol errors, use static linking.
1
2
3
4
target 'NOTIFICATION_SERVICE_EXTENSION' do
use_frameworks! :linkage => :static
pod 'BrazeNotificationService'
end
Replace NOTIFICATION_SERVICE_EXTENSION
with the name of your notification service extension. Your Podfile should be similar to the following:
1
2
3
4
target 'MyAppRichNotificationService' do
use_frameworks! :linkage => :static
pod 'BrazeNotificationService'
end
Step 3: Reinstall your CocoaPods dependencies
In the terminal, go to your project’s iOS directory and reinstall your CocoaPod dependencies.
1
2
cd PATH_TO_PROJECT/platform/ios
pod install
Push stories
Step 1: Create a notification content extension
In your Xcode project, create a notification content extension. For a full walkthrough, see iOS Push Stories Tutorial.
Step 2: Configure your push app group
In your project’s config.xml
file, configure the push app group you just created.
1
<preference name="com.braze.ios_push_app_group" value="NOTIFICATION_CONTENT_EXTENTION" />
Replace PUSH_APP_GROUP
with the name of your push app group. Your config.xml
should be similar to the following:
1
<preference name="com.braze.ios_push_app_group" value="MyPushAppGroup" />
Step 3: Add a new target
Open your Podfile and add BrazePushStory
to the notification content extension target you created previously. To avoid duplicate symbol errors, use static linking.
1
2
3
4
target 'NOTIFICATION_CONTENT_EXTENSION' do
use_frameworks! :linkage => :static
pod 'BrazePushStory'
end
Replace NOTIFICATION_CONTENT_EXTENSION
with the name of your notification content extension. Your Podfile should be similar to the following:
1
2
3
4
target 'MyAppNotificationContentExtension' do
use_frameworks! :linkage => :static
pod 'BrazePushStory'
end
Step 4: Reinstall your CocoaPods dependencies
In the terminal, go to your iOS directory and reinstall your CocoaPod dependencies.
1
2
cd PATH_TO_PROJECT/platform/ios
pod install