Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual Installation Instructions #2

Open
ghost opened this issue Oct 25, 2019 · 3 comments
Open

Manual Installation Instructions #2

ghost opened this issue Oct 25, 2019 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Oct 25, 2019

Test and modify the below instructions and merge to readme file. The library has been changed from react-native-0bsnetwork to zbs-react, so references will need updating.

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]

  2. Go to node_modulesreact-native-0bsnetwork and add RN0bsnetwork.xcodeproj

  3. In XCode, in the project navigator, select your project. Add libRN0bsnetwork.a to your project's Build PhasesLink Binary With Libraries

  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RN0bsnetworkPackage; to the imports at the top of the file

  • Add new RN0bsnetworkPackage() to the list returned by the getPackages() method

  1. Append the following lines to android/settings.gradle:

include ':react-native-0bsnetwork'

project(':react-native-0bsnetwork').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-0bsnetwork/android')

  1. Insert the following lines inside the dependencies block in android/app/build.gradle:

compile project(':react-native-0bsnetwork')

Usage

  1. Import library

    import RN0bsnetwork from "react-native-0bsnetwork";
  2. Generate Token

    const response = await RN0bsnetwork.generateToken();
    var tokenData = JSON.parse(response);
    var address = tokenData.address;
    var seed = tokenData.seed;
  3. Make Transaction

    let transfer = { amount: "10", recipient: "XXXXXX", SEED_DATA: "XXXX XXXX XXXX", NODE_URL: "http://XXXXXX" }
    
    try {
    	const  transactionLog  =  await  RN0bsnetwork.makeTransfer(transfer);
    	alert("Done! Transfer Completed");
    } catch (e) {
    	alert("Error! Transfer failed");
    }
  4. Data Transaction

    let params = { data: [{"key": "XXXXX", "type": "XXXXX","value": "XXXXX"}], SEED_DATA: "XXXX XXXX XXXX", NODE_URL: "http://XXXXXX" }
    
    try {
    	const  transactionLog  =  await  RN0bsnetwork.dataTransfer(params);
    	alert("Done! Transfer Completed");
    } catch (e) {
    	alert("Error! Transfer failed");
    }
  5. Generate File Hash

    try {
      filepath = "#####";
      const fileHash = await RN0bsnetwork.generateDocumentHash(filepath);
    } catch (ex) {
      console.log(ex);
    }
@ghost ghost added good first issue Good for newcomers hacktoberfest labels Oct 25, 2019
@AzimPathan
Copy link
Contributor

AzimPathan commented Oct 25, 2019

@justjamesdev I'm working on this

@ghost
Copy link
Author

ghost commented Oct 25, 2019

Great! Thanks

AzimPathan added a commit to AzimPathan/zbs-react that referenced this issue Oct 25, 2019
Added manual instructions in proper format.
@AzimPathan
Copy link
Contributor

@justjamesdev Please review PR #5 and add into your repo. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant