We released versions new versions of our iOS and Android Smart App Agents.

Pyze Smart App Agent for Android version 2.2.0

What’s new?

We added improved support for In-App Notifications.  In-app notifications allow app publishers to reach out to app users when they use your app.

In-App Notifications are deeply integrated in Pyze Growth Intelligence and allow app publishers to reach out to users from manually from Event Sequences and Intelligence Explorer, and automatically based on workflows and campaigns from Growth Automation.

Read all about how to enable In-App Notifications in Android

EventSequences

Reach out from Event Sequences

SendInAppNow2.png

Select a template and reach out to users

The SDK adds the following methods in The Pyze Class:

Default methods to display in-app messages using Pyze In App Notification UI:

  • Pyze.showInAppNotificationUI(this.getApplication());
  • Pyze.showInAppNotificationUI(final Application application,
    final Constants.PyzeInAppMessageType messageType, //specified as PyzeInAppTypeUnread (recommended), PyzeInAppTypeRead, PyzeInAppTypeAll
    final String buttonTextColor,
    final String buttonBackgroundColor,
    final String backgroundColor,
    final String messageCounterTextColor,
    final BaseTemplateFragment.InAppNotificationButtonClickListener listener);

API methods to display in-app messages using a Custom In-App UI:

  • Pyze.countNewUnFetched(listener);
  • getMessageHeadersForType(final Constants.PyzeInAppMessageType messageType,
    final PyzeInAppMessagesManager.GetUnreadMessageMetadataListener listener)
  • getMessageHeadersForType(final Constants.PyzeInAppMessageType messageType,
    final PyzeInAppMessagesManager.GetUnreadMessageMetadataListener listener)
  • getMessageHeadersForType(final Constants.PyzeInAppMessageType messageType,
    final PyzeInAppMessagesManager.GetUnreadMessageMetadataListener listener)

We have added support for custom images, buttons and App links (introduced in Android M, 6.0 to complement deep links).  Web Links (http://pyze.com) App links (http://MyAwesomeApp.com/app-link) or deep links to your own app (myAwesomeApp://getPyzeToday) or other apps (twitter://user?screen_name=pyzeinc) are all supported.

Web, App and deep links to your own app and other apps are supported.

Read all about how to enable In-App Notifications in Android

/**
 * Sample Class to implement custom In-App Notification UI.  
 * For default Pyze In-App Notification UI, just call Pyze.showInAppNotificationUI(this.getApplication());
 */

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

import com.pyze.android.Pyze;
import com.pyze.android.constants.Constants;
import com.pyze.android.inapp.PyzeInAppMessagesManager;
import com.pyze.android.inapp.dto.Message;
import com.pyze.android.inapp.dto.Metadata;
import com.pyze.android.inapp.dto.MetadataList;


public class CustomInAppMessageActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_custom_inapp_msg);
        downloadInAppMessge();
    }

    private void downloadInAppMessge() {
        /*
        PyzeInAppTypeAll - New messages from server, unread and read messages from cache.
        PyzeInAppTypeUnread - Unread and read messages from cache.
        PyzeInAppTypeRead - Read messages from cache.
         */
        Pyze.countNewUnFetched(new PyzeInAppMessagesManager.GetUnreadMessageCountListener() {
            @Override
            public void onUnreadMessageCountDownloaded(int count) {
                if (count > 0) {
                    Pyze.getMessageHeadersForType(Constants.PyzeInAppMessageType.PyzeInAppTypeUnread, new PyzeInAppMessagesManager.GetUnreadMessageMetadataListener() {
                        @Override
                        public void onUnreadMessageMetadataDownloaded(MetadataList metadataList) {
                            if (metadataList != null && !metadataList.isEmpty()) {
                                Metadata metadata = metadataList.get(0);
                                Pyze.getMessageWithContentID(metadata.mid, metadata.cid, new PyzeInAppMessagesManager.GetMessageListener() {
                                    @Override
                                    public void onMessageDownloaded(Message message) {
                                        ((TextView) findViewById(R.id.textview_message)).setText(message.body);
                                    }
                                });
                            }
                        }
                    });
                } else {
                    Toast.makeText(CustomInAppMessageActivity.this, "No in-app messages found", Toast.LENGTH_LONG).show();
                }
            }
        });

    }
}

blog.pyze.com

Posted by Pooja Rani

I <3 android