Apptentive.Android 4.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Apptentive.Android --version 4.1.0
NuGet\Install-Package Apptentive.Android -Version 4.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Apptentive.Android" Version="4.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Apptentive.Android --version 4.1.0
#r "nuget: Apptentive.Android, 4.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Apptentive.Android as a Cake Addin
#addin nuget:?package=Apptentive.Android&version=4.1.0

// Install Apptentive.Android as a Cake Tool
#tool nuget:?package=Apptentive.Android&version=4.1.0

Apptentive Xamarin Android SDK

Register Apptentive

Register Apptentive in your Application class.

using System;
using Android.App;
using Android.Runtime;
using ApptentiveSDK.Android;

namespace ApptentiveSample
{
    [Application]
    public class MyApplication : Application
    {
        public MyApplication(IntPtr handle, JniHandleOwnership ownerShip)
            : base(handle, ownerShip)
        {
        }

        public override void OnCreate()
        {
            base.OnCreate();
            Apptentive.Register(this, "Your Apptentive Key", "Your Apptentive Signature");
        }
    }

}

Make sure you use the Apptentive App Key and Signature for the Android app you created in the Apptentive console. Sharing these keys between two apps, or using keys from the wrong platform is not supported, and will lead to incorrect behavior. You can find them here.

Message Center

See: How to Use Message Center

Showing Message Center

With the Apptentive Message Center your customers can send feedback, and you can reply, all without making them leave the app. Handling support inside the app will increase the number of support messages received and ensure a better customer experience.

Message Center lets customers see all the messages they have send you, read all of your replies, and even send screenshots that may help debug issues.

Add Message Center to talk to your customers.

Find a place in your app where you can add a button that opens Message Center. Your setings page is a good place.

var messageCenterButton = FindViewById<Button>(...);
messageCenterButton.Click += delegate
{
    Apptentive.ShowMessageCenter(context);
};

Checking Unread Message Count

You can also check to see how many messages are waiting to be read in the customer’s Message Center.

var unreadMessageCount = Apptentive.UnreadMessageCount;
if (unreadMessageCount > 0)
{
    Console.WriteLine("You have {0} unread messages", unreadMessageCount);
}

Unread Message Count Notification

You can receive a callback when a new unread message comes in. You can use this callback to notify your customer, and display a badge letting them know how many unread messages are waiting for them. Because this listener could be called at any time, you should store the value returned from this method, and then perform any user interaction you desire at the appropriate time.

public class MainActivity : Activity, IUnreadMessagesListener
{
    TextView unreadMessagesTextView;

    protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        
        ...

        unreadMessagesTextView = FindViewById<TextView>(...);

        Apptentive.AddUnreadMessagesListener(this);
    }

    public void OnUnreadMessageCountChanged(int count)
    {
        RunOnUiThread(delegate ()
        {
            unreadMessagesTextView.Text = "Unread messages: " + Apptentive.UnreadMessageCount;
        });
    }
}

The listener will not be run on the UI thread, and may be called from a different Activity than the one that is set on the listener. The correct way of setting Apptentive listeners is to create a listener with the same lifecycle as it’s intended usage, then passing it to Apptentive. For example, if the listener is going to be used in a specific activity, make the listener an Activity data member. This way, when the activity is gone, the listener will automatically be garbage collected and Apptentive will know about this through WeakReference (and we’ll stop calling the listener).

Events

Events record user interaction. You can use them to determine if and when an Interaction will be shown to your customer. You will use these Events later to target Interactions, and to determine whether an Interaction can be shown. You trigger an Event with the Engage() method. This will record the Event, and then check to see if any Interactions targeted to that Event are allowed to be displayed, based on the logic you set up in the Apptentive Dashboard.

var engageButton = FindViewById<Button>(...);
engageButton.Click += delegate
{
    Apptentive.Engage(this, "my_event");
};

You can add an Event almost anywhere in your app, just remember that if you want to show an Interaction at that Event, it needs to be a place where launching an Activity will not cause a problem in your app.

Product Compatible and additional computed target framework versions.
MonoAndroid monoandroid70 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.1.0 2,641 8/1/2023
6.0.2 166 7/6/2023
6.0.1 3,764 5/11/2023
6.0.0 232 5/3/2023
5.8.4 32,176 9/29/2022
5.8.3 7,186 3/23/2022
5.8.2 2,803 2/18/2022
5.8.1 431 2/17/2022
5.8.0 464 1/12/2022
5.7.1 1,474 8/26/2021
5.7.0 340 8/4/2021
5.6.5 383 7/28/2021
5.6.4 334 7/7/2021
5.6.3 369 2/4/2021
5.6.2 5,730 1/13/2021
5.6.1 961 12/7/2020
5.6.0 772 9/28/2020
5.5.4 2,402 9/8/2020
5.5.3 726 6/1/2020
5.4.2 11,770 5/14/2019
5.4.0 9,266 1/29/2019
5.3.2 702 12/6/2018
5.3.1 717 10/29/2018
5.3.0 765 10/19/2018
5.1.0 5,649 5/14/2018
5.0.0 1,106 1/23/2018
4.1.0 1,689 11/9/2017

Apptentive Android SDK 4.1.2