1.0.0 • Published 12 months ago
reactnative-in-app-messaging v1.0.0
reactnative-in-app-messaging
InApp messaging wit custom Alerts and example
Installation
npm install reactnative-in-app-messaging
Usage
import {
showLocationDialog,
showInCampusDialog,
showAlertAfterFewMinutesDismissal,
calculateRadiusDistance,
} from 'reactnative-in-app-messaging';
### If within building or facility
/*
Params
title: AlertTitle
message: Bodymessage
modalVisible : Boolean
setModalVisible: UpdateBoolean value
*/
{
showInCampusDialog(alertTitle, alertMessage, modalVisible, setModalVisible, [
{
text: messagingConstants.dismiss,
func: () => {},
},
]);
}
### present after 3 minutes
/*
Params
title: AlertTitle
message: Bodymessage
dismiss : Boolean
setDismiss: UpdateBoolean value
*/
{
showAlertAfterFewMinutesDismissal(
messagingConstants.welcome,
messagingConstants.confirm_arrival,
dismiss,
setDismiss,
[
{
text: messagingConstants.i_am_here,
func: () => onIamHerePressed(),
},
{
text: messagingConstants.dismiss,
func: () => {
setIsThreeMinutesAcknowledged(false);
},
},
]
);
}
### If nearby building or facility in parking lot within specific radius
/*
Params
title: AlertTitle
message: Bodymessage
campusLocationInside : Boolean
setCampusLocationInside: UpdateBoolean value
*/
{
showLocationDialog(
alertTitle,
alertMessage,
campusLocationInside,
setCampusLocationInside,
[
{
text: messagingConstants.i_am_here,
func: () => onIamHerePressed(),
},
{
text: messagingConstants.dismiss,
func: () => {},
},
]
);
}
### Takes current Latitude and Longitude from Esri sdk and returns a radius from distance
var radius = calculateRadiusDistance(currentLatitude, currentLongitude);
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library
1.0.0
12 months ago