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

[bug]: useAppKit open method bug #298

Open
qqqaa123123 opened this issue Jan 6, 2025 · 1 comment
Open

[bug]: useAppKit open method bug #298

qqqaa123123 opened this issue Jan 6, 2025 · 1 comment
Labels
bug Something isn't working stalled This issue has not had recent interaction or activity

Comments

@qqqaa123123
Copy link

qqqaa123123 commented Jan 6, 2025

Description

When calling the open method on a project created with expo52 on Android, only the mask is displayed, no pop-up box is displayed, and no error is reported, but it is fine on iOS

AppKit SDK version

"@reown/appkit-wagmi-react-native": "1.1.1"

Output of npx react-native info

none

Expo Version (if applies)

"expo": "^52.0.23"

Steps to reproduce

I followed the instructions on the official website step by step, and I don’t have any other code. I just want to try whether the link wallet function is intact.

Snack, code example, screenshot, or link to a repository

import { Image, StyleSheet, Platform, Button } from 'react-native';
import { HelloWave } from '@/components/HelloWave';
import ParallaxScrollView from '@/components/ParallaxScrollView';
import { ThemedText } from '@/components/ThemedText';
import { ThemedView } from '@/components/ThemedView';
import { useState } from 'react';
// import { useAppKit,AppKitButton } from '@reown/appkit-ethers-react-native'
import { AppKitButton,useAppKit, useWalletInfo } from '@reown/appkit-wagmi-react-native'
// 1. Get projectId from https://cloud.reown.com

export default function HomeScreen() {
  const { open } = useAppKit()
  const { walletInfo } = useWalletInfo()


  async function handleClickConnect(){
    try {
      console.log('handleClickConnect');
      await open({ view: 'Connect' })
    } catch (error) {
      console.error(error);
      
    }
    
  }
  
  return (
    <ParallaxScrollView
      headerBackgroundColor={{ light: '#A1CEDC', dark: '#1D3D47' }}
      headerImage={
        <Image
          source={require('@/assets/images/partial-react-logo.png')}
          style={styles.reactLogo}
        />
      }>
      <ThemedView style={styles.titleContainer}>
          <Button
            onPress={handleClickConnect}
            title="Connect"
            color="#841584"
            accessibilityLabel="Connect"
          />
           {/* <AppKitButton /> */}
      </ThemedView>
      <ThemedView style={styles.stepContainer}>
        <ThemedText>walletInfo:{JSON.stringify(walletInfo)}</ThemedText>
      </ThemedView>
        
      {/* <ThemedView style={styles.titleContainer}>
        <ThemedText type="title">Welcome!</ThemedText>
        <HelloWave />
      </ThemedView>
      <ThemedView style={styles.stepContainer}>
        <ThemedText type="subtitle">Step 1: Try it</ThemedText>
        <ThemedText>
          Edit <ThemedText type="defaultSemiBold">app/(tabs)/index.tsx</ThemedText> to see changes.
          Press{' '}
          <ThemedText type="defaultSemiBold">
            {Platform.select({
              ios: 'cmd + d',
              android: 'cmd + m',
              web: 'F12'
            })}
          </ThemedText>{' '}
          to open developer tools.
        </ThemedText>
      </ThemedView>
      <ThemedView style={styles.stepContainer}>
        <ThemedText type="subtitle">Step 2: Explore</ThemedText>
        <ThemedText>
          Tap the Explore tab to learn more about what's included in this starter app.
        </ThemedText>
      </ThemedView>
      <ThemedView style={styles.stepContainer}>
        <ThemedText type="subtitle">Step 3: Get a fresh start</ThemedText>
        <ThemedText>
          When you're ready, run{' '}
          <ThemedText type="defaultSemiBold">npm run reset-project</ThemedText> to get a fresh{' '}
          <ThemedText type="defaultSemiBold">app</ThemedText> directory. This will move the current{' '}
          <ThemedText type="defaultSemiBold">app</ThemedText> to{' '}
          <ThemedText type="defaultSemiBold">app-example</ThemedText>.
        </ThemedText>
      </ThemedView> */}
    </ParallaxScrollView>
  );
}

const styles = StyleSheet.create({
  titleContainer: {
    flexDirection: 'row',
    alignItems: 'center',
    gap: 8,
  },
  stepContainer: {
    gap: 8,
    marginBottom: 8,
  },
  reactLogo: {
    height: 178,
    width: 290,
    bottom: 0,
    left: 0,
    position: 'absolute',
  },
});
@qqqaa123123 qqqaa123123 added the bug Something isn't working label Jan 6, 2025
@ignaciosantise
Copy link
Collaborator

hey @qqqaa123123 where did you put <AppKit /> ? Can you check moving it to your home screen?

@ignaciosantise ignaciosantise added the stalled This issue has not had recent interaction or activity label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stalled This issue has not had recent interaction or activity
Projects
None yet
Development

No branches or pull requests

2 participants