Over a million developers have joined DZone.

Android Smart App Agent Version 2.2.0 Released

Pyze has released new versions of their iOs and Android agents. Read on to see what the new features are in version 2.2.0.

· Mobile Zone

What's New in 2.2.0?

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 are 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();
                }
            }
        });

    }
}
Topics:
app ,deep ,pyze ,ui ,links ,notifications

Published at DZone with permission of Pooja Rani. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}