1.0.76 • Published 7 months ago

react-native-floating-bubble-plugin v1.0.76

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

react-native-floating-bubble-plugin

A simple Facebook Chat Head like bubble for react native. Special thanks to bubble-for-android because this is just react native wrapper for that library.

Preview

Installation

$ npm install react-native-floating-bubble-plugin --save

Mostly automatic installation

$ react-native link react-native-floating-bubble-plugin

Manual installation

Usage

Methods

import { showFloatingBubble, hideFloatingBubble, requestPermission, initialize } from "react-native-floating-bubble-plugin"

// To display the bubble over other apps you need to get 'Draw Over Other Apps' permission from androind.
// If you initialize without having the permission App could crash
requestPermission()
	.then(() => console.log("Permission Granted"))
	.catch(() => console.log("Permission is not granted"))
	
// Initialize bubble manage
initialize()
	.then(() => console.log("Initialized the bubble mange"))


// Show Floating Bubble: x=10, y=10 position of the bubble
showFloatingBubble(10, 10)
	.then(() => console.log("Floating Bubble Added"));

// Hide Floatin Bubble
hideFloatingBubble()
	.then(() => console.log("Floating Bubble Removed"));

Events

You can listen to bubble press and bubble remove events using DeviceEventEmitter.

Events: floating-bubble-press, floating-bubble-remove

    DeviceEventEmitter.addListener("floating-bubble-press", (e) => {
		// What to do when user press the bubble
		console.log("Press Bubble")
    });
    DeviceEventEmitter.addListener("floating-bubble-remove", (e) => {
		// What to do when user removes the bubble
		console.log("Remove Bubble")
    });

Change Bubble Icon

Place the icon file as android/app/src/main/res/drawable/bubble_icon.png

Contribute

If you want to contribute the source code is here. https://github.com/antondev-123/react-native-floating-bubble-plugin

License

MIT


Made with create-react-native-library

1.0.76

7 months ago

1.0.75

7 months ago

1.0.74

7 months ago

1.0.73

7 months ago

1.0.72

7 months ago

1.0.71

7 months ago

1.0.70

7 months ago

1.0.69

7 months ago

1.0.68

7 months ago

1.0.67

7 months ago

1.0.66

7 months ago

1.0.65

7 months ago

1.0.64

7 months ago

1.0.63

7 months ago

1.0.62

7 months ago

1.0.61

7 months ago

1.0.60

7 months ago

1.0.59

7 months ago

1.0.58

7 months ago

1.0.57

7 months ago

1.0.56

7 months ago

1.0.55

7 months ago

1.0.54

7 months ago

1.0.53

7 months ago

1.0.52

7 months ago

1.0.51

7 months ago

1.0.50

8 months ago

1.0.47

8 months ago

1.0.46

8 months ago

1.0.45

8 months ago

1.0.44

8 months ago

1.0.43

8 months ago

1.0.42

8 months ago

1.0.41

8 months ago

1.0.40

8 months ago

1.0.39

8 months ago

1.0.38

8 months ago

1.0.37

8 months ago

1.0.36

8 months ago

1.0.35

8 months ago

1.0.34

8 months ago

1.0.33

8 months ago

1.0.32

8 months ago

1.0.31

8 months ago

1.0.30

8 months ago

1.0.29

8 months ago

1.0.28

8 months ago

1.0.27

8 months ago

1.0.26

8 months ago

1.0.25

8 months ago

1.0.24

8 months ago

1.0.23

8 months ago

1.0.22

8 months ago

1.0.21

8 months ago

1.0.20

8 months ago

1.0.19

8 months ago

1.0.18

8 months ago

1.0.17

8 months ago

1.0.16

8 months ago

1.0.15

8 months ago

1.0.14

8 months ago

1.0.13

8 months ago