Retargeting
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 on JSON object.
Indigitall.sendCustomEvent({event: "YOUR_CUSTOM_EVENT", customData:{}, () => {
// Do something in success function
},(error) => {
// Do something in error function
});
Topics
Our SDK allows you to classify users into different customizable groups. This is very useful for:
- Implement a preferences screen so that the user can choose the topics for which they want to receive notifications.
- Label according to the navigation or actions that the user performs.
- Segment communications according to whether the user has identified or is anonymous.
- Segment based on language, culture, customer category, or based on any other criteria you need.
Remember that you must first define the groups you want to work with in the indigitall console (Tools> Topics ).
- List groups
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((topics) => {
// Do something with topics in success function
}, (error) => {
// Do something in error function
});
Manage subscription
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 is typeof String[]
Indigitall.topicsSubscribe(topics, (topics) => {
// Do something with topics in success function
}, (error) => {
// Do something in error function
});
// topics is typeof String[]
Indigitall.topicsUnsubscribe(topics, (topics) => {
// Do something with topics in success function
}, (error) => {
// Do something in error function
});
Collection of push data
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 is with the action of open app.
We leave you this code that will help to obtain it:
For Android, by calling the following method and once the notification is clicked, the push object will be received with the corresponding information:
Indigitall.getPush(push => {
//DO SOMETHING
},(error) => {
// Do something in error function
});
In the case of iOS, you have to import the Indigitall library and add the following methods in the application's AppDelegate:
import Indigitall
@available(iOS 10.0, *)
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
Indigitall.handle(with: response ,withCompletionHandler: { (push, action) in
print("Push object:", push)
print("Push action app:", action.app)
})
}
#import <Indigitall/Indigitall.h>
- (void) userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler{
[Indigitall handleWithResponse:response withCompletionHandler:^(INPush * _Nonnull push, INPushAction * _Nonnull action) {
NSLog(@"Push object: %@", push);
NSLog(@"Push object app: %@", action.app);
}];
}