-
- All Implemented Interfaces:
-
ai.connectif.sdk.ConnectifInterface
public class Connectif implements ConnectifInterface
-
-
Method Summary
Modifier and Type Method Description Unitinitialize(Context context, String apiKey, String email, ConnectifConfig connectifConfig)Initializes the Connectif SDK with the given parameters. UnitaddPushToken(String token, Context context)Adds a Firebase push token to the Connectif system. BooleanhandlePushNotification(Map<String, String> data, Context context)Handles incoming push notifications from Connectif. BooleanisConnectifPushNotification(Map<String, String> data)Determines if the provided data corresponds to a Connectif push notification. UnitsendPageVisit(String name, EventCallbacks callbacks)Sends a page visit event to Connectif. UnitsendSearch(String searchText, EventCallbacks callbacks)Sends a search event to Connectif. UnitsendProductVisit(Product product, EventCallbacks callbacks)Sends a product visit event to Connectif. UnitsendLogin(String email, EventCallbacks callbacks)Sends a login event to Connectif. UnitsendCart(Cart cart, EventCallbacks callbacks)Sends a cart event to Connectif. UnitsendPurchase(Purchase purchase, EventCallbacks callbacks)Sends a purchase event to Connectif. UnitsendRegister(String email, RegisterContactInfo contactInfo, EventCallbacks callbacks)Sends a registration event to Connectif. UnitsendContactInfo(ContactInfo contactInfo, EventCallbacks callbacks)Sends updated contact information to Connectif. UnitsubscribeToNewsletter(EventCallbacks callbacks)Subscribes the contact to a newsletter via Connectif. UnitsendCustomEventById(String eventId, CustomEvent customEvent, EventCallbacks callbacks)Sends a custom event to Connectif using an event ID. UnitsendCustomEventById(String eventId, Object payload, EventCallbacks callbacks)Sends a custom event to Connectif using an event ID and a generic payload. UnitsendCustomEventByAlias(String eventAlias, CustomEvent customEvent, EventCallbacks callbacks)Sends a custom event to Connectif using an event alias. UnitsendCustomEventByAlias(String eventAlias, Object payload, EventCallbacks callbacks)Sends a custom event to Connectif using an event alias and a generic payload. -
-
Method Detail
-
initialize
Unit initialize(Context context, String apiKey, String email, ConnectifConfig connectifConfig)
Initializes the Connectif SDK with the given parameters.
- Parameters:
context- The Android context.apiKey- The API key provided by Connectif.email- (Optional) The email address associated with the contact.connectifConfig- ConnectifConfig Additional configuration parameters for the SDK.
-
addPushToken
Unit addPushToken(String token, Context context)
Adds a Firebase push token to the Connectif system.
- Parameters:
token- The push notification token.context- The Android context.
-
handlePushNotification
Boolean handlePushNotification(Map<String, String> data, Context context)
Handles incoming push notifications from Connectif.
- Parameters:
data- A map containing the notification payload data.context- The Android context.
-
isConnectifPushNotification
Boolean isConnectifPushNotification(Map<String, String> data)
Determines if the provided data corresponds to a Connectif push notification.
- Parameters:
data- A map containing the notification payload data.
-
sendPageVisit
Unit sendPageVisit(String name, EventCallbacks callbacks)
Sends a page visit event to Connectif.
- Parameters:
name- The name or identifier of the visited page.callbacks- Optional callbacks to handle success/failure events.
-
sendSearch
Unit sendSearch(String searchText, EventCallbacks callbacks)
Sends a search event to Connectif.
- Parameters:
searchText- The text that was searched.callbacks- Optional callbacks to handle success/failure events.
-
sendProductVisit
Unit sendProductVisit(Product product, EventCallbacks callbacks)
Sends a product visit event to Connectif.
- Parameters:
product- The product that was visited, including its identifier and other relevant data.callbacks- Optional callbacks to handle success/failure events.
-
sendLogin
Unit sendLogin(String email, EventCallbacks callbacks)
Sends a login event to Connectif.
- Parameters:
email- The email address of the contact who logged in.callbacks- Optional callbacks to handle success/failure events.
-
sendCart
Unit sendCart(Cart cart, EventCallbacks callbacks)
Sends a cart event to Connectif.
- Parameters:
cart- The current state of the contact's cart, including products and prices.callbacks- Optional callbacks to handle success/failure events.
-
sendPurchase
Unit sendPurchase(Purchase purchase, EventCallbacks callbacks)
Sends a purchase event to Connectif.
- Parameters:
purchase- The completed purchase details, including products, total amount, and order ID.callbacks- Optional callbacks to handle success/failure events.
-
sendRegister
Unit sendRegister(String email, RegisterContactInfo contactInfo, EventCallbacks callbacks)
Sends a registration event to Connectif.
- Parameters:
email- The email address of the newly registered contact.contactInfo- Optional additional contact information for the contact.callbacks- Optional callbacks to handle success/failure events.
-
sendContactInfo
Unit sendContactInfo(ContactInfo contactInfo, EventCallbacks callbacks)
Sends updated contact information to Connectif.
- Parameters:
contactInfo- The updated contact information.callbacks- Optional callbacks to handle success/failure events.
-
subscribeToNewsletter
Unit subscribeToNewsletter(EventCallbacks callbacks)
Subscribes the contact to a newsletter via Connectif.
- Parameters:
callbacks- Optional callbacks to handle success/failure events.
-
sendCustomEventById
Unit sendCustomEventById(String eventId, CustomEvent customEvent, EventCallbacks callbacks)
Sends a custom event to Connectif using an event ID.
- Parameters:
eventId- The unique identifier for the custom event.customEvent- The custom event details.callbacks- Optional callbacks to handle success/failure events.
-
sendCustomEventById
Unit sendCustomEventById(String eventId, Object payload, EventCallbacks callbacks)
Sends a custom event to Connectif using an event ID and a generic payload.
- Parameters:
eventId- The unique identifier for the custom event.payload- The payload representing the event data.callbacks- Optional callbacks to handle success/failure events.
-
sendCustomEventByAlias
Unit sendCustomEventByAlias(String eventAlias, CustomEvent customEvent, EventCallbacks callbacks)
Sends a custom event to Connectif using an event alias.
- Parameters:
eventAlias- The alias (human-readable name) for the custom event.customEvent- The custom event details.callbacks- Optional callbacks to handle success/failure events.
-
sendCustomEventByAlias
Unit sendCustomEventByAlias(String eventAlias, Object payload, EventCallbacks callbacks)
Sends a custom event to Connectif using an event alias and a generic payload.
- Parameters:
eventAlias- The alias for the custom event.payload- The payload representing the event data.callbacks- Optional callbacks to handle success/failure events.
-
-
-
-