Installation and Integration

To install and integrate the mini-app SDK, follow these steps:

  1. Install CocoaPods (if you haven't already)
    If you haven't installed CocoaPods yet, open your terminal and run the following command:
sudo gem install cocoapods
  1. Initialize CocoaPods in Your Xcode Project
    Navigate to your project directory in the terminal. If your project isn't already set up with CocoaPods, run:
   pod init  

This will create a Podfile in your project directory.

  1. Edit the Podfile
    Open the Podfile in any text editor or directly from Xcode (right-click the file and select "Open With Xcode").
    Add the pod you want to install under the target section. For example, if you want to install the OpenWeb3Lib library, your Podfile might look like this:
   # Uncomment the next line to define a global platform for your project
   platform :ios, '13.0'  
   target 'YourApp' do
   # Comment the next line if you don't want to use dynamic frameworks
     use_frameworks!
   # Pods for YourApp
     xcode_version = %x(xcodebuild -version).strip  
     if xcode_version.include?("Xcode 15")  
       pod 'OpenWeb3Lib', '1.0.3-swift5.9'  
     elsif xcode_version.include?("Xcode 16.0")  
       pod 'OpenWeb3Lib', '1.0.3-swift6.0'  
     else  
       pod 'OpenWeb3Lib', '1.0.3-swift6.0.2'  
     end  
   end
  1. Install the Pods
    After saving the Podfile, go back to your terminal and run the following command:
pod install  

CocoaPods will fetch the libraries specified in your Podfile and install them into your project.
Important: After running pod install, CocoaPods will generate an .xcworkspace file. From now on, always open your project using the .xcworkspace file (instead of the .xcodeproj file) to ensure that CocoaPods is properly integrated with your project.

  1. Open the Workspace
  2. Import and Use the Pod in Your Code
import OpenWeb3Lib

Then you can use OpenWeb3Lib's functionality as required in your project