Mobile Integration

Integrate Onairos into Flutter, React Native, or Swift applications.

Updated 27 December 2024
mobileflutterreact-nativeswiftiosandroid

Mobile Integration

Integrate Onairos into your mobile application with our native SDKs for Flutter, React Native, and Swift.

Before You Begin

Create a Developer account at onairos.uk/dev-board and register your app's universal link.

Installation

Flutter (Dart)

dart pub get onairos
import 'package:onairos/onairos.dart';

React Native

npm install @onairos/react-native
import { OnairosButton } from '@onairos/react-native';

One Line Integration

React Native

<OnairosButton
  AppName="YourAppName"
  onResolved={handleComplete}
  requestData={{
    personality_traits: {
      name: "Personality Analysis",
      description: "AI analysis of your social media personality",
      reward: "Personalized recommendations"
    },
    sentiment_analysis: {
      name: "Interest Analysis", 
      description: "Understanding your interests and preferences",
      reward: "Content tailored to your interests"
    }
  }}
  debug={true}
  testMode={true}
  auto={true}
/>

Flutter (Dart)

OnairosButtonWrapper1(
  webpageName: 'Mobile App', 
  requestData: requestData,
  returnLink: 'yourapp://returnlink',  // Your universal link
  autoFetch: true,
  onResolved: onResolved,
  inferenceData: data,
  proofMode: false,
  textColor: 'black',
  textLayout: 'right',
)

Button Props

PropTypeRequiredDescription
webpageNameStringApp display name
requestDataJSONUser data request configuration
returnLinkStringYour app's registered universal link
autoFetchBooleanAuto-fetch data on consent
onResolvedFunctionCallback with API URL and token
inferenceDataJSONIf autoFetchData for inference
textColorString'black' | 'white'
textLayoutString'right' | 'left' | 'below' | 'none'

Next Steps