SDK Installation
Flutter

Get Started

13min

Our Flutter plugin wrapper makes it easier for you to install the SDK directly on your Flutter app. Follow these simple steps

Add Dependencies

To add the Cooee Flutter plugin to your project, edit your project's pubspec.yaml file:

YAML


Replace x.y.z with the latest release of the SDK

Document image


Or Run command

Shell


This command will add the latest version of cooee_plugin

Configure Credentials

Android setup

Add the following inside the application tag in AndroidManifest.xml present in android/app/src/main/ folder.

XML


iOS setup

Add the following snippet in the app's Info.plist present at ios/Runner/ folder.

plist


Replace MY_COOEE_APP_ID with the App ID which is present at Cooee Portal.

Configure Firebase (Android only)

For Android, Cooee uses Firebase Messaging Service to send push notifications. To enable this feature, follow the steps below:

Register your app with Firebase

  1. To connect your app to firebase, follow Step 2 provided in the firebase documentation.
  2. Once the app is connected to your firebase project, add the google-service.json file in the android/app folder of your project.

Add Firebase messaging service

Note:

This step is required for cooee_plugin: ^1.3.7 and below versions.

Once you registered your app with firebase, add the following inside the application tag in AndroidManifest.xml present at android/app/src/main/ folder

XML


Permission Usage

Android (Optional)

Cooee SDK supports prompting the following permissions via engagement. To make it work, you need to add the following to the app's AndroidManifest.xml file present in android/app/src/main/ folder.

XML


iOS

Cooee SDK uses a few permission if granted (we do not ask explicitly) for analysing the user. This helps us to create and deliver better notifications and in-apps. Apple requires a user-friendly description of such permissions as defined here.

Add the following permission description to App's Info.plist file present at ios/Runner/ folder.

Plist


Import it

Now in your Dart code, import the package and start using it:

Dart


Android 13 and above needs permission to be granted to Post a Notification. You will need to add the below code once the flutter view initializes.

Dart




Updated 25 Mar 2024
Did this page help you?