1.0.26 • Published 4 years ago

react-native-deep-link-with-response v1.0.26

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

react-native-deep-link-with-response

npm version Supports Android MIT License npm total downloads npm monthly downloads npm weekly downloads Device Information for React Native. Here's an image the example:

Move along.

Getting started

yarn

$ yarn add react-native-deep-link-with-response

npm

$ npm install react-native-deep-link-with-response --save

Mostly automatic installation

$ react-native link react-native-deep-link-with-response

Usage *Work Only Android

application required in the example APK.

/**
 * Sample React Native App
 *
 * adapted from App.js generated by the following command:
 *
 * react-native init example
 *
 * https://github.com/facebook/react-native
 */

import React, { useState } from "react";
import {
  Platform,
  StyleSheet,
  Text,
  View,
  TextInput,
  Button,
  Linking
} from "react-native";
import DeepLinkWithResponse from "react-native-deep-link-with-response";
const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: "center",
    alignItems: "center",
    backgroundColor: "#F5FCFF"
  },
  welcome: {
    fontSize: 20,
    textAlign: "center",
    margin: 10
  },
  instructions: {
    textAlign: "center",
    color: "#333333",
    marginBottom: 5
  },
  input: {
    width: 300,
    marginBottom: 5,
    borderRadius: 12,
    fontSize: 14,
    backgroundColor: "#f7f7f7",
    borderWidth: 3,
    borderColor: "#45ccaa"
  }
});
export default function App() {
  const [status, setStatus] = useState("starting");
  const [message, setMessage] = useState("message");
  const [value, setValue] = useState("");
  async function pay(valueParam) {
    try {
      //configuration for number 12 tweenty digits

      const newValue = (1000000000000 + valueParam).toString().substring(1);
      const args = {
        amount: newValue
      };
      const deepLinkExample = "getnet://pagamento/v1/payment";
      const existAplication = await Linking.canOpenURL(deepLinkExample);
      if (existAplication) {
        const infoPayment = await DeepLinkWithResponse.startActivityForResult(
          1001, //code example someone number
          deepLinkExample, //deep link example
          args
        );
        console.log(infoPayment);
        setStatus("Working");
        setMessage(JSON.stringify(infoPayment));
      }
    } catch (err) {
      setStatus("Error");
      setMessage(err.message);
    }
  }
  return (
    <View style={styles.container}>
      <Text style={styles.welcome}>☆Geolocation example☆</Text>
      <Text style={styles.instructions}>STATUS: {status}</Text>
      <Text style={styles.welcome}>☆NATIVE CALLBACK MESSAGE☆</Text>
      <Text style={styles.instructions}>{message}</Text>
      <TextInput
        placeholder={"type it the value(only number):"}
        style={styles.input}
        keyboardType="numeric"
        value={value}
        onChange={text => setValue(text)}
      />
      <Button title="Press" onPress={() => pay(value)} />
    </View>
  );
}

Method

NameParamTypevalues
startActivityForResultcode,deepLink,argsnumber,string,objectany amount,DeepLink by application, {key:value}

this module was developed in order to use the getnet payment application thanks for using it

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.12

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago