DZone
Mobile Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Mobile Zone > Android Smart App Agent Version 2.2.0 Released

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.

Pooja Rani user avatar by
Pooja Rani
·
Jul. 18, 16 · Mobile Zone · News
Like (1)
Save
Tweet
3.53K Views

Join the DZone community and get the full member experience.

Join For Free

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

    }
}
app Android (robot)

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

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Choosing Between GraphQL Vs REST
  • After COVID, Developers Really Are the New Kingmakers
  • Synchronization Methods for Many-To-Many Associations
  • Java Hashtable, HashMap, ConcurrentHashMap: Performance Impact

Comments

Mobile Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo