As described in the Interactive Notifications section of the "Design Mobile Apps for Responsys" topic, Marketers can use Interactive Notifications to add buttons to Push notifications. For Responsys accounts enabled for the Interactive Notifications feature, Marketers can add the standard interactive notifications, such as "Buy Now OR Add to Wishlist", to the Push notification. When the mobile app user receives the Push notification, they can choose their next action using the "Buy Now" or "Add to Wishlist" buttons displayed in the Push notification.
For Interactive Notifications to work in your mobile app, you must perform the following steps:
 Request access to the Interactive Notifications feature by contacting your Customer Success Manager or logging in to My Oracle Support and creating a service request. This feature is currently released under our Controlled Availability program.
 Build your app with the Mobile App SDK for iOS, version 6.35 (when available) or greater. The SDK will be available from the iOS Push IO Manager project on Oracle.com. The Mobile App SDK supports several default Interactive Notification buttons and categories, and your mobile app requires no additional configuration to use the defaults.
Optionally, you can add custom Interactive Notification buttons for Marketers to use in their Push campaigns. To do this for your mobile app, you must perform the additional steps in this section.
Work with the Marketing team to determine whether custom buttons are required for your mobile app, and then determine the button labels and functions.
In Responsys, Interactive Notification buttons are grouped by Category. When the mobile app user receives a Push notification that uses the button category, all buttons defined for that category are displayed in the notification. Each category supports having one or two buttons.
Allowable button actions are as follows:
Opening a URL. Buttons intended to open a URL must be of type "Foreground".
Dismissing the Push notification without taking further action. (Tapping any button will dismiss the Push notification.)
Use the Mobile App Developer Console to set up your mobile app to use Custom Interactive Notification buttons. See the topic Manage Notification button settings for instructions.
The steps in this section provide instructions for modifying your iOS app code.
[3.1] Import PIONotificationCategory.h
The mobile app must configure your app in advance to display custom action buttons with a Push notification. You perform all of your configuration before your application finishes launching. This means configuring your notification support no later than the
application:didFinishLaunchingWithOptions: method of your AppDelegate.
[3.2] Define Custom Notification Action(s)
The SDK provides the
PIONotificationAction to encapsulate the notification action's properties and method to instantiate.
In the following code, substitute
action_identifier for the Button ID value that you enter in the Mobile App Developer Console. For example, if you are adding a button for the mobile app user to indicate "Going" to an event, and you put "going" as the Button ID field of the Add notification buttons dialog, then you would use
going in place of
action_identifier in the code below.
NOTE: Interactive Notification categories can have one or two buttons. The code snippet shows the implementation for a single button in a category. To implement a two-button category, you must define a second action, and then add it to the same category as the first.
[3.3] Configure Custom Notification Category
The SDK provides the
PIONotificationCategory to encapsulate the notification category properties and method to instantiate. Your application uses categories to associate custom actions with a notification and to specify options for how to handle notifications of that type.
Category identifier needs to match the exact value defined in server, which system then uses to retrieve the options and display the notification. In the following code, substitute
category_identifier for the Category value that you enter in the Mobile App Developer Console. For example, if you created buttons for the mobile app user to indicate "Going" or "Not going" to an event, and you put "go_OR_nogo" into the Category field of the Add notification buttons dialog, then you would use
go_OR_nogo in place of
category_identifier in the code below.
[3.4] Request authorization to interact with the user
Your mobile app must have authorization to display alerts, play sounds, or badge the app’s icon in response to incoming notifications. To request authorization, call the
registerForAllRemoteNotificationTypesWithCategories: method with the list of notification categories. If your app is authorized for all of the requested interaction types,
completionHandler is called with the deviceToken acquired from APNS. On success in
completionHandler, your application should call the
registerApp: to register the application with server. Use the completion handler block to update your app’s behaviors based on success or failure of registration.
Reminder: In the following code snippets, substitute
category_identifier for the Category value and
action_identifier for the Button ID value that you enter in the Mobile App Developer Console.
The following code snippet shows the implementation for a category with one button. Scroll to the next section to see instructions for categories with two buttons.
To implement for a category with two buttons, define a second button and add it to the category's button list. In the above snippet, comments identify where you would add the second button for the category. The following snippets illustrate what those sections would look like when coded for two buttons. (The rest of the code in the above snippet would remain the same.)