Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -342,7 +343,8 @@ private async Task<bool> 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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down