Hey I'm trying to use this plugin for my mobile application. I have all the client stuff set up, but don't see anything for server actions. The documentation provided tells you to add the OneSignalAPI as part of your dependencies but that isn't an option in ODC. I tried searching the forge for this as well and couldn't find anything. Any ideas? Or is this just not ready for ODC yet?
I'm not sure ONesignal plugin fully suporting in ODC or not but possible Workarounds to Use OneSignal in ODC
1. Use OneSignal's REST API for Server-Side Actions
Since the OneSignalAPI module is missing in ODC, you can directly call OneSignal's REST API to send notifications from your server actions.
Steps to implement:
Go to the OneSignal REST API Documentation: OneSignal API Docs
In ODC, create a REST API integration and configure the following request:
Endpoint:
bashCopyEditPOST https://onesignal.com/api/v1/notifications
Headers:
jsonCopyEdit{ "Content-Type": "application/json", "Authorization": "Basic YOUR_REST_API_KEY"}
Body Example (Sending Push Notification):
jsonCopyEdit{ "app_id": "YOUR_ONESIGNAL_APP_ID", "included_segments": ["All"], "headings": {"en": "Test Notification"}, "contents": {"en": "This is a test push from ODC."}}
Use this REST API call inside your ODC server action to send push notifications.
2. Use OneSignal SDK for Client-Side Implementation (JavaScript)
If your app only needs client-side push notifications, you can integrate OneSignal's JavaScript SDK in ODC.
javascriptCopyEditOneSignal.push(function() { OneSignal.init({ appId: "YOUR_ONESIGNAL_APP_ID", safari_web_id: "YOUR_SAFARI_WEB_ID", // Optional for Safari support notifyButton: { enable: true } });});
javascriptCopyEditOneSignal.on('notificationDisplay', function(event) { console.log("Notification displayed:", event);});
Ya I started messing around with the REST API and just writing my own server actions, looks like that may be what I have to do. Not sure why it is missing on ODC.
@Spencer Buhler : This is an OutSystems supported component and hence you may create a support ticket. Meanwhile, someone used this component in ODC may be able to assist.