Our documentation is changing, please click here to enjoy it!
Have a splashcreen in your app ?
Allowing a content to be displayed in your splashcreen can affect the push behaviour.
For this reason, a method exists to prevent the display of any Accengage content once the splashcreen is loading. Please check this page for more information.
3.1 Customize the SDK default launching configuration
The configurations can be set simply by using the AccengageConfig.plist you've added to your project, or at runtime using the exposed properties of the The IDFA (Identifier for Advertisers), is automatically collected by the library. Note that you can disable the IDFA collection by setting the property to It's not required to implement the notification-related delegate methods. The library can intercept the UIApplicationDelegate and the UNUserNotificationCenterDelegate messages and forward them to your original delegate. This should be compatible with the majority of application use cases, but if you prefer, you can disable this behavior. If you choose to disable the automatic integration, you will need to implement all notification-related Depending on your privacy rules, you can decide to choose the restricted tracking mode which disables the collection of certain device data such as connection type, carrier name, local date and jailbreak state. Note that if you use the restricted mode, some advanced targeting features may not be available. This restriction is not recommended for most integrations. The library provides automated session management. This value indicates how long (in seconds) the app may be in the background before starting a new session upon resume. A default implementation has a session timeout period of 5 minutes. If the app remains in the background for longer than the session timeout period, the next time it's opened a new session will be started. Note Each new session equals to a new application visit which means that new server calls are made. It is for this reason that we recommend that you keep the session timeout period set to 5 minutes. If you prefer to start the SDK with a delay (e.g. as a result of a user action), you'll need to pass the launch options information to the SDK. This information is provided by the system in the didFinishLaunchingWithOptions callback and should be set using the launchOptions property of the ACCConfiguration object. You can specify a custom sound, that iOS will play when it receives a local or remote notification for your app. For more details, you can consult Apple's documentation. Remember that the default sound is played when: To add the sound file to your project, you can simply drag and drop it to your resource folder. Make sure you check the box Copy items if needed. In the Accengage dashboard, you can easily specify this sound when composing a push message by selecting "custom" in the sound section, and enter the file name with its extension (customsound.wav for instance). Prefer a short file name. Interactive notifications give the user a quick and easy way to perform relevant tasks in response to a notification. Instead of the user being forced to launch your app, the interface for an actionable notification displays custom action buttons that the user can tap. When tapped, each button dismisses the notification interface and forwards the selected action to your app for immediate handling. Forwarding the action to your app avoids the need for the user to navigate further in your app to perform the action, thereby saving time. A set of default notification categories is provided by Accengage. If you want to add more categories for interactive notifications, you should call the Note If you would like to handle custom categories and buttons, you must declare them in the Accengage Dashboard (Settings > Settings > Categories (Buttons)). See our User Guide for more details.ACCConfiguration
object.ACCConfiguration
object. See the ACCConfiguration
documentation for the full list of configuration options.IDFA collection
NO
.Automatic integration
UIApplicationDelegate
and UNUserNotificationCenterDelegate
methods. See the Push documentation for more details.Tracking mode
Session timeout
Delay SDK Launch
Custom notification sounds
Configure interactive notifications
setCustomCategories:
before registering for push notifications:
3.2 Handling push delegate callbacks manually
If you choose to disable the automatic integration, by changing the automaticPushDelegateEnabled property of your ACCConfiguration object to NO, you will need to add the following code:
3.3 Carousel Template
Carousel template is a rich notification template so before starting please make sure you are able to receive push with media attachments. If not, please refer to the Media Attachments section.
To enable the Carousel template in your project, you will need to create a Notification Content Extension.
Deployment target
By default, XCode set the most recent iOS version available as deployment target. If you run your application on a device that has an older iOS version, push notifications with carousel template won't be able to work. We recommend to set 10.0 as deployment target.
In your Podfile, add the pod Accengage-iOS-SDK-Extension to your newly created target :
Then, update your Cocoapods project.
Link the AccengageExtension.framework
to your newly created target
Then, change the newly created NotificationViewController class in such a way that it inherits from ACCNotificationContentViewController
and replace the code created by XCode by the following one :
In the NotificationViewController scene of the file newly created MainInterface.storyboard file, delete the default Hello world label.
Finally, in the Info.plist of the extension, update UNNotificationExtensionCategory
to acc_carousel_category
3.4 Preventing notification display
Silent push notifications
Silent push notifications improve the user experience by giving you a way to wake up your app periodically so that it can refresh its data in the background.
To enable silent push in your Xcode project:
In the Project Navigator, select your project.
In the editor, select your iOS app target.
Select the Capabilities tab.
Enable the Background Modes capability.
Enable the Remote notifications background mode.
To enable silent push on the Accengage dashboard, tick the content available checkbox when configuring your push message.
Please bare in mind that APNs treats silent push notifications as low priority and may throttle their delivery altogether if the total number becomes excessive. The actual limits are dynamic and can change based on conditions, but try not to send more than a few notifications per hour.