Add push notifications (Pushe) + Capacitor shell for Koja
Iran-safe push for the Koja Android app (Cafe Bazaar / Myket / direct APK):
Backend
- PushDevice entity + EF migration; idempotent device register/unregister.
- IPushSender / PusheNotificationSender (Pushe REST) — SendToTopic for
marketing (city-{slug}) and saved-café (cafe-{slug}) pushes, SendToTokens
for targeted order/reservation updates.
- Public register/unregister endpoints + authorized topic broadcast.
App
- capacitor.config.ts (native WebView loads the live PWA via server.url).
- push.ts Pushe glue: topic helpers + backend device registration.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
namespace Meezi.Core.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Sends push notifications through the Pushe gateway (Iran-safe; FCM is
|
||||
/// unreliable inside Iran). Topics are subscribed client-side via the native
|
||||
/// Pushe SDK; this service triggers the actual sends from the backend.
|
||||
/// </summary>
|
||||
public interface IPushSender
|
||||
{
|
||||
/// <summary>
|
||||
/// Broadcasts to every device subscribed to a Pushe topic.
|
||||
/// Topics: <c>city-{slug}</c> (marketing / new cafés),
|
||||
/// <c>cafe-{slug}</c> (saved-café alerts).
|
||||
/// </summary>
|
||||
Task SendToTopicAsync(
|
||||
string topic,
|
||||
string title,
|
||||
string body,
|
||||
string? deepLink = null,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Sends to one or more specific device tokens — used for transactional
|
||||
/// order / reservation updates.
|
||||
/// </summary>
|
||||
Task SendToTokensAsync(
|
||||
IReadOnlyCollection<string> tokens,
|
||||
string title,
|
||||
string body,
|
||||
string? deepLink = null,
|
||||
CancellationToken cancellationToken = default);
|
||||
}
|
||||
Reference in New Issue
Block a user