Wednesday, December 6, 2023

Does testnet bitcoin pockets help redirections?

We are attempting to combine bitcoin testnet pockets with react native dapp usin deep linking. Such that when person tries to ship btc he might be directed to bitcoin testnet pockets and as soon as transaction is submitted person might be redirected again to react native dapp.

tried following code pattern :

deeplink used:


pockets app used:

import React, { AppState,useEffect } from "react";
import { Linking, View, Button } from "react-native";

const App = () => {
  const onPressHandler = () => {
    const bitcoinAddress = "2NCXR2f6QsrUf4Kfpz99bctNA96vUw9j4bP";
    const quantity = "0.000001";
    const label = "Take a look at transaction";
    const message = "This can be a check transaction";
    const callbackUrl = "myapp://transaction_callback";
    const redirectUrl = "myapp://redirect_back";

    // Create the deep hyperlink URL with the callback and redirect URLs
    const deepLinkUrl = `bitcoin:${bitcoinAddress}?quantity=${quantity}&label=${label}&message=${message}&r=${encodeURIComponent(

    // Open the deep hyperlink URL within the person's Bitcoin pockets app

  operate handleUrl(url) {
    // Deal with the deep hyperlink URL right here
    console.log('Obtained deep hyperlink:', url);
  operate handleAppStateChange(appState) {
    if (appState === 'energetic') {
      Linking.getInitialURL().then(url => {
        console.log("check herrr")

  useEffect(() => {
    AppState.addEventListener('change', handleAppStateChange);
    return () => AppState.removeEventListener('change', handleAppStateChange);

  }, []);

  return (
    // your app code right here
      <Textual content>check</Textual content>
      <Button title="Press me" onPress={onPressHandler} colour="#841584" />

export default App;

Are there every other wallets which help redirections again to dapp and which help testnet?

Related Articles


Please enter your comment!
Please enter your name here

Latest Articles