diff --git a/examples/demo-no-location/Assets/Scripts/NoLocationDemo.cs b/examples/demo-no-location/Assets/Scripts/NoLocationDemo.cs index 763b2775..2f09ea04 100644 --- a/examples/demo-no-location/Assets/Scripts/NoLocationDemo.cs +++ b/examples/demo-no-location/Assets/Scripts/NoLocationDemo.cs @@ -12,6 +12,7 @@ public sealed class NoLocationDemo : MonoBehaviour private string _oneSignalAppId = "YOUR-ONESIGNAL-APP-ID"; private const float ReferenceWidth = 393f; + private const string DemoAndroidGroup = "demo-group"; private static readonly Color _backgroundColor = new Color32(248, 249, 250, 255); private static readonly Color _primaryColor = new Color32(229, 75, 77, 255); private static readonly Color _valueColor = new Color32(47, 52, 55, 255); @@ -342,7 +343,8 @@ private async Task PostTestNotification(string pushSubscriptionId) + $"\"app_id\":\"{_oneSignalAppId}\"," + $"\"include_subscription_ids\":[\"{pushSubscriptionId}\"]," + "\"headings\":{\"en\":\"OneSignal No-Location Demo\"}," - + "\"contents\":{\"en\":\"This test push was sent without linking the location module.\"}" + + "\"contents\":{\"en\":\"This test push was sent without linking the location module.\"}," + + $"\"android_group\":\"{DemoAndroidGroup}\"" + "}"; using var request = new UnityWebRequest( diff --git a/examples/demo/Assets/Scripts/Services/OneSignalApiService.cs b/examples/demo/Assets/Scripts/Services/OneSignalApiService.cs index e79a9de1..12830904 100644 --- a/examples/demo/Assets/Scripts/Services/OneSignalApiService.cs +++ b/examples/demo/Assets/Scripts/Services/OneSignalApiService.cs @@ -18,6 +18,8 @@ public class OneSignalApiService private const string DefaultAndroidChannelId = "b3b015d9-c050-4042-8548-dcc34aa44aa4"; + private const string DemoAndroidGroup = "demo-group"; + public void SetAppId(string appId) => _appId = appId; public string GetAppId() => _appId; @@ -178,6 +180,7 @@ private JObject BuildBasePayload(string title, string body, string subscriptionI ["include_subscription_ids"] = new JArray(subscriptionId), ["headings"] = new JObject { ["en"] = title }, ["contents"] = new JObject { ["en"] = body }, + ["android_group"] = DemoAndroidGroup, }; // Retry while the OneSignal backend hasn't yet indexed the freshly