Registered StackHub users may elect to receive email notifications whenever a new package version is released or a comment is posted on the forum.
There are 0 watchers.
This pod helps to integrate Pushy mobile notifications with SkySpark. It delivers Sparks and Arc Notes as push notifications to iOS/Android devices and provides device registration, topic creation/subscription, consoles, and history.
You will need a Pushy account and API key. Obtain an API key from your Pushy dashboard and keep it secure. Do not commit secrets to source.
In code, PushyClient is initialized with a base URL and API key. Replace the API key with yours and rebuild/publish the pod as needed.
- Location : `fan/BassgPushyLib.fan` - Client initialization : `PushyClient("https://api.pushy.me", "<YOUR_PUSHY_API_KEY>")` - Security : Use secure config/secrets management in production
After installation, an app named "Pushy Class" appears with views for company management, Spark/Arc notify classes, consoles, device management, subscriptions, and history.
- App name : `Pushy Class` - Views : `Spark Notify Classes`, `Arc Notes Notify Classes`, `Sparks Console`, `Arc Note Console`, `Device Management`, `Subscription Management`, `Notification History`, `Company Management` - Source : `lib/views/*.trio`
Define which Sparks/Arc Notes should generate notifications. Creating these records also sets up background jobs/tasks.
- Create Spark notify : `createNewNotifyRec(dis, sparkRuleRefs, siteRefs, companyRef)` - Create Arc Note notify : `createNewNotifyArcNotesRec(dis, siteRefs, companyRef)` - Auto scheduler setup : `createJobsAndTasks()`
Register user devices with their Pushy device token.
- Register device : `registerDevice("<device-token>", "John's iPhone", "john.doe", "ios")` - Edit / Unregister : `editDeviceAction`, `unregisterDevice(deviceToken)` - List active devices : `getActiveDevices()`
Create an encoded topic key for company/site/equip context and subscribe devices to receive notifications.
- Create topic : `topic: createTopic([@siteRef], @companyRef, [@equipRef], "spark"|"arcNote")` - Subscribe : `subscribeDeviceToTopic("<device-token>", topic->dis)` - Unsubscribe : `unsubscribeDeviceFromTopic("<device-token>", topic->dis)` - Encoding helper : `escapePushyUriEncode(str, 100)`
You can also send notifications directly from Axon.
- Basic : `bassgSendNotification("<device-token>", "Spark Alert", "High temp at AHU-1")` - With category/context : `bassgSendNotificationWithCategory(to, title, data, "notification_actions", notificationId, equipName, equipType)`
Background processing is handled by a job and a task. These are created automatically by createJobsAndTasks() and can be rebuilt using restartScheduler().
- Job : "Snooze Time Job" - runs every 1 minute (updates snooze and sends due notifications) - Task : "Check Spark and arcNote Classes" - runs every 5 minutes (populates Spark/Arc Note consoles)
- Empty topic list : Verify Pushy API key and internet access; check `PushyClient` logs - No notifications : Ensure device `subscriptions` contain the correct encoded topic; check `notificationSent` flags in consoles; verify schedulers - Matching issues : Always use keys produced by `escapePushyUriEncode`; site-level and equipment-level matches are supported
- Topics : `bassgTopics()`, `bassgSubscribers(topic)` - Subscribe/Unsubscribe : `bassgSubscribe(deviceToken, topics)`, `bassgUnsubscribe(deviceToken, topics)` - Notifications : `bassgSendNotification(...)`, `bassgSendNotificationWithCategory(...)` - Admin : `createNewNotifyRec(...)`, `createNewNotifyArcNotesRec(...)`, `createJobsAndTasks()`, `restartScheduler()` - Devices : `registerDevice(...)`, `unregisterDevice(...)`, `getActiveDevices()`, `getDevicesByUser(userId)` - History/Console : `getAllNotifications()`, `notificationsForDevice(deviceToken, span)` - Snooze/Ack : `snoozeNotification(id, mins)`, `unsnoozeNotification(id)`, `acknowledgeNotification(id, userId)`
Commercial - © Ankalabs Inc.
- Pod : `bassgPushy` - SkyArc index : `bassgPushy::BassgPushyExt`, `bassgPushy::BassgPushyLib` - CI variables : `StackhubUsername`, `StackhubPassword`, `RELEASE_STATUS`
bassgPushy delivers SkySpark Sparks and Arc Notes as push notifications to mobile devices. It includes device registration, topic creation/subscription, consoles and history views, plus Axon functions for full automation.
== Features
== Requirements
Dependencies (auto-managed): sys, web, util, dom, domkit, afJson, sql, ui, connExt, axon, folio, skyarcd, skyarc, haystack (matched to your SkySpark version).
== Installation
1) Install from StackHub: add the bassgPushy pod to your project and restart SkyArc. 2) The app appears in the menu as "Pushy Class". 3) Provide your Pushy API key (see Configuration).
Note: This pod is "Commercial" licensed.
== Configuration
== App and Views
App name: "Pushy Class"
Views are defined under lib/views/*.trio and wired to Axon functions via create/edit/delete actions.
== Typical Workflow
1) Add a company: Company Management > Create Rec (or addCompany("Acme")) 2) Create notify classes:
== Key Records
== Axon Functions (selected)
Pushy API wrappers:
Administration & workflow:
Helper:
- Add a company: addCompany("Acme Corp") - Create a Spark notify class (via UI or Axon): createNewNotifyRec("Spark Alerts", [@sparkRuleRef1, @sparkRuleRef2], [@siteRef], @companyRef) - Register a device: registerDevice("<pushy-device-token>", "John's iPhone", "john.doe", "ios") - Create a topic and subscribe a device: topic: createTopic([@siteRef], @companyRef, [@equipRef], "spark") subscribeDeviceToTopic("<pushy-device-token>", topic->dis) - Send a manual notification: bassgSendNotification("<pushy-device-token>", "Spark Alert", "High temp at AHU-1")
== Schedulers and Tasks
Both are created by createJobsAndTasks(); use restartScheduler() to rebuild if needed.
== License
Commercial - © Ankalabs Inc.
== Versioning & Publishing
Version | 3.1.8.4Beta |
---|---|
License | n/a |
Build date | 6 days ago on Wed 1st Oct |
Requirements | SkySpark v3.1.8 |
Depends on | |
File name | bassgPushy.pod |
File size | 38.09 kB |
MD5 | 40686f1783dfd276ad629c2b3f5236d2 |
SHA1 | 85e24472954dd63723029d91717f8193c995bf6e |
Published by BASSGDownload nowAlso available via SkyArc Install Manager |