Basic customization


1. 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.


2. Custom notification click actions

  • To change notification click actions add to Application class:

    ```java
        OcambaHoood.getBuilder().getNotificationBuilder().customActionButtons();
    ```

  • On Broadcast receiver on method ocambaNotificationClick create event:

    ```java
        @Override
        public void ocambaNotificationClick(String message, Context context) {
            deepLink(context);
        }
    ```

  • Same thing to notification action buttons:

    ```java
        @Override
        public void ocambaNotificationClick(String message, Context context) {
            deepLink(context); 
        }
    ```

3. Custom notification layout:

  • Change notification icon:

To change notification icon (from status bar) create inside drawable (res -> drawable) xml icon with name:



ocamba_nc_icon.xml

  • Change notification color:

To change notification elements color create inside colors (res -> values -> colors):



<color name="ocamba_nc_name_color">#006291</color>
<color name="ocamba_nc_text_color">#006291</color>
<color name="ocamba_nc_title_color">#DB0000</color>

  • Change notification layout:

To change notification layout add to Application class:


    ```java
        OcambaHoood.getBuilder().getNotificationBuilder().customLayout();
    ```

  • And then on custom broadcast receiver on method ocambaNotificationReceived add:

    ```java
        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.getInstance().createCustomNotification(collapsedLayout, expandedLayout, message);
    ```

  • To change multimessage notification indicator icon create inside drawable (res -> drawable) xml icon with name:


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
Info
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.
On This Page