Flutter Integration

Plugin SDK Version 1.0.1

This guide is intended for Publishers looking to monetize applications developed in Flutter for either iOS or Android platforms.

After this simple integration process, Start.io In-App Ads enables you to reap the benefits of Start.io's In-App monetization products, which maximize the revenue generated by your application. All this profit-making is achieved with minimal effort and minimal interference with your users’ experience.

 

Supported Platforms

  • Android
  • iOS

Supported Formats

  • Banner
  • Interstitial
  • Rewarded Video
  • Native

Getting Started

Add the following to your pubspec.yaml file:

dependencies:
   startapp_sdk: '<LATEST_VERSION>' 

Install the package from the command line: 

flutter pub get

Android Specific Setup 

Mandatory

Add your App ID to your app's AndroidManifest.xml file by adding the <meta-data> tag shown below. You can find your App ID in the Start.io Portal. For android:value, insert your App ID in quotes, as shown below.

<!-- TODO replace YOUR_APP_ID with actual value -->
<meta-data
    android:name="com.startapp.sdk.APPLICATION_ID"
    android:value="YOUR_APP_ID" />
IMPORTANT NOTE:
Replace "YOUR_APP_ID" with your own value provided in the developers’ portal.
To find your application ID, click on the "My Apps" tab on the left pane and choose the relevant ID from your app list:
your_app_ID.png

Optional

Return Ads are enabled by default. If you want to disable them, add another <meta-data> tag into AndroidManifest.xml file.

<!-- TODO Return Ad controlled by the android:value below -->
<meta-data
    android:name="com.startapp.sdk.RETURN_ADS_ENABLED"
    android:value="false" />

Splash Ads are enabled by default. If you want to disable them, add <provider> tag into AndroidManifest.xml file with another <meta-data> tag nested in that provider as shown below.

<!-- TODO Splash Ad controlled by the android:value below -->
<provider
    android:authorities="com.startapp.flutter.sdk.${applicationId}"
    android:name="com.startapp.flutter.sdk.StartAppFlutterHelper"
    android:exported="false">
    <meta-data
        android:name="com.startapp.sdk.SPLASH_ADS_ENABLED"
        android:value="false" />
</provider>

 

iOS specific setup

Mandatory

Add your App ID to your app's Info.plist for key com.startapp.sdk.APPLICATION_ID You can find your App ID on the Start.io Portal.

<!-- TODO replace YOUR_APP_ID with actual value -->
    <key>com.startapp.sdk.APPLICATION_ID</key>
    <string>YOUR_APP_ID</string>>

Optional

Return Ads are enabled by default. If you want to disable them, set  NO for  com.startapp.sdk.RETURN_ADS_ENABLED in yourInfo.plist.

<key>com.startapp.sdk.RETURN_ADS_ENABLED</key>
<false/>

 

Splash Ads are disabled by default. If you want to enable them, set YES for  com.startapp.sdk.SPLASH_ADS_ENABLED key in yourInfo.plist.

<key>com.startapp.sdk.SPLASH_ADS_ENABLED</key>
<true/>

 

NOTE:
  • The Start.IO SDK doesn't contain arm64 slice for iOS simulator. Therefore, if needed,  you would be required to modify the relevant settings following the instructions below

 

In order to build your app for iOS simulator on Apple silicon computer the Excluded Architecturesbuild setting for iOS simulator should contain arm64. Flutter generates xcconfig file Generated.xcconfig with EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386  and ignores those settings, specified in podspec file. 

Needed Modification settings for arm64 slice for iOS simulator:

  1. Open the default Xcode workspace in your project by running open ios/Runner.xcworkspace in a terminal window from your Flutter project directory.
  2. Select Runner project in Project navigator
  3. Select Runner Target
  4. Click on Build Settings tab
  5. Find Exluded Architectures
  6. Add arm64 for Any iOS Simulator SDK


add_arm64_to_exluded_archs.png

Initializing the Plugin

Get an instance of StartAppSdk by calling its default constructor. It is safe to call this constructor multiple times - you'll get the same singleton instance.

class _MyAppState extends State < MyApp >  {
    var startAppSdk = StartAppSdk();
}

 

Was this article helpful?
Have more questions? submit a request