WalletConnect / Web3ModalFlutter

The Web3Modal for WalletConnect built using Flutter.
https://pub.dev/packages/web3modal_flutter
Apache License 2.0
27 stars 30 forks source link

Wallet buttons keeps on loading forever. Getting 'Forbidden' error in terminal. #114

Closed Trilochan20 closed 3 weeks ago

Trilochan20 commented 4 weeks ago

Describe the bug The buttons don't load and loading shows and continues for infinity

here is my code

import 'package:flutter/material.dart';
import 'package:web3modal_flutter/web3modal_flutter.dart';

class WalletLoginSystem extends StatefulWidget {
  const WalletLoginSystem({super.key});

  @override
  State<WalletLoginSystem> createState() => _WalletLoginSystemState();
}

class _WalletLoginSystemState extends State<WalletLoginSystem> {
  late W3MService _w3mService;

  @override
  void initState() {
    super.initState();

    _initializeW3MService();
  }

  void _initializeW3MService() async {
    _w3mService = W3MService(
      projectId: '4a1542d08d8546a5b43d0138bbd6c436',
      metadata: const PairingMetadata(
        name: 'CirclesApp',
        description: 'Web3Modal Flutter Example',
        url: 'https://www.web3modal.com/',
        icons: ['https://web3modal.com//images/rpc-illustration.png'],
        redirect: Redirect(
          native: 'flutterdapp://',
          universal: 'https://www.web3modal.com',
        ),
      ),
    );

    await _w3mService.init();
  }

  @override
  Widget build(BuildContext context) {
    return SafeArea(
        child: Scaffold(
      appBar: AppBar(
        title: const Text('Wallet Login'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            W3MConnectWalletButton(service: _w3mService),
            const SizedBox(height: 16),
            W3MNetworkSelectButton(service: _w3mService),
            const SizedBox(height: 16),
            W3MAccountButton(service: _w3mService)
          ],
        ),
      ),
    ));
  }
}

Screenshots

Screenshot 2024-04-21 at 1 00 25 AM

Screenshot 2024-04-21 at 1 00 38 AM

Screenshot 2024-04-21 at 1 01 03 AM

Smartphone (please complete the following information):

Additional context Am I missing something here ?

anhnh-yoong commented 3 weeks ago

Same issue If I use your projectId: "2a2a5978a58aad734d13a2d194ec469a" you used in example is work. But I use my projectId it will get issue. Do I need change the setting of wallet connect project.

anhnh-yoong commented 3 weeks ago

@quetoo Can you help us. I make sure I set the right projectId. Thank you

Cali93 commented 3 weeks ago

Hey @Trilochan20 and @anhnh-yoong,

Thanks for reporting the issue and your patience. There was a bug on our Web3Modal API where all project IDs created from April 18 until today were considered invalid. The issue has been resolved and the requests should now get a valid response.

Sorry for the inconvenience.