Ethereum React Native Chat Boilerplate Questions

I’m working in VS code, and I don’t know how to clean the build folder, could you please help me out

@MOUAD you can do it by opening Xcode. Open your project by clicking File -> Open... then navigate to the project’s ios folder and select moraliscreatereactnativedapp.xcworkspace. You can also run the project here by clicking on the play button or going to menu then Product -> Build.
To clean the build folder, go to menu then Product -> Clean Build Folder.

When I run my app on Expo I only get this, and nothing happens

@MOUAD you can run the app with this command instead: yarn ios.

  • For physical IOS Device: Open the moraliscreatereactnativedapp.xcworkspace from ios folder in Xcode. Run the App by choosing your connected physical device.
  • for emulator Make sure you have Xcode or atleast Xcode command line tools installed.
1 Like

is there a way to run it with Expo ? I can’t use Xcode on my windows.

@MOUAD expo is currently not working in this boilerplate. For windows, here’s a quick guide for installing Android Studio:

After Android Studio installation and setup, go to your project folder and run yarn install.Connect your physical android device and run adb devices on your terminal to check if your device is being detected. If yes, then try to build/run the app by doing yarn android.

well, my friend, I followed your instructions and turned out I get the same thing at the Android simulator too. Same picture and no error is showing

Usually, when the build cannot connect to metro it shows this screen and does nothing. You can try doing adb reverse tcp:8081 tcp:8081 to get your metro connected. This helped me when I faced this issue.

For IOS updating your physical device, your xcode and your machine.
I also change de version on the IOS podfile and now it works

Here is also the Cloud Function

//Get All Messages
Moralis.Cloud.define("getAllMessages", async function (request) {
  
  const query = new Moralis.Query("Messages");
  const result = await query.find();
  const userQuery = new Parse.Query("User");
  const userResult = await userQuery.find({ useMasterKey: true});

  logger.info("data", result);
  const messages = result.map((data) => {
    return userResult.map((rest) => {
      if (data.attributes.userId === rest.id) {
        return {
          data,
          userId: rest.id,
          userName: rest.attributes.username,
          ethAddress: rest.attributes.ethAddress,
          profilePicture: rest.attributes.profilePicture,
        }
      }
    }).filter(n => n);
  })
  return messages;
});
  
Moralis.Cloud.define("getTypingUser", async function (request) {
  const query = new Moralis.Query("UserTyping");
  query.equalTo("userId", request.params.userId);
  const result = await query.find();
  return result;
});

Hello,
How to let only owner of an nft collection to join the group chat ?
Thanks

You could use the API e.g. getTokenIdMetadata to find the owner_of address of a particular NFT and only allow access based on this ownership.

If you mean owner of the contract, you could call the owner function on the contract to get the owner address.