0.2.1 • Published 6 months ago

react-native-app-bubble v0.2.1

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

react-native-app-bubble

This repository contains code that for the package which creates floating app bubble shortcut when app goes to background. The bubble can reopen app on press. Special thanks to bubble-for-android because this is just react native wrapper for that library.

Preview

Installation

npm install react-native-app-bubble

Setup

Android

  1. Append the following lines to android/settings.gradle:
    include ':react-native-app-bubble'
    project(':react-native-app-bubble').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-app-bubble/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
    implementation project(':react-native-app-bubble')

iOS

  1. This library is not supported for iOS. This functionality is not there.

Usage

Methods

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

// 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

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


JSONStreamacornabort-controlleragent-baseacceptsacorn-jsxaggregate-erroracorn-walkajvadd-streamanseransi-fragmentsansi-alignansi-regexansi-stylesanymatchappdirsjsansi-escapesarray-buffer-byte-lengthargarray-ifyargparsearray-includesarray-unionarray.prototype.maparray.prototype.flatarray.prototype.flatmaparray.prototype.tosortedarrifyarraybuffer.prototype.sliceasapastral-regexasync-limiterast-typesasyncavailable-typed-arraysbabel-coreasynciterator.prototypeasync-retrybabel-plugin-istanbulbabel-plugin-module-resolverbabel-jestbabel-plugin-polyfill-corejs2babel-plugin-polyfill-corejs3babel-plugin-polyfill-regeneratorbabel-plugin-jest-hoistbabel-plugin-transform-flow-enumsbabel-plugin-syntax-trailing-function-commasbabel-preset-current-node-syntaxbabel-preset-fbjsbabel-preset-jestbalanced-matchbase64-jsbasic-ftpbefore-after-hookbig-integerblbplist-parserboxenbrowserslistbufferbrace-expansionbserbracesbuffer-frombundle-namebytescacheable-lookupcacheable-requestcall-bindcaller-callsitecallsitescaller-pathcamelcasecamelcase-keyscaniuse-litechalkchar-regexchardetci-infocjs-module-lexerclean-stackcli-boxescli-cursorcli-spinnerscli-widthclonecliuicocollect-v8-coverageclone-deepcolor-convertcolorettecommand-existscolor-namecommondircommandercompare-funccompressiblecompressionconcat-mapconcat-streamconfig-chainconfigstoreconventional-changelogconnectconventional-changelog-angularconventional-changelog-atomconventional-changelog-codemirrorconventional-changelog-conventionalcommitsconventional-changelog-coreconventional-changelog-eslintconventional-changelog-emberconventional-changelog-expressconventional-changelog-jqueryconventional-changelog-jshintconventional-changelog-preset-loaderconventional-changelog-writerconventional-commits-filterconventional-commits-parserconventional-recommended-bumpconvert-source-mapcore-js-compatcore-util-iscosmiconfigcreate-requirecross-spawncsstypecrypto-random-stringcosmiconfig-typescript-loaderdata-uri-to-bufferdateformatdargsdebugdayjsdecamelizedecompress-responsededentdecamelize-keysdeep-isdeep-extenddefault-browserdeepmergedefault-browser-iddefaultsdefer-to-connectdefine-data-propertydefine-lazy-propdefine-propertiesdegeneratordeldenodeifydepddeprecated-react-native-prop-typesdeprecationdestroydetect-newlinediffdiff-sequencesdir-globdot-propdoctrineeastasianwidthee-firstemitteryemoji-regexelectron-to-chromiumencodeurlend-of-streamenvinfoerrorhandlererror-stack-parsererror-exes-array-method-boxes-properlyes-abstractes-get-iteratores-set-tostringtages-shim-unscopableses-iterator-helperses-to-primitiveescaladeescape-htmlescape-goatescape-string-regexpeslint-plugin-eslint-commentsescodegeneslint-plugin-ft-floweslint-plugin-jesteslint-plugin-react-hookseslint-plugin-reacteslint-plugin-react-nativeeslint-plugin-react-native-globalseslint-scopeeslint-visitor-keysespreeesprimaesrecurseesqueryestraverseesutilsetagevent-target-shimexitexecaexpectexternal-editorfast-deep-equalfast-globfast-json-stable-stringifyfast-levenshteinfast-difffast-xml-parserfastqfetch-blobfiguresfill-rangefile-entry-cachefinalhandlerfind-babel-configfind-cache-dirfind-upflat-cacheflattedflow-enums-runtimeflow-parserfb-watchmanfor-eachform-data-encoderfreshfs-extrafs.realpathfunction-bindfunction.prototype.namefunctions-have-namesgensyncget-caller-fileget-intrinsicget-package-typeget-pkg-repoget-streamget-symbol-descriptionget-urigit-raw-commitsgit-remote-origin-urlgit-semver-tagsgit-upgit-url-parseformdata-polyfillgitconfiglocalglobglob-parentglobalsglobal-dirsglobalthisglobbygotgraceful-fsgopdgraphemerhandlebarshard-rejectionhas-bigintshas-flaghas-protohas-property-descriptorshas-symbolshas-tostringtaghas-yarnhasownhermes-estreehermes-parserhermes-profile-transformerhosted-git-infohtml-escaperhttp-cache-semanticshttp2-wrapperhttp-errorshttp-proxy-agenthttps-proxy-agenthuman-signalsiconv-liteieee754ignoreimport-freshimage-sizeimport-lazyimurmurhashimport-localindent-stringinheritsinflightiniinternal-slotinterpretinquirerinvariantis-absoluteipis-array-bufferis-argumentsis-arrayishis-async-functionis-boolean-objectis-bigintis-callableis-ciis-date-objectis-core-moduleis-directoryis-dockeris-extglobis-finalizationregistryis-fullwidth-code-pointis-generator-fnis-generator-functionis-git-dirtyis-git-repositoryis-globis-inside-containeris-installed-globallyis-interactiveis-mapis-npmis-negative-zerois-numberis-number-objectis-objis-path-cwdis-path-insideis-plain-objis-plain-objectis-regexis-relativeis-setis-shared-array-bufferis-sshis-streamis-stringis-symbolis-text-pathis-typed-arrayis-unicode-supportedis-typedarrayis-unc-pathis-weakrefis-weakmapis-weaksetis-windowsis-wslis-yarn-globalisarrayisexeisobjectistanbul-lib-coverageissue-parseristanbul-lib-instrumentistanbul-lib-reportistanbul-lib-source-mapsistanbul-reportsiterate-iteratoriterate-valueiterator.prototypejest-changed-filesjest-circusjest-clijest-configjest-diffjest-docblockjest-eachjest-environment-nodejest-get-typejest-haste-mapjest-leak-detectorjest-matcher-utilsjest-message-utiljest-mockjest-pnp-resolverjest-regex-utiljest-resolvejest-resolve-dependenciesjest-runnerjest-runtimejest-snapshotjest-validatejest-utiljest-workerjest-watcherjetifierjoijs-tokensjsc-androidjs-yamljsc-safe-urljscodeshiftjsescjson-parse-better-errorsjson-bufferjson-parse-even-better-errorsjson-schema-traversejson-stable-stringify-without-jsonifyjson-stringify-safejson5jsonfilejsonparsejsx-ast-utilskeyvkind-oflatest-versionkleurlevnlevenlines-and-columnsload-json-filelocate-pathlodashlodash.capitalizelodash.camelcaselodash.debouncelodash.escaperegexplodash.isfunctionlodash.ismatchlodash.isplainobjectlodash.mergelodash.isstringlodash.kebabcaselodash.mergewithlodash.snakecaselodash.startcaselodash.throttlelodash.uniqlodash.upperfirstlodash.uniqbylog-symbolsloose-envifymacos-releaselowercase-keysmake-dirmake-errormakeerrorlogkittymap-objmemoize-onelru-cachemerge-streammeowmerge2metrometro-cachemetro-babel-transformermetro-cache-keymetro-configmetro-coremetro-file-mapmetro-inspector-proxymetro-minify-tersermetro-react-native-babel-presetmetro-minify-uglifymetro-react-native-babel-transformermetro-runtimemetro-resolvermetro-source-mapmetro-transform-pluginsmetro-symbolicatemicromatchmetro-transform-workermime-dbmimemimic-fnmime-typesmimic-responsemin-indentminimatchminimist-optionsmodify-valuesminimistmute-streammkdirpmsnatural-compare-litenatural-comparenegotiatorneo-asyncnetmasknew-github-release-urlnocachenode-abort-controllernode-dirnode-domexceptionnode-fetchnode-int64node-releasesnode-stream-zipnormalize-package-datanormalize-urlnormalize-pathnpm-run-pathnullthrowsobject-assignob1object-inspectobject-keysobject.assignobject.entriesobject.fromentriesobject.valueson-finishedobject.hasownon-headersonceonetimeoptionatoropenoraos-nameos-tmpdirp-cancelablep-limitp-locatep-mapp-trypac-resolverpac-proxy-agentpackage-jsonparent-moduleparse-pathparse-jsonparse-urlparseurlpath-is-absolutepath-keypath-existspath-parsepath-typepicocolorspicomatchpifypiratespkg-dirpkg-upprelude-lspretty-formatprettier-linter-helpersprocess-nextick-argspromisepromise.allsettledpromptsproto-listprop-typesprotocolsproxy-agentpumppunycodeproxy-from-envpupaqqueue-microtaskqueuequick-lrurange-parserrcreact-devtools-corereact-isreact-refreshread-pkg-upreact-shallow-rendererread-pkgreadable-streamreadlinerechoirrecastredentreflect.getprototypeofregenerateregenerate-unicode-propertiesregenerator-transformregenerator-runtimeregexp.prototype.flagsregexpu-coreregistry-auth-tokenregistry-urlregjsparserrequire-directoryrequire-from-stringrequire-main-filenamereselectresolveresolve-alpnresolve-globalresolve-cwdresolve-fromresolve.exportsresponselikeretryrestore-cursorreusifyrimrafrun-applescriptrun-asyncrun-parallelrxjssafe-array-concatsafe-buffersafe-regex-testsafer-bufferschedulersemversemver-diffserialize-errorsendserve-staticset-blockingset-function-lengthsetprototypeofset-function-nameshallow-cloneshebang-commandshebang-regexshelljsshell-quoteside-channelsignal-exitsisteransislashslice-ansismart-buffersockssocks-proxy-agentsource-mapsource-map-supportspdx-exceptionsspdx-correctspdx-expression-parsespdx-license-idssplitsplit2sprintf-jsstackframestack-utilsstacktrace-parserstatusesstdin-discarderstring-natural-comparestop-iteration-iteratorstring-lengthstring-widthstring.prototype.matchallstring.prototype.trimstring.prototype.trimendstring.prototype.trimstartstring_decoderstrip-bomstrip-ansistrip-final-newlinestrip-indentstrip-json-commentsstrnumsudo-promptsupports-colorsupports-hyperlinkssupports-preserve-symlinks-flagtempterminal-linktest-excludetersertext-extensionstext-tablethroatthroughthrough2titleizetmptmplto-fast-propertiesto-regex-rangetoidentifiertr46trim-newlinests-nodetslibturbo-windows-64tsutilstype-checktype-detecttype-festtyped-array-buffertyped-array-byte-lengthtyped-array-byte-offsettyped-array-lengthtypedarraytypedarray-to-bufferuglify-esuglify-jsunbox-primitiveunc-path-regexunicode-canonical-property-names-ecmascriptunicode-match-property-ecmascriptunicode-match-property-value-ecmascriptunicode-property-aliases-ecmascriptunique-stringuniversal-user-agentuniversalifyunpipeuntildifyupdate-browserslist-dburi-jsupdate-notifierurl-joinutil-deprecateuse-sync-external-storeutils-mergev8-compile-cache-libv8-to-istanbulvalidate-npm-package-licensevaryvm2vlqwalkerwcwidthweb-streams-polyfillwebidl-conversionswhatwg-fetchwhatwg-urlwhichwhich-boxed-primitivewhich-builtin-typewhich-collectionwhich-modulewhich-typed-arraywidest-linewildcard-matchwindows-releaseword-wrapwordwrapwrap-ansiwrappywrite-file-atomicwsxdg-basedirxtendyallisty18nyamlyargsyargs-parserynyocto-queue
0.2.1

6 months ago

0.2.0

6 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago