Default push behaviour
By default, the Ocamba receiver will show a notification on the device’s notification area when a content push is received. Tapping this notification will open the browser and track the open push conversion for you.
Custom notification click actions
OcambaHoood.notification().customActionButtons();
@Override
public void ocambaNotificationClick(String message, Context context) {
deepLink(context);
}
@Override
public void ocambaNotificationClick(String message, Context context) {
deepLink(context);
}
Custom notification layout:
ocamba_nc_icon.xml
<color name="ocamba_nc_name_color">#006291</color>
<color name="ocamba_nc_text_color">#006291</color>
<color name=“ocamba_nc_title_color”>#DB0000</color>
OcambaHoood.notification().customLayout();
And then on custom broadcast receiver on method ocambaNotificationReceived add:
RemoteViews collapsedLayout = new RemoteViews(context.getPackageName(), R.layout.test_story_layout_small);
RemoteViews expandedLayout = new RemoteViews(context.getPackageName(), R.layout.test_story_layout_large);
collapsedLayout.setTextViewText(R.id.story_title, message.getTitle()); collapsedLayout.setTextViewText(R.id.story_subtitle, message.getDescription()); expandedLayout.setTextViewText(R.id.story_title, message.getTitle()); expandedLayout.setTextViewText(R.id.story_subtitle, message.getDescription()); expandedLayout.setImageViewBitmap(R.id.story_big_icon, getIcon(context, message.getImage()));
OcambaHoood.notification().createCustomNotification(collapsedLayout, expandedLayout, message);
ocamba_multimessage_indicator.xml
To change multimessage notification arrows icon create inside drawable (res -> drawable) xml icon with name:
ocamba_multimessage_arrow_next.xml
ocamba_multimessage_arrow_previous.xml
NOTE: you can change notification sound, vibration pattern, notification layout (choose one type), title color, description color, multimessage indicator and arrows also from our Ocamba platform.
NOTE: from android 12 notifications with custom content views will no longer use the full notification area. Instead, system applies a standard template. Previously, custom notifications were able to use the entire notification area and provide their own layouts and styles.
Your feedback helps us improve our docs.