Apptentive.iOS 5.2.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Apptentive.iOS --version 5.2.3                
NuGet\Install-Package Apptentive.iOS -Version 5.2.3                
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.iOS" Version="5.2.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Apptentive.iOS --version 5.2.3                
#r "nuget: Apptentive.iOS, 5.2.3"                
#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.iOS as a Cake Addin
#addin nuget:?package=Apptentive.iOS&version=5.2.3

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

Apptentive Xamarin iOS SDK

Register Apptentive

Register Apptentive in your Application class.

using ApptentiveSDK.iOS;

[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
    public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
    {
        ...
    
        var configuration = new ApptentiveConfiguration("Your Apptentive Key", "Your Apptentive Signature");
        Apptentive.Register(configuration);

        return true;
    }
}

Make sure you use the Apptentive App Key and Signature for the iOS 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.

public partial class ViewController : UIViewController
{
    ...
    
    public override void ViewDidLoad()
    {
        base.ViewDidLoad();

        MessageCenterButton.TouchUpInside += delegate
        {
            Apptentive.Shared.PresentMessageCenter(this, (presented) => Console.WriteLine("Message center presented: " + presented) );
        };
    }
}

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.Shared.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 partial class ViewController : UIViewController
{
    public override void ViewDidLoad()
    {
        base.ViewDidLoad();
        
        ...
        
        NSNotificationCenter.DefaultCenter.AddObserver(Constants.ApptentiveMessageCenterUnreadCountChangedNotification, (NSNotification obj) =>
        {
            UnreadMessagesTextView.Text = "Unread messages: " + Apptentive.Shared.UnreadMessageCount;
        });
    }
}

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.Shared.Engage("my_event", this, (engaged) => Console.WriteLine("Event engaged: " + engaged) ); // assuming 'this' is a ViewController
};

Push Notifications

Apptentive can send push notifications to your app when you reply to your customers. Your replies are more likely to be seen by your customer when you do this. To set up push notifications, you will need to supply your push credentials on the Integrations page of your Apptentive dashboard, send us the ID that your push provider uses to identify the device, and call into our SDK when a user opens a push notification.

To use Apptentive push, you will need to add code to your application delegate, configure your app for push in the developer portal, and supply your push certificate and private key in your Apptentive dashboard.

Configuring Your Application Delegate for Push

Your app will have to register for remote notifications (we recommend registering for alert and sound notifications) as follows:

var pushSettings = UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Alert | UIUserNotificationType.Sound, new NSSet());

UIApplication.SharedApplication.RegisterUserNotificationSettings(pushSettings);
UIApplication.SharedApplication.RegisterForRemoteNotifications();

When the registration succeeds, your application delegate will have to pass the device token on to the Apptentive SDK:

public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
{
    Apptentive.Shared.SetPushNotificationIntegration(ApptentivePushProvider.Apptentive, deviceToken);
}

Your application delegate will also have to forward any push and local notifications that it receives to the Apptentive SDK:

public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler)
{
    Apptentive.Shared.DidReceiveRemoteNotification(userInfo, this.Window.RootViewController, completionHandler);
}

public override void ReceivedLocalNotification(UIApplication application, UILocalNotification notification)
{
    Apptentive.Shared.DidReceiveLocalNotification(notification, this.Window.RootViewController);
}

In place of this.Window.RootViewController, you should determine which of your app’s view controllers is currently being displayed and pass that in as the value for the from argument. You can pass nil for the view controller parameter and the SDK will create a new window to present Message Center in.

If you are using Apple’s UserNotifications framework, you will need to replace the second method listed above with the following:

public void DidReceiveNotificationResponse(UNUserNotificationCenter center, UNNotificationResponse response, Action completionHandler)
{
    Apptentive.Shared.DidReceveUserNotification(response, completionHandler);
}

If your app supports both Apptentive notifications and notifications from another source, the Apptentive "DidReceive" methods above return a boolean value that indicates that the notification was intended for the Apptentive SDK. For methods that accept a completionHandler, it will be called by the Apptentive SDK only if the notification is intended for it, so it is your app's responsibility to call the completion handler in the event that the Apptentive method returns false.

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

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Apptentive.iOS:

Package Downloads
Plugin.Maui.Apptentive

Maui Plugin for Apptentive SDK

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.9.0 333 10/16/2024
6.8.1 2,853 6/5/2024
6.7.2 175 4/26/2024
6.7.1.1 130 4/25/2024
6.7.1 120 4/24/2024
6.7.0 106 4/24/2024
6.1.0 35,628 2/9/2023
6.0.3.5 6,348 6/23/2022
6.0.3.4 470 6/23/2022 6.0.3.4 is deprecated because it has critical bugs.
6.0.3.3 477 6/23/2022 6.0.3.3 is deprecated because it has critical bugs.
6.0.3.2 473 6/23/2022 6.0.3.2 is deprecated because it has critical bugs.
6.0.3.1 478 6/23/2022 6.0.3.1 is deprecated because it has critical bugs.
6.0.3 461 6/22/2022 6.0.3 is deprecated because it has critical bugs.
6.0.0.1 446 5/6/2022
6.0.0 462 5/5/2022 6.0.0 is deprecated because it has critical bugs.
5.3.2 14,991 8/3/2021
5.3.1 5,109 9/16/2020
5.2.14 12,247 7/9/2020
5.2.8 4,884 9/19/2019
5.2.7 657 9/18/2019
5.2.6 691 9/6/2019
5.2.5 7,217 2/21/2019
5.2.4 772 2/18/2019
5.2.3 1,029 12/3/2018
5.1.0 5,687 5/14/2018
5.0.0 1,286 1/23/2018
4.1.0 1,729 11/9/2017