OneSignal / OneSignal-Xamarin-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
104 stars 50 forks source link

Add Live Activity widget to sample app #345

Closed brismithers closed 1 year ago

brismithers commented 1 year ago

Description

One Line Summary

Add a Live Activity example to the sample app.

Details

Motivation

In order to showcase how a Xamarin app could produce a live activity, and have it be updated via the OneSignal platform. Xamarin does not have support WidgetKit/ActivityKit, so native bindings and native extensions were created. The general approach was adopted from the WidgetKit example provided by https://github.com/chamons/xamarin-ios-swift-extension.

Note that because this approach requires a native build of the widget in order for the Xamarin solution to build, the Live Activity functionality defaults to disabled. It can be enabled by specifying the LIVE_ACTIVITIES compiler constant. See Samples/LIVE_ACTIVITIES.md for more explicit instructions.

Scope

This change should only affect the sample application.

Testing

Manual testing

The sample app was tested on both iPhone and iPhoneSimulator, with live activity functionality enabled and disabled. Entering/exit live activity was driven in all variations to ensure correct behavior.

Affected code checklist

Checklist

Overview

Testing

Final pass


This change is Reviewable