> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gameball.co/llms.txt
> Use this file to discover all available pages before exploring further.

# How Do I Get Started with the Flutter SDK (v4)?

> Install Gameball Flutter SDK v4.0.0

# Getting Started

## Requirements

* **Minimum Flutter Version**: 1.17.0
* **Dart**: 3.4.4+
* **Android**: API level 24+ (Android 7.0)
* **iOS**: iOS 15.0+

> [!NOTE]
>
> **Upgrading from v3?** Version 4.0.0 raises the minimum versions to iOS 15.0 and Android API 24. Every v3 call works unchanged. See [Migration Notes](https://docs.gameball.co/installation-guides/v4/flutter/migration-notes.md).

## Install the SDK

Add the dependency to your `pubspec.yaml`:

```yaml theme={null}
dependencies:
  gameball_sdk: ^4.0.0
```

Then run:

```bash theme={null}
flutter pub get
```

## iOS Setup

Make sure your iOS deployment target is at least 15.0. In your `ios/Podfile`:

```ruby theme={null}
platform :ios, '15.0'
```

Set `IPHONEOS_DEPLOYMENT_TARGET` to 15.0 for the Runner target in Xcode as well.

Run:

```bash theme={null}
cd ios && pod install
```

> [!NOTE]
>
> After updating the Podfile, run `pod install` to ensure all iOS dependencies are properly configured.

## Android Setup

Ensure `INTERNET` permission is declared in `AndroidManifest.xml`:

```xml theme={null}
<uses-permission android:name="android.permission.INTERNET" />
```

Your `android/app/build.gradle` should have minimum SDK version 24:

```gradle theme={null}
android {
    defaultConfig {
        minSdkVersion 24
        targetSdkVersion 34
    }
}
```

## Verify Installation

After installing, import the package in your Dart code to verify:

```dart theme={null}
import 'package:gameball_sdk/gameball_sdk.dart';
```

If there are no import errors, you're ready to initialize the SDK!

## Troubleshooting

### Common Issues

> [accordion] API Key Not Initialized Error
>
> **Error:** `API key is not initialized. Call init() first`
>
> **Solution:** Ensure you call `gameballApp.init(config)` before any other SDK methods, preferably in your `main()` function before `runApp()`.

> [accordion] Invalid Customer ID Error
>
> **Error:** `Customer ID cannot be empty`
>
> **Solution:** Provide a valid, non-empty customer ID in your requests. The customer ID should be a permanent identifier for the user.

> [accordion] Push Provider Validation Error
>
> **Error:** `Device token is required when push provider is set`
>
> **Solution:** When setting a push provider, ensure you also provide a valid device token. Both must be set together.

> [accordion] Build Errors on iOS
>
> **Symptoms:** Pod installation or build failures on iOS
>
> **Solutions:**
>
> * Clean build folder: `cd ios && xcodebuild clean`
> * Reinstall pods: `cd ios && pod install --repo-update`
> * Ensure iOS deployment target is at least 15.0

> [accordion] Build Errors on Android
>
> **Symptoms:** Gradle build failures
>
> **Solutions:**
>
> * Clean gradle cache: `cd android && ./gradlew clean`
> * Verify minimum SDK version is 24 in `build.gradle`
> * Check React Native version compatibility

### Debug Logging

Enable Flutter's debug logging to see detailed SDK operation logs:

```bash theme={null}
flutter run --verbose
```

> [!TIP]
>
> For verbose logging during development, run your app with the `--verbose` flag to see detailed SDK logs and network operations.

In-app messaging logs separately, prefixed `[GameballIAM]`. See [In-App Messaging](https://docs.gameball.co/installation-guides/v4/flutter/in-app-messaging.md#logging-and-troubleshooting).

## Next Steps

* [Initialize SDK](https://docs.gameball.co/installation-guides/v4/flutter/initialize-sdk.md)
* [Initialize Customer Profile](https://docs.gameball.co/installation-guides/v4/flutter/initialize-profile.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.