Onesignal in flutterflow

I'm currently developing e-commerce applications with the help of FlutterFlow. I'm using the WebView widget for displaying web content and implementing a navigation bar (NavBar) for each page of the app. However, I'm facing an additional challenge. FlutterFlow doesn't have native support for OneSignal push notifications, and my client prefers not to use Firebase. Therefore, I need to integrate OneSignal into FlutterFlow. I've already seen tutorials on how to set this up in Flutter, and I also need to change the agent user of the WebView widget.

As such, I would prefer to hire you as a mentor to assist me in moving forward with the project.

I need to integrate OneSignal into FlutterFlow. Currently, FlutterFlow does not have native support for OneSignal push notifications. As a result, I am looking to establish a connection or integration between the FlutterFlow platform and OneSignal's services. This integration will enable the delivery of push notifications to users of the mobile applications I am developing within FlutterFlow. I may also need to make adjustments to the WebView widget and potentially configure the OneSignal agent user, as WebView and push notification services often require specific configurations for seamless functionality.

Upvotes: 0

Views: 819

Answers (2)

umar_baloch
umar_baloch

Reputation: 191

good news! Flutterflow natively supports OneSignal.

Upvotes: -1

Bill L.
Bill L.

Reputation: 131

  1. Create a Custom Action named initOneSignal()

  2. Add Pubspec Dependencies onesignal_flutter: ^5.0.0, this tells FlutterFlow to import OneSignal Flutter SDK during compilation

You should have something like this

// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!

// Set your action name, define your arguments and return parameter,
// and then add the boilerplate code using the button on the right!

import 'package:onesignal_flutter/onesignal_flutter.dart';

Future<void> initOneSignal() async {
  OneSignal.Debug.setLogLevel(OSLogLevel.verbose);

  OneSignal.initialize("YOUR_APP_ID_FROM_ONE_SIGNAL_HERE");

  OneSignal.Notifications.requestPermission(true);
}
  1. Under Custom Files > main.dart, add initOneSignal into Final Actions. That way, your customer action is called during the initialization stage.

I have tested on Android for this, but haven't got any luck with iOS. If anyone can shed some light that'd be great.

Upvotes: 4

Related Questions