Demo App
Link to our Flutter Demo App: https://github.com/ravenappdev/raven-flutter-demo
This sample app shows how to use Raven Flutter SDK in your own Flutter app. The Raven Flutter SDK allows you to -
  • Manage (Create/Update) your users and their preferences on Raven.
  • Update notification statuses to Raven for push notification tracking

Raven Flutter SDK

You can visit our SDK docs to setup the Flutter SDK in your app.

How to run this sample app

Step 1.

Run the following commands in the project root directory :f
1
# Install the CLI if not already done so
2
dart pub global activate flutterfire_cli
3
4
# Run the `configure` command, select a Firebase project and platforms
5
flutterfire configure
Copied!
Once configured, a firebase_options.dart file will be generated for you containing all the options required for initialization. The DefaultFirebaseOptions.currentPlatform is imported from our generated firebase_options.dart file and is used for Firebase initialization in the main.dart file.
1
void main() async {
2
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
3
runApp(MyApp());
4
}
Copied!
Note : To run this app on iOS, please follow additional steps here to provide permissions to receive notifications from Firebase cloud messaging on iOS devices.

Step 2.

Replace appId and apiKey in the main.dart file with your own Raven App ID and API Key which you can get from the Raven Console in the Settings tab.
App ID and API Key

Step 3.

Change event name to your Raven push event name and user parameters to the details of the corresponding user you want to register to the Raven app.
If you haven’t created a Raven Push event in the Raven console yet check our docs here.
Event Name and User details

Step 4.

After completing the above steps, run the “flutter run” command to run this sample app.
Once the app runs the following screen appears.
  • Set User button creates/updates the user provided in the Raven app.
  • Set Device Token button adds the device token to the previously created user.
  • Send Message button is a test method provided in the Raven Sdk to send a notification to the devices of the registered user.
You can also directly send a notification to a device from the Raven console. Go to your event and click the send button of your push event and then use the FCM token of the device to send the event.