smartech-base-react-native
Version:
Smartech Base SDK's React Native Plugin For React Native Projects.
131 lines (130 loc) • 6.1 kB
TypeScript
declare var SmartechBaseReact: {
SmartechDeeplink: string;
SmartechWidgetDataReceived: string;
addListener: (eventName: string, handler: (data: any) => void) => import("react-native").EmitterSubscription | undefined;
removeListener: (eventName: string) => void;
/**
* This method is used to track app update event.
* This method should be called by the developer to track the app updates event to Smartech.
*/
trackAppInstall: () => void;
/**
* This method is used to track app update event.
* This method should be called by the developer to track the app updates event to Smartech.
*/
trackAppUpdate: () => void;
/**
* This method is used to track app install or update event by Smartech SDK itself.
* This method should be called by the developer to track the app install or update event by Smartech SDK itself.
* If you are calling this method then you should not call trackAppInstall or trackAppUpdate method.
*/
trackAppInstallUpdateBySmartech: () => void;
/**
* This method is used to track custom event done by the user.
* This method should be called by the developer to track any custom activites
* that is performed by the user in the app to Smartech backend.
*/
trackEvent: (eventName: string, payload: any) => void;
/**
* This method is used to send login event to Smartech backend.
* This method should be called only when the app gets the user's identity
* or when the user does a login activity in the application.
*/
login: (identity: string) => void;
/**
* This method would logout the user and clear identity on Smartech backend.
* This method should be called only when the user log out of the application.
*/
logoutAndClearUserIdentity: (isLougoutClearIdentity: boolean) => void;
/**
* This method would set the user identity locally and with all subsequent events this identity will be send.
* This method should be called only when the user gets the identity.
*/
setUserIdentity: (identity: string, callback: ((err: any, res: any) => void) | null) => void;
/**
* This method would get the user identity that is stored in the SDK.
* This method should be called to get the user's identity.
*/
getUserIdentity: (callback: ((err: any, res: any) => void) | null) => void;
/**
* This method would clear the identity that is stored in the SDK.
* This method will clear the user's identity by removing it from.
*/
clearUserIdentity: () => void;
/**
* This method is used to update the user profile.
* This method should be called by the developer to update all the user related attributes to Smartech.
*/
updateUserProfile: (profilePayload: any) => void;
/**
* This method is used to opt tracking.
* If you call this method then we will opt in or opt out the user of tracking.
*/
optTracking: (isTrackingOpted: boolean) => void;
/**
* This method is used to get the current status of opt tracking.
* If you call this method you will get the current status of the tracking which can be used to render the UI at app level.
*/
hasOptedTracking: (callback: ((err: any, res: any) => void) | null) => void;
/**
* This method is used to opt in-app messages.
* If you call this method then we will opt in or opt out the user of in-app messages.
*/
optInAppMessage: (isInappOpted: boolean) => void;
/**
* This method is used to get the current status of opt in-app messages.
* If you call this method you will get the current status of the opt in-app messages which can be used to render the UI at app level.
*/
hasOptedInAppMessage: (callback: ((err: any, res: any) => void) | null) => void;
/**
* This method is used to set the user's location to the SDK.
* You need to call this method to set location which will be passed on the Smartech SDK.
*/
setUserLocation: (latitude: number, longitude: number) => void;
/**
* This method is used to get the app id used by the Smartech SDK.
* If you call this method you will get the app id used by the Smartech SDK.
*/
getAppId: (callback: ((err: any, res: any) => void) | null) => void;
/**
* Retrieves the Unbxd identity by the Smartech SDK..
*/
getNetcoreUnbxdIdentity: (callback: ((err: any, res: any) => void) | null) => void;
/**
* Retrieves the Partner parameters by the Smartech SDK..
*/
getPartnerParametersString: (callback: ((err: any, res: any) => void) | null) => void;
/**
* This method is used to get the device unique id used by Smartech SDK.
* If you call this method you will get the device unique id which is used to identify a device on Smartech.
*/
getDeviceGuid: (callback: ((err: any, res: any) => void) | null) => void;
/**
* This method is used to get the current Smartech SDK version.
* If you call this method you will get the current Smartech SDK version used inside the app.
*/
getSDKVersion: (callback: ((err: any, res: any) => void) | null) => void;
/**
* This method is used to get all widget names.
* If you call this method you will get an array of all widget names.
*/
getAllWidgetNames: (callback: ((err: any, res: any) => void) | null) => void;
/**
* This method is used to get widget by name.
* This method should be called with a specific widget name.
*/
getWidgetByName: (widgetName: string) => void;
/**
* This method is used to get widgets by names.
* This method should be called with an array of widget names.
*/
getWidgetByNames: (widgetNames: string[]) => void;
/**
* This method is used to get all widgets.
* This method will fetch all available widgets.
*/
getAllWidgets: () => void;
trackWidgetAsViewed: (widget: object) => void;
trackWidgetAsClicked: (widget: object) => void;
};
export default SmartechBaseReact;