This website is no longer maintained. Please, visit documentation.indigitall.com to read our updated documentation.
EN |
ESdvanced guide to set up the Xamarin SDK
In this section you will find a series of more advanced functionalities that require a more complex development. We recommend that a developer be in charge of this configuration.
The indigitall SDK can manage the user's location. This allows you to use the location filters on the send push campaign screen ( Campaigns> Push> New push campaign </ a >> Filters> Geographical filters)
Once we have enabled this functionality, the end user will have to give their consent to the location permission and enable the location services of their smartphone, so that the application can obtain the exact location of the user.
Add the location permissions by including this line in the AndroidManifest.xml file inside the Properties folder of the android project:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
You have to add the RequestLocationPermission parameter when the SDK is initialized in the case of using Xamarin.Forms and mark with the requestPermissionLocation flag, in the case of using Xamarin Classics you only have to add the requestPermissionLocation flag. This is done using the following code excerpt:
//Xamarin.Forms
//When you want to initialize indigitall in global iOS project::Xamarin.Forms.Forms.Init(this, bundle);
DependencyService.Register<Com.Indigitall.Xamarin.Android.Indigitall>();
Com.Indigitall.Xamarin.Android.Utils.PermissionUtils.RequestLocationPermission(this);
// otra forma de pdefinir el setdefault: this.ComponentName.ClassName
var app = new App();
LoadApplication(app);
...
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Permission[] grantResults)
{
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
Com.Indigitall.Xamarin.Android.Utils.PermissionUtils.OnRequestPermissionResult(this, requestCode, permissions, grantResults);
}
------------
//Initialize the project
var indigitall = DependencyService.Get<IIndigitall>();
if (indigitall != null)
{
indigitall.Init("YOUR_APPKEY", "YOUR_SENDERID", true);
}
------------
//Xamarin Classics
Com.Indigitall.Xamarin.Android.Indigitall indigitall = new Com.Indigitall.Xamarin.Android.Indigitall();
indigitall.Init("YOUR_APPKEY", "YOUR_SENDERID", true);
Add the following keys to the application's Info.plist file.
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Can we always use your location?</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Can we always use your location?</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Can we use your location when using the apps?</string>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
<string>remote-notification</string>
</array>
Keys NSLocationAlwaysUsageDescription, NSLocationWhenInUseUsageDescription y _NSLocationAlwaysAndWhenInUseUsageDescription_can be customized by editing the content of the label < string >.
Add the following code in the AppDelegate inside the FinishedLaunching method
DependencyService.Register<Com.Indigitall.Xamarin.iOS.Indigitall>();
if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
{
// iOS 10 or later
var authOptions = UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound;
UNUserNotificationCenter.Current.RequestAuthorization(authOptions, (granted, error) =>
{
if (granted)
{
InvokeOnMainThread(() =>
{
UIApplication.SharedApplication.RegisterForRemoteNotifications();
});
}
});
// For iOS 10 display notification (sent via APNS)
UNUserNotificationCenter.Current.Delegate = new Com.Indigitall.Xamarin.iOS.UserNotificationCenterDelegate();
}
else
{
// iOS 9 or before
var allNotificationTypes = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound;
var settings = UIUserNotificationSettings.GetSettingsForTypes(allNotificationTypes, null);
UIApplication.SharedApplication.RegisterUserNotificationSettings(settings);
}
The Activity by default is the initial screen of your app that is launched when a user clicks on a notification that does not have a deeplink. It is also the point where you should initialize the SDK. It is set by the parameter DefaultActivity:
//When you want to start indigitall
Com.Indigitall.Android.Indigitall.SetDefaultActivity(this, Java.Lang.Class.FromType(typeof("YOUR_ACTIVITY")).Name);
//or also
Com.Indigitall.Xamarin.Models.IConfiguration config = new Com.Indigitall.Xamarin.Models.IConfiguration();
config.appKey = "<YOUR-APP-KEY>";
config.senderId = "<YOUR-SENDER-ID>";
config.defaultActivity = Java.Lang.Class.FromType(typeof(MainActivity)).Name;
indigitall.Init(config)
You can associate your own ID to each device. In this way it will be easier and more intuitive for you to work with our tool. For example:
To make this association between your custom ID (externalId), and the identifier handled by indigitall (deviceId), you have to invoke the setExternalCode method:
//Remember to put your external code here
indigitall.SetExternalCode("YOUR_EXTERNAL_CODE", (device) =>
{
//Log device
}, (code, message) =>
{
Console.WriteLine("SetExternalCode.iOS error code:" + code + " message: " + message);
});
Do not worry about anything. Your IDs are irreversibly encrypted on the phone itself and sent securely to our servers. Not even the indigitall team can know this information.
If it is required to collect the user's WiFi information, in addition to the Indigitall panel configuration, you must add the parameter wifiFilterEnabled when the SDK is initialized:
indigitall.Init("YOUR APPKEY", "YOUR SENDER ID", requestLocation: true, wifiFilterEnabled: true)
//or also
Com.Indigitall.Xamarin.Models.IConfiguration config = new Com.Indigitall.Xamarin.Models.IConfiguration();
config.appKey = "<YOUR-APP-KEY>";
config.senderId = "<YOUR-SENDER-ID>";
config.requestLocation = true;
config.wifiFilterEnabled = true;
config.layoutBasic = Com.Indigitall.Xamarin.Models.Layoutbasic.Custom;
indigitall.Init(config)
The location permission must be accepted by the user
Please note that the WiFi scan time when the app is in the background or closed may be inaccurate.
In order to obtain the Wi-Fi information in android, the following permissions and services declared in the manifest are needed:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
// ANDROID 12 WIFI
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
//WiFi service
<service
android:name="com.indigitall.android.services.WifiStatusService"
android:permission="android.permission.BIND_JOB_SERVICE" >
</service>
<receiver android:name="com.indigitall.android.receivers.WifiWakeLockReceiver">
<intent-filter>
<action android:name="AlarmReceiver.Action.NETWORK_ALARM" />
</intent-filter>
</receiver>
Likewise, you must add in the project options in Xcode, in Signing & Capabilities the option Access WiFi Information :
If for some reason you don't want to show the push as the native android sample, we leave this option to show the push with our custom layout . To do this add the following code in the init call:
indigitall.Init("YOUR APPKEY", "YOUR SENDER ID", requestLocation: true, wifiFilterEnabled: true, customBasic: "custom")
//or also
Com.Indigitall.Xamarin.Models.IConfiguration config = new Com.Indigitall.Xamarin.Models.IConfiguration();
config.appKey = "<YOUR-APP-KEY>";
config.senderId = "<YOUR-SENDER-ID>";
config.logDebug = false;
config.layoutBasic = Com.Indigitall.Xamarin.Models.Layoutbasic.Custom;
indigitall.Init(config);
if you are ENTERPRISE CUSTOMER you have to add this parameter in the configuration so that the SDK points to the correct environment:
Com.Indigitall.Xamarin.Models.IConfiguration config = new Com.Indigitall.Xamarin.Models.IConfiguration();
config.appKey = "<YOUR-APP-KEY>";
config.senderId = "<YOUR-SENDER-ID>";
config.urlDeviceApi = "https://device-api.indigitall.com/v1";
config.urlInAppApi = "https://inapp-api.indigitall.com/v1";
indigitall.Init(config)
Our SDK offers various callbacks that help you have greater control of the execution flow and implement custom behaviors.
The onIndigitallInitialized method will run when the SDK finishes initializing and the device is ready to receive notifications from indigitall.
Receive as parameter:
Here is an example that prints logs about the status of permissions and device information.
var indigitall = DependencyService.Get<IIndigitall>();
if (indigitall != null)
{
indigitall.Init("YOUR APPKEY", "YOUR SENDER ID", true, (permissions, device)=>
{
Console.WriteLine("device: " + device.deviceId);
Console.WriteLine("device: " + permissions);
},(device)=>
{
//DO SOMETHING
},(errorCode,errorMessage)=>
{
//DO SOMETHING
});
//or also
Com.Indigitall.Xamarin.Models.IConfiguration config = new Com.Indigitall.Xamarin.Models.IConfiguration();
config.appKey = "<YOUR-APP-KEY>";
config.senderId = "<YOUR-SENDER-ID>";
indigitall.Init(config, (permissions, device) =>
{
Console.WriteLine("device: " + device.deviceId);
Console.WriteLine("device: " + permissions);
}, (device) =>
{
//DO SOMETHING
}, (errorCode,errorMessage) =>
{
//DO SOMETHING
});
/>
The onNewUserRegistered method will be executed when the device has been registered for the first time, that is, in the first execution of the app after being installed.
It receives as a parameter the Device object with the information associated with the device.
var indigitall = DependencyService.Get<IIndigitall>();
if (indigitall != null)
{
indigitall.Init("YOUR APPKEY", "YOUR SENDER ID", true, (permissions, device)=>
{
//DO SOMETHING
},(device)=>
{
Console.WriteLine("device: " + device.deviceId);
},(errorCode,errorMessage)=>
{
//DO SOMETHING
});
The onErrorInitialized method will be executed only if an error occurs during the initialization of the SDK.
It receives the description of the error as a parameter.
var indigitall = DependencyService.Get<IIndigitall>();
if (indigitall != null)
{
indigitall.Init("YOUR APPKEY", "YOUR SENDER ID", true, (permissions, device)=>
{
//DO SOMETHING
},(device)=>
{
//DO SOMETHING
},(errorCode,errorMessage)=>
{
Console.WriteLine("ErrorCode: " + errorCode+" Message: "+ errorMessage);
});
You can use the deviceGet method to get the information that the SDK has recorded regarding the device.
The callback will receive as a parameter the device object that contains all the information associated with the device.
indigitall.DeviceGet((device) =>
{
if (device != null)
{
Console.WriteLine("Device: " + device.deviceId);
}
},(errorCode,errorMessage)=>
{
Console.WriteLine("ErrorCode: " + errorCode+" Message: "+ errorMessage);
});
You can choose to disable the device to block the receipt of notifications. It is a very useful method to:
To do this, you have the deviceEnable and deviceDisable methods.
The callback will receive as a parameter the device object that contains all the information associated with the device.
indigitall.DeviceEnable((device)=>{
Console.WriteLine("Device: " + device.deviceId);
},(errorCode,errorMessage)=>
{
Console.WriteLine("ErrorCode: " + errorCode+" Message: "+ errorMessage);
});
indigitall.DeviceDisable((device)=>{
Console.WriteLine("Device: " + device.deviceId);
},(errorCode,errorMessage)=>
{
Console.WriteLine("ErrorCode: " + errorCode+" Message: "+ errorMessage);
});
Our SDK allows you to classify users into different customizable groups. This is very useful for:
Remember that you must first define the groups you want to work with in the indigitall console ( Tools> Interest groups </ a>). See our user manual for more info.
Use the topicsList method to get the list of groups that are configured in your indigitall project. The callback of this method receives as a parameter an array of Topics, which contains the information of all the available groups, as well as a flag that indicates whether the user is included in any of them.
indigitall.TopicsList((topic) =>
{
//DO SOMETHING
}, (errorCode, messageError) =>
{
//Log error
});
To manage the device subscription to one or more groups, there are two methods: topicsSubscribe and topicsUnsubscribe .
Optionally, both receive a TopicsCallback object as the third parameter, which will return the list of all Topic in the project.
//topics typeof string[]
indigitall.TopicsSubscribe(topics, (topic) =>
{
//DO SOMETHING
}, (errorCode, messageError) =>
{
//Log error
});
indigitall.TopicsUnsubscribe(topics }, (topic) =>
{
//DO SOMETHING
}, (errorCode, messageError) =>
{
//Log error
});
Your app can send information to indigitall's servers to identify the actions and events that happen in it. This allows you to automate retargeting actions.
To register these events you have to call the sendCustomEvent method, passing a descriptive ID as a parameter (you can invent the one you like best) and set data you need.
The data must be added in an array of the INHashMap model like the one in the example indicated below.
Com.Indigitall.Xamarin.Models.INHashMap[] iNHashMap = new Com.Indigitall.Xamarin.Models.INHashMap[2];
iNHashMap[0] = new Com.Indigitall.Xamarin.Models.INHashMap("key1", "value1");
iNHashMap[1] = new Com.Indigitall.Xamarin.Models.INHashMap("key2", "value2");
indigitall.SendCustomEvent("YOUR_CUSTOM_EVENT", iNHashMap, () =>
{
// Do something in success function
}, (ErrorDescription) =>
{
//ERROR DO SOMETHING
});
If you want to integrate the In-App messages in your application, you can do it with several complementary formats:
Below we tell you how to instantiate one or more In-App messages in banner format.
Remember that you should first have them defined in the indigitall console. See our user manual for more info.
Define a hybridWeview in the .xml file. The size must match what you have defined in the indigitall console ( Tools> In-App / In-Web Schemas ). Remember to translate the units from PX to _inches.
//160 units is 1 inch. 64 units is 1 cm
<local:HybridWebView x:Name="hybridWebView" InAppId="Billboard" WidthRequest="x" HeightRequest="y"/>
Instantiate In-App messages using the ShowInApp method.
iindigitall.ShowInApp(webViewHybrid, "INAPP_CODE", (inAppCode, webView, showTime) =>
{
//onShowTimeFinished
}, () => {
//did clicked
}, (code, message) =>
{
//did expired
}, (code, message) =>
{
//did click out
}, (code, message) =>
{
//did show more
}, (inAppId, webview) =>
{
//DO SOMETHING
},(inAppId, webview, errorMessage)=>
{
//LOG ERROR
});
Create a WebView view in your layouts. The size must match what you have defined in the indigitall console ( Tools> In-App / In-Web Schemas ). Remember to translate the units from PX to DP.
<android.webkit.WebView
android:id="@+id/myBanner"
android:layout_width="230dp"
android:layout_height="33.33dp"
/>
<android.webkit.WebView
android:id="@+id/otherBanner"
android:layout_width="250dp"
android:layout_height="36dp"
/>
Instantiate In-App messages using the showInApp method.
var myBanner = FindViewById<Android.Webkit.WebView>(Resource.Id.myBanner);
var otherBanner = FindViewById<Android.Webkit.WebView>(Resource.Id.otherBanner);
var views = new List<Android.Webkit.WebView>();
views.Add(myBanner);
views.Add(otherBanner);
var codes = new List<>();
codes.Add("myBanner_CODE");
codes.Add("otherBanner_CODE");
Indigitall.showInApp(getContext(), codes, views, new ShowInAppCallback() {
@Override
public void onLoad(String inAppCode, WebView webView) {
Log.d("In-App loaded: ", inAppCode);
}
@Override
public void onFail(String inAppCode, WebView webView, String message) {}
@Override
public void didDismissed(String inAppCode, WebView webView) {
super.didDismissed(inAppCode,webView);
Log.d("InApp didDismissed " + inAppCode);
}
});
Create a WebView view on the storyBoard. The size must match what you defined in the indigitall console ( Tools > In-App / In-Web Schemas ). Remember to translate the units from PX to iOS points.
Instantiate In-App messages using the method, whether you want to show one inapp or several of them.
IndigitallXamarin.Indigitall.ShowInApp(uiWebviewIos, "Billboard", (inAppId, webView) =>
{
// DO SOMETHING
}, (inAppId, webView, message) =>
{
// DO SOMETHING
},()=>{
//DidDismissed: DO SOMETHING
});
var views = new List<UIView>();
views.Add(myBanner);
views.Add(otherBanner);
var codes = new List<>();
codes.Add("myBanner_CODE");
codes.Add("otherBanner_CODE");
IndigitallXamarin.Indigitall.ShowMultipleInApp(views, codes, (inAppId, webView) =>
{
// DO SOMETHING
}, (inAppId, webView, message) =>
{
// DO SOMETHING
}, (inApp, webView) =>{
//DidDismissed: DO SOMETHING
});
Next we tell you how to instantiate an In-App message in popup format.
Remember that you should first have it defined in the indigitall console. See our user manual for more info.
Instantiate the In-App messages from the hybridWebView using the ShowPopUp method.
indigitall.ShowPopUp(view, "INAPP_CODE", (inAppId, webview) =>
{
//DO SOMETHING
},(inAppId, webview, errorMessage)=>
{
//LOG ERROR
}, () =>
{
Console.WriteLine("DidClick");
}, () =>
{
Console.WriteLine("DidClose");
}, () =>
{
Console.WriteLine("DidDismissed");
});
//In the event that you want to customize the close icon of the Popup,
//you can use the following method, in which you add a custom UIButton, or use the ** closeIconDisabled ** variable to show none:
indigitall.ShowPopUp(view, "INAPP_CODE", myIcon, false, () =>
{
Console.WriteLine("DidClick");
}, () =>
{
Console.WriteLine("DidClose");
}, () =>
{
Console.WriteLine("DidDismissed");
}, (inAppCode, showTime)=>{
Console.WriteLine("OnShowTimeFinished");
}, (code, message) =>
{
//did expired
}, (code, message) =>
{
//did click out
}, (code, message) =>
{
//did show more
}, (inAppId, webview) =>
{
//DO SOMETHING
},(inAppId, webview, errorMessage)=>
{
//LOG ERROR
});
Create a WebView view in your layouts. The size must match what you have defined in the indigitall console ( Tools> In-App / In-Web Schemas ). Remember to translate the units from PX to DP.
var view = findViewById(R.id.myPopup)
Indigitall.ShowPopUp(view, getContext(), "myPopup_CODE", new ShowInAppCallback() {
@Override
public void onLoad(String inAppCode, WebView webView) {
Log.d("In-App loaded: ", inAppCode);
}
@Override
public void onFail(String inAppCode, WebView webView, String message) {}
});
//In the event that you want to customize the close icon of the Popup, you can
//use the following method, in which you add a custom UIButton, or use the ** closeIconDisabled ** variable to show none:
Indigitall.ShowPopUp(view, getContext(), "myPopup_CODE", myIcon, false, new ShowInAppCallback() {
@Override
public void onLoad(String inAppCode, WebView webView) {
Log.d("In-App loaded: ", inAppCode);
}
@Override
public void onFail(String inAppCode, WebView webView, String message) {}
@Override
public void onShowTimeFinished(String inAppCode, WebView webView, int showTime) {}
});
Create a WebView view on the storyBoard. The size must match what you defined in the indigitall console ( Tools > In-App / In-Web Schemas ). Remember to translate the units from PX to iOS points.
IndigitallXamarin.Indigitall.ShowPopup("myPopup_CODE", () =>
{
// DO SOMETHING didAppear
}, () =>
{
// DO SOMETHING didCancel
}, () =>
{
// DO SOMETHING didClicked
}, () =>
{
// DO SOMETHING didDismissed
}, (inApp, showTime) =>
{
// DO SOMETHING onShowTimeFinished
},(error)=> {
//Log Error
});
//In the event that you want to customize the close icon of the Popup,
//you can use the following method, in which you add a custom UIButton, or use the ** closeIconDisabled ** variable to show none:
IndigitallXamarin.Indigitall.ShowPopup("myPopup_CODE", myIcon, false, () =>
{
// DO SOMETHING didAppear
}, () =>
{
// DO SOMETHING didCancel
}, () =>
{
// DO SOMETHING didClicked
}, () =>
{
// DO SOMETHING didDismissed
}, (inApp, showTime) =>
{
// DO SOMETHING onShowTimeFinished
},(error)=> {
//Log Error
});
In the event that you want to show the InApp scheme in a different way to how our SDK paints it, we put at your disposal some methods so that you can customize the "painting", without affecting the statistics or the InApp functionalities.
indigitall.GetInApp("YOUR_INAPP_CODE", (inApp) =>
{
//do something
}, (message) =>
{
//log error
});
Thanks to the InApp functionalities, it is possible to indicate that the inApp is displayed or pressed a maximum number of times, or if in the case of the popUp, after performing an action , such as pressing the close button, is not shown again. To do this we could do the following within the inAppGet method that we have seen previously:
indigitall.InAppWasShownWithInApp(inApp, () =>
{
//didExpired
}, () =>
{
//did show more
}, () =>
{
//did clickout
}, () =>
{
//show inapp
});
For the case of what we call Dismiss Forever, once the action is performed, this method must be called:
indigitall.AddNewInAppToDismissForever(inApp);
In the event that you want to show an inApp only if you make 'x' clicks or clicks on it, you must add the following:
indigitall.InAppWasClicked(inApp, intent);
In the event that you want to obtain the push object of type json to perform checks and / or when the user clicks on the notification and it is with the action of open app, we leave you this code that will help to obtain it:
In the case of Android we must add this code in the MainActivity and parse it as a push object to obtain the information:
var pushExtra = Com.Indigitall.Android.Models.Push.ExtraPush;
if (Intent != null && Intent.GetStringExtra(pushExtra) != null)
{
Com.Indigitall.Android.Models.Push push = new Com.Indigitall.Android.Models.Push(Intent.GetStringExtra(pushExtra));
Console.WriteLine("Push object: ", push);
}
In the case of iOS we must add this code in the AppDelegate of the application, both in the DidReceiveRemoteNotification method for the main action, and for the HandleAction method for the button action:
//class extends UNUserNotificationCenterDelegate
[Export("userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:")]
public override void DidReceiveNotificationResponse(UserNotifications.UNUserNotificationCenter center, UserNotifications.UNNotificationResponse response, Action completionHandler)
{
IndigitallXamarin.Indigitall.HandleWithResponse(response, (push, action) =>
{
Console.WriteLine("DidReceiveNotificationResponse push: " + push);
Console.WriteLine("DidReceiveNotificationResponse action: " + action.App);
});
}
//DidReceiveRemoteNotification
Com.Indigitall.Xamarin.iOS.Indigitall.HandleActionPush(userInfo, null, (push, action) => {
Console.WriteLine("DidReceiveRemoteNotification push: " + push);
Console.WriteLine("DidReceiveRemoteNotification action: " + action.app);
});
//HandleAction
Com.Indigitall.Xamarin.iOS.Indigitall.HandleActionPush(remoteNotificationInfo, actionIdentifier, (push, action) => {
Console.WriteLine("HandleAction push: " + push);
Console.WriteLine("HandleAction action: " + action.app);
});
If you decide to treat the Push action independently without going through our SDK, in order to record the statistics you must do the following depending on the platform.
In the case of Android, the intent of the action is collected in your activity where the ServiceUtils.RegisterStatistics method should be called. For this case, you can, for example, create a class that extends from our PushNotification to generate the intent with the following extras:
public class PushNotification : Com.Indigitall.Android.Models.PushNotification
{
Push push;
Context context;
public PushNotification(Push push): base(push)
{
this.push = push;
}
public override void ShowNotification(Context context)
{
this.context = context;
base.ShowNotification(context);
}
protected override PendingIntent GetIntent(PushAction action, int clickedButton){
Intent intent = action.GetIntent(context);
Intent indigitallIntent;
indigitallIntent = new Intent(context, typeof(MainActivity));
indigitallIntent.SetFlags(ActivityFlags.NewTask);
indigitallIntent.PutExtra(Com.Indigitall.Android.Services.StatisticService.ExtraAppKey, Com.Indigitall.Android.Commons.Utils.PreferenceUtils.GetAppKey(context));
indigitallIntent.PutExtra(Com.Indigitall.Android.Services.StatisticService.ExtraPushId, push.Id);
indigitallIntent.PutExtra(Com.Indigitall.Android.Services.StatisticService.ExtraClickedButton, clickedButton);
indigitallIntent.PutExtra(Com.Indigitall.Android.Services.StatisticService.ExtraIntentAction, intent);
indigitallIntent.PutExtra(Push.ExtraPush, push.ToString());
if (action.GetTopics() != null && action.GetTopics().Length > 0)
{
indigitallIntent.PutExtra(Com.Indigitall.Android.Services.StatisticService.ExtraActionTopics, action.TopicsToString());
}
TaskStackBuilder stackBuilder = TaskStackBuilder.Create(context);
stackBuilder.AddNextIntentWithParentStack(indigitallIntent);
return stackBuilder.GetPendingIntent((push.Id * 10) + clickedButton,
PendingIntentFlags.OneShot);
}
Once the push has been collected, as explained in the previous section, the following method must be called to register statistics:
Com.Indigitall.Android.Utils.ServiceUtils.RegisterStatistics(context, indigitallIntent);
In the case of iOS in the userNotificationCenter: didReceive method of the AppDelegate itself, in order to record the statistics, the following method must be added:
IndigitallXamarin.Indigitall.RegisterStatistics(response);