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
| Prop | Type | Required | Description |
|---|---|---|---|
webpageName | String | ✅ | App display name |
requestData | JSON | ✅ | User data request configuration |
returnLink | String | ✅ | Your app's registered universal link |
autoFetch | Boolean | ❌ | Auto-fetch data on consent |
onResolved | Function | ❌ | Callback with API URL and token |
inferenceData | JSON | If autoFetch | Data for inference |
textColor | String | ❌ | 'black' | 'white' |
textLayout | String | ❌ | 'right' | 'left' | 'below' | 'none' |