You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -253,12 +274,49 @@ Separate SectionCard titled "User":
253
274
- Toggle: "Location Shared" / "Share device location with OneSignal"
254
275
- PROMPT LOCATION button
255
276
256
-
### Prompt 2.14 - Secondary Screen
277
+
### Prompt 2.14 - Live Activities Section (iOS Only)
278
+
279
+
Only shown on iOS. Requires an iOS Widget Extension target with a Live Activity using `DefaultLiveActivityAttributes` from the OneSignal SDK.
280
+
281
+
- Title: "Live Activities" with info icon
282
+
- Input card with two editable fields (pre-filled, not empty):
283
+
- "Activity ID" (default: "order-1") — identifies the Live Activity for all operations
284
+
- "Order #" (default: "ORD-1234") — attribute set at start, immutable after
285
+
- Four buttons:
286
+
1. START LIVE ACTIVITY — calls `OneSignal.LiveActivities.startDefault(activityId, attributes, content)` with initial order status. Disabled when Activity ID is empty.
287
+
2. UPDATE → {NEXT STATUS} — cycles through order statuses via REST API (`event: "update"`). Label dynamically shows the next status (e.g. "UPDATE → ON THE WAY"). Disabled when Activity ID is empty, while updating, or when no API key is configured.
288
+
3. STOP UPDATING LIVE ACTIVITY — calls `OneSignal.LiveActivities.exitDefault(activityId)` to unsubscribe from remote updates. Outlined style. Disabled when Activity ID is empty.
289
+
4. END LIVE ACTIVITY — ends the activity via REST API (`event: "end"`) with `dismissal_date`. Destructive style. Disabled when Activity ID is empty or when no API key is configured.
290
+
291
+
Order status cycle (content state fields: `status`, `message`, `estimatedTime`):
257
292
258
-
Launched by "Next Activity" button at bottom of main screen:
- If the file `examples/demo/ios/OneSignalWidget/OneSignalWidgetLiveActivity.swift` already exists, replace its contents with the shared reference implementation at `https://raw.githubusercontent.com/OneSignal/sdk-shared/main/demo/LiveActivity.swift`
306
+
307
+
API key setup:
308
+
309
+
- Store REST API key in `.env` file (e.g. `ONESIGNAL_API_KEY=your_rest_api_key`)
310
+
- Provide `.env.example` with placeholder value
311
+
- Add `.env` to `.gitignore`
312
+
-`hasApiKey()` on the API service checks that the key is present and not the placeholder
313
+
314
+
### Prompt 2.15 - Secondary Screen
315
+
316
+
Launched by "Next Screen" button at bottom of main screen:
317
+
318
+
- Title: "Secondary Screen"
319
+
- Centered large headline text "Secondary Screen"
262
320
263
321
---
264
322
@@ -431,6 +489,7 @@ All actions show brief feedback via platform's transient message (SnackBar/Toast
431
489
- IAM: "Sent In-App Message: {type}"
432
490
- Outcomes: "Outcome sent: {name}"
433
491
- Events: "Event tracked: {name}"
492
+
- Live Activities: "Started Live Activity: {activityId}", "Updated Live Activity: {activityId}", "Ended Live Activity: {activityId}", "Exited Live Activity: {activityId}" / "Failed to update Live Activity" / "Failed to end Live Activity"
434
493
435
494
Clear previous message before showing new. All messages also logged via LogManager.i().
REST API key is NOT required for the fetchUser endpoint.
444
503
504
+
REST API key IS required for Live Activity update/end operations. Store in `.env` as `ONESIGNAL_API_KEY`. Disable update/end buttons when not configured.
505
+
445
506
Identifiers MUST be `com.onesignal.example` to work with existing `google-services.json` and `agconnect-services.json`.
Copy file name to clipboardExpand all lines: demo/tooltip_content.json
+22Lines changed: 22 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -78,5 +78,27 @@
78
78
"description": "Takes over the entire screen. Best for onboarding, promotions, or rich media content."
79
79
}
80
80
]
81
+
},
82
+
"liveActivities": {
83
+
"title": "Live Activities",
84
+
"description": "Display real-time updates on the iOS Lock Screen and Dynamic Island. Uses the DefaultLiveActivityAttributes type provided by the OneSignal SDK.",
85
+
"options": [
86
+
{
87
+
"name": "Start",
88
+
"description": "Launch a new Live Activity with an activity ID and initial content using the SDK's startDefault method."
89
+
},
90
+
{
91
+
"name": "Update",
92
+
"description": "Update the Live Activity's content state via the REST API."
93
+
},
94
+
{
95
+
"name": "End",
96
+
"description": "Terminate the Live Activity via the REST API with immediate dismissal."
97
+
},
98
+
{
99
+
"name": "Stop Updating",
100
+
"description": "Call the SDK's exit method to unsubscribe this device from future updates for the given activity ID."
0 commit comments