0.2.6 • Published 2 years ago

@functionland/rn-fula v0.2.6

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Built With

Getting Started

Use Server with caution and know the risk's because we are at development stage and the identity and encryption is not available, so you become public node that can accessed from anywhere.

Installation

Install NPM package

npm install @functionland/rn-fula --save

or using CDN

<script src="https://cdn.jsdelivr.net/npm/@functionland/rn-fula@0.2.2/dist/index.js"></script>

Usage

fula client will be

 // import provider
import Fula, {FulaContext} from '@functionland/rn-fula';
import React, {useContext} from 'react'
import {View} from 'react-native'

// add Fula Provider
const TopLevelComponent = (props) => {
return (
       <View>
         <Fula>
           <App/>
         </Fula>
       </View>
)
}

// Use rn Fula
const App = (props) => {
fula = useContext(FulaContext)

async function connect() {
 await fula.start()
 await fula.connect(serverId)
}

const onSend = async (e: any) => {
 let fileId = await fula.sendFile(image.uri)
 console.log(fileId)
}

const onReceiveFile = async (e: any) => {
 const file = await fula.receiveFile(fileId)
 console.log(await blobToBase64(file))
}

const onReceiveMeta = async (e: any) => {
 const meta =await fula.receiveMeta(fileId)
 console.log(meta)
}
}

AppRegistry.registerComponent('WhateverName', () => TopLevelComponent)

For more examples, please refer to the Examples

Roadmap

  • Protocols
    • File
    • Data
    • AI
  • Identity
  • Encryption

See the open issues for a full list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

See LICENSE for more information.

comment: <> ()

comment: <> (## Contact)

comment: <> (Your Name - @twitter_handle(https://twitter.com/twitter_handle); - email@email_client.com)

comment: <> (Project Link: https://github.com/github_username/repo_name(https://github.com/github_username/repo_name))

comment: <> ((back to top))

comment: <> ()

comment: <> (## Acknowledgments)

comment: <> (* []())

comment: <> (* []())

comment: <> (* []())

comment: <> ((back to top))