Giter Site home page Giter Site logo

particle-network / particle-react-native Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 3.0 46 MB

License: Apache License 2.0

Kotlin 18.31% JavaScript 1.95% Ruby 3.34% Starlark 0.20% Java 11.43% CMake 0.12% C++ 3.22% Swift 12.24% C 0.07% Objective-C 2.52% Objective-C++ 2.90% TypeScript 43.24% Python 0.48%

particle-react-native's Introduction

Particle Service in React Native

Note For iOS

Please note that the SDK particle_auth_core only supports ios-arm64 (iOS devices), does not support simulators, to perform testing, you will require an actual iPhone device.

Particle Auth Service

npm install @particle-network/rn-auth

Particle Connect Service

npm install @particle-network/rn-connect

Particle Wallet Service

npm install @particle-network/rn-wallet

Particle AA Service

npm install @particle-network/rn-aa

Particle Auth Core Service

npm install @particle-network/rn-auth-core

Getting Started

  1. Run example

  2. Select chain

  3. Init

  4. Login

  5. Try other methods




Expo-Examples

If you are using Expo with your project, there is an expo example, for iOS development, You need to update your Podfile by following this Expo iOS Podfile

AuthCoreWalletDemo

AuthCoreWalletDemo will focus on both integrate particle-auth-core and particle-wallet, show how how to connect with jwt and open wallet.

Docs

particle-auth

particle-connect

particle-wallet

particle-biconomy

particle-auth-core

License

Apache 2.0

particle-react-native's People

Contributors

chaichuanfa avatar dudujiaocheng avatar jomarip avatar pantaovay avatar sunzhic avatar tuguilin1 avatar zzzdad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

particle-react-native's Issues

error diff


class ParticleWalletPlugin(reactContext: ReactApplicationContext) :
   ReactContextBaseJavaModule(reactContext) {
@@ -71,8 +74,20 @@ class ParticleWalletPlugin(reactContext: ReactApplicationContext) :
   @ReactMethod
   fun init() {
     isUIInit = try {
-      ParticleWallet.init(reactApplicationContext, null)
-      true
+        val success = AtomicBoolean(false)
+        val latch = CountDownLatch(1)
+        runOnUiThread {
+            try {
+                ParticleWallet.init(reactApplicationContext, null)
+                success.set(true)
+            } catch (e: Exception) {
+                // 可以在这里处理异常,比如打印日志
+            } finally {
+                latch.countDown()
+            }
+        }
+        latch.await()
+        success.get()
     } catch (e: Exception) {
       false
     }

error

image

Xcode:14.2
MacOS:13.3.1 (a) (22E772610a)

The Provider does not support the requested method

code

web3_wallet_switchEthereumChain = async () => {
    try {
        const chainId = "0x" + EvmService.currentChainInfo.chain_id.toString(16);
        const result = await web3.currentProvider.request({
            method: 'wallet_switchEthereumChain',
            params: [{ chainId }]
        })
        console.log('web3 wallet_switchEthereumChain', result);
    } catch (error) {
        console.log('web3 wallet_switchEthereumChain', error);
    }

}

web3_wallet_addEthereumChain = async () => {
    try {
        const chainId = "0x" + EvmService.currentChainInfo.chain_id.toString(16);
        const result = await web3.currentProvider.request({
            method: 'wallet_addEthereumChain',
            params: [{ chainId }]
        })
        console.log('web3 wallet_addEthereumChain', result);
    } catch (error) {
        console.log('web3 wallet_addEthereumChain', error);
    }

}

Problem

{
"code": 4200,
"message": "The Provider does not support the requested method"
}

Build Errors in Expo Bare Workflow with Particle React Native Integration

Hello,

I hope this message finds you well. I am currently facing some build errors in my Expo bare workflow project after integrating Particle React Native. I encounter the following errors during the build process:

^ underlying Objective-C module 'EXDevMenuInterface' not found

 ^ failed to verify module interface of 'EXDevMenuInterface' due to the errors above; the textual interface may be broken by project issues or a compiler bug

 ^ underlying Objective-C module 'EXDevMenuInterface' not found

 ^ failed to verify module interface of 'EXDevMenuInterface' due to the errors above; the textual interface may be broken by project issues or a compiler bug

Upon investigating further, I noticed that these errors seem to be related to a change in the Podfile. The problematic code snippet in question is as follows:

   installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
      config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
        end
    end

It appears that the Expo Dev Client may not be compatible with building for distribution, which could be causing this issue. Interestingly, removing these lines of code results in similar errors involving modules like "cryptoswift."

I would greatly appreciate any assistance in resolving this problem. If there are any alternative solutions or workarounds, I would be eager to try them out. Thank you very much for your time and support.

Best regards,
Jan

smartAccountAddress showing undefined

{"avatar": "**c", "created_at": "2024-04-15T14:25:31.000Z", "google_email": "[email protected]", "google_id": "116779180351951502819", "name": "Md. Majedur Rahman 212-15-14708", "security_account": {"has_set_master_password": false, "has_set_payment_password": false}, "thirdparty_user_info": {"provider": "google", "user_info": {"email": "]()", "id": "116779180351951502819", "name": "Md. Majedur Rahman 212-15-14708", "picture": "rAG1TWEBlTw0=s96-c"}}, "token": "523b8075-157e-4805-a025-63374916822d", "updated_at": "2024-04-15T14:25:31.000Z", "uuid": "e815e7da-4b13-4fa2-a330-f613a28bbdd5", "wallets": [{"chain_name": "solana", "public_address": "", "uuid": "c88ed615-fdc0-4fed-8f13-c7649c54b00a"}, {"chain_name": "evm_chain", "public_address": "", "uuid": "4a26aea0-30ba-48d3-a4bb-53ef2e"}]}
LOG is enable true
LOG request body = {"id":"1713205766068","jsonrpc":"2.0","method":"particle_aa_getSmartAccount","params":[{"name":"BICONOMY","version":"1.0.0","ownerAddress":"0x5aED9Eb****"2DC86d647a"}],"chainId":421614}
LOG response result = undefined
LOG result {"data": {"code": 0, "data": "System error"}, "status": 0}
LOG smartAccountAddress undefined in particle-aa project

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.