Send OneSignal notification using API in flutter on specific time

41 Views Asked by At

I want to send notification with API of OneSignal in Flutter. On tap of container i want to fire a notification.

I want a method which define all the logic for that. also need code for initializing the onesignal SDK in flutter.

1

There are 1 best solutions below

0
boze-noob On

This example project will be a great starting point on your journey to implement OneSignal push notifications for your Flutter app.

https://github.com/OneSignal/OneSignal-Flutter-SDK/blob/main/example/lib/main.dart

It initializes the OneSignal SDK with desired settings and adds event listeners for notification clicks and in-app message clicks. The UI includes buttons for actions like sending tags, prompting for push permission, and providing GDPR consent, with each button enabling or disabling based on certain conditions. Overall, the file demonstrates how to manage push notifications and user interactions with OneSignal in a Flutter application.