@takeoffmedia/react-native-blueshift-integration
v0.1.4
Published
integration off blueshift
Downloads
6
Readme
@takeoffmedia/react-native-blueshift-integration
Blueshift integration
Installation
npm
npm install @takeoffmedia/react-native-blueshift-integration
yarn
yarn add @takeoffmedia/react-native-blueshift-integration
Dependencies
Add package dependency
Add your firebase google-services.json file to the path /android/app/
Methods
// Initialize project
init():Promise<boolean>;
// connect the app with native module to listen changes and receive deep links url
onAddEventListener(url: string): void;
// Methods to set user information on local context
setUserInfoFirstName(firstName: string): void;
setUserInfoLastName(lastName: string): void;
setUserRetailerCustomerId(customerId: string): void;
setUserInfoEmailId(email: string): void;
// Methods to get user information on local context
getUserInfoEmailId(callback: Function): string;
getUserInfoFirstName(callback: Function): string;
getUserInfoLastName(callback: Function): string;
getUserInfoCustomerId(callback: Function): string;
// after setting the user info this method is called to send the data to the blueshift database and identify the user
identifyWithDetails(details: any): void;
// clean user data from local context
removeUserInfo(): void;
Getting Started
The following is the simplest working component one can create using this library:
import React, { useEffect } from 'react';
import ReactNativeBlueshiftIntegration from '@takeoffmedia/react-native-blueshift-integration';
export default function App() {
useEffect(() => {
ReactNativeBlueshiftIntegration.init('BLUESHIFT_API_KEY');
}, []);
}
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT