Features Solutions Technology Tokenomics Docs About
Docs / SDK & Libraries / Mobile SDKs

Mobile SDKs

Build native mobile apps with TAG IT verification across all major platforms.

Supported Platforms

TAG IT Network provides native SDKs for all major mobile platforms, enabling seamless NFC scanning and product verification in your mobile applications:

iOS SDK

The iOS SDK provides native Swift integration for iPhone and iPad applications with full NFC scanning capabilities.

Installation

Install the TAG IT iOS SDK using CocoaPods or Swift Package Manager:

CocoaPods

# Add to your Podfile
pod 'TagItSDK', '~> 2.0'

# Then run
pod install

Swift Package Manager

// In Xcode: File > Add Packages
// Enter the repository URL:
// https://github.com/TAG-IT-NETWORK/tagit-ios-sdk

// Or add to Package.swift:
dependencies: [
    .package(url: "https://github.com/TAG-IT-NETWORK/tagit-ios-sdk", from: "2.0.0")
]
Note

NFC scanning requires iOS 13.0+ and an iPhone 7 or later. Add the NFCReaderUsageDescription key to your Info.plist.

Basic Usage

import TagItSDK

class VerificationViewController: UIViewController {
    private let tagIt = TagIt(apiKey: "your_api_key")

    override func viewDidLoad() {
        super.viewDidLoad()
        setupNFCScanning()
    }

    func setupNFCScanning() {
        // Start NFC scanning session
        tagIt.startNFCSession { [weak self] result in
            switch result {
            case .success(let tag):
                self?.verifyProduct(tagId: tag.identifier)
            case .failure(let error):
                print("NFC scan failed: \(error.localizedDescription)")
            }
        }
    }

    func verifyProduct(tagId: String) {
        tagIt.products.verify(tagId: tagId) { result in
            switch result {
            case .success(let verification):
                print("Product verified: \(verification.isAuthentic)")
                print("Product name: \(verification.metadata.productName)")
                print("Current owner: \(verification.currentOwner)")
            case .failure(let error):
                print("Verification failed: \(error.localizedDescription)")
            }
        }
    }
}

Android SDK

The Android SDK provides native Kotlin integration with comprehensive NFC support for Android devices.

Installation

Add the TAG IT SDK to your Android project using Gradle:

// Add to your app/build.gradle
dependencies {
    implementation 'network.tagit:sdk:2.0.0'
}

// Add to your project/build.gradle (if not using mavenCentral)
allprojects {
    repositories {
        mavenCentral()
        maven { url 'https://maven.tagit.network/releases' }
    }
}

Add NFC permissions to your AndroidManifest.xml:

<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="true" />

<activity android:name=".MainActivity">
    <intent-filter>
        <action android:name="android.nfc.action.NDEF_DISCOVERED" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

Basic Usage

import network.tagit.sdk.TagIt
import network.tagit.sdk.models.VerificationResult

class MainActivity : AppCompatActivity(), TagIt.NFCListener {
    private lateinit var tagIt: TagIt

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        // Initialize the SDK
        tagIt = TagIt.Builder(this)
            .setApiKey("your_api_key")
            .setNetwork(TagIt.Network.MAINNET)
            .build()

        // Enable NFC scanning
        tagIt.enableNFCScanning(this)
    }

    override fun onTagDiscovered(tagId: String) {
        // Verify the product when NFC tag is scanned
        tagIt.products.verify(tagId) { result ->
            when (result) {
                is VerificationResult.Success -> {
                    Log.d("TagIt", "Product verified: ${result.isAuthentic}")
                    Log.d("TagIt", "Product: ${result.metadata.productName}")
                    Log.d("TagIt", "Owner: ${result.currentOwner}")
                }
                is VerificationResult.Error -> {
                    Log.e("TagIt", "Verification failed: ${result.message}")
                }
            }
        }
    }

    override fun onResume() {
        super.onResume()
        tagIt.resumeNFCScanning()
    }

    override fun onPause() {
        super.onPause()
        tagIt.pauseNFCScanning()
    }
}

React Native SDK

The React Native SDK enables cross-platform mobile development with a unified JavaScript API.

Installation

# Install the SDK
npm install @tagit/react-native-sdk

# Install peer dependencies
npm install react-native-nfc-manager

# For iOS, install pods
cd ios && pod install && cd ..

# Link native modules (React Native < 0.60)
react-native link @tagit/react-native-sdk
Configuration Required

For iOS, add NFCReaderUsageDescription to Info.plist. For Android, add NFC permissions to AndroidManifest.xml as shown in the Android section above.

Basic Usage

import React, { useState, useEffect } from 'react';
import { View, Text, Button, Alert } from 'react-native';
import { TagIt, useNFCScanner } from '@tagit/react-native-sdk';

// Initialize the SDK
const tagIt = new TagIt({
  apiKey: 'your_api_key',
  network: 'mainnet'
});

function ProductVerificationScreen() {
  const [verificationResult, setVerificationResult] = useState(null);
  const { isScanning, startScan, stopScan } = useNFCScanner();

  const handleScan = async () => {
    try {
      const tag = await startScan();

      // Verify the scanned product
      const result = await tagIt.products.verify(tag.id);
      setVerificationResult(result);

      if (result.verified) {
        Alert.alert('Success', `Product "${result.metadata.productName}" is authentic!`);
      } else {
        Alert.alert('Warning', 'This product could not be verified.');
      }
    } catch (error) {
      Alert.alert('Error', error.message);
    }
  };

  return (
    <View style={{ flex: 1, padding: 20 }}>
      <Button
        title={isScanning ? 'Scanning...' : 'Scan Product'}
        onPress={handleScan}
        disabled={isScanning}
      />

      {verificationResult && (
        <View style={{ marginTop: 20 }}>
          <Text>Product: {verificationResult.metadata.productName}</Text>
          <Text>Brand: {verificationResult.metadata.brand}</Text>
          <Text>Verified: {verificationResult.verified ? 'Yes' : 'No'}</Text>
        </View>
      )}
    </View>
  );
}

export default ProductVerificationScreen;

Flutter SDK

The Flutter SDK provides a Dart-native implementation for building cross-platform mobile apps.

Installation

Add the TAG IT SDK to your pubspec.yaml:

dependencies:
  flutter:
    sdk: flutter
  tagit_sdk: ^2.0.0
  nfc_manager: ^3.2.0

Then run:

flutter pub get

Basic Usage

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

class ProductVerificationScreen extends StatefulWidget {
  @override
  _ProductVerificationScreenState createState() => _ProductVerificationScreenState();
}

class _ProductVerificationScreenState extends State<ProductVerificationScreen> {
  final TagIt _tagIt = TagIt(apiKey: 'your_api_key');
  VerificationResult? _result;
  bool _isScanning = false;

  Future<void> _startNFCScan() async {
    setState(() => _isScanning = true);

    try {
      // Start NFC scanning
      final tag = await _tagIt.startNFCSession();

      // Verify the product
      final result = await _tagIt.products.verify(tag.identifier);

      setState(() {
        _result = result;
        _isScanning = false;
      });

      if (result.verified) {
        ScaffoldMessenger.of(context).showSnackBar(
          SnackBar(content: Text('Product verified successfully!')),
        );
      }
    } catch (e) {
      setState(() => _isScanning = false);
      ScaffoldMessenger.of(context).showSnackBar(
        SnackBar(content: Text('Error: ${e.toString()}')),
      );
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Product Verification')),
      body: Padding(
        padding: EdgeInsets.all(16),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            ElevatedButton(
              onPressed: _isScanning ? null : _startNFCScan,
              child: Text(_isScanning ? 'Scanning...' : 'Scan Product'),
            ),
            if (_result != null) ...[
              SizedBox(height: 20),
              Card(
                child: Padding(
                  padding: EdgeInsets.all(16),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text('Product: ${_result!.metadata.productName}'),
                      Text('Brand: ${_result!.metadata.brand}'),
                      Text('Verified: ${_result!.verified ? "Yes" : "No"}'),
                      Text('Owner: ${_result!.currentOwner}'),
                    ],
                  ),
                ),
              ),
            ],
          ],
        ),
      ),
    );
  }
}

Common Features

All mobile SDKs share these core features for seamless product authentication:

NFC Scanning

Built-in NFC tag reading with support for various tag types:

Product Verification

Real-time verification against the blockchain:

Offline Mode

Continue operating even without internet connectivity:

Need Help?

Check out our Product Tagging Tutorial for a complete walkthrough, or join our Discord community for real-time support.

Edit this page on GitHub
Type to search documentation...