Links into your app#
| Link | Opens |
|---|---|
salopha://launch/<appId> | Your app's start page |
salopha://launch/<appId>?path=/orders/A12 | Your app at /orders/A12 |
https://salopha.com/l/launch/<appId>/orders/A12 | The same, shareable on the web. Android opens SALOPHA directly; elsewhere the page offers the app. |
salopha://app/<appId>/<type>/<id> | A shared object card from shareObject() |
Your page receives the path as ctx.entryDeepLink from initialize(), and where it came from as getLaunchContext().source (services, chat, notification, shortcut, link or other). Accept only paths that start with /.
const ctx = await app.initialize();
if (ctx.entryDeepLink?.startsWith("/")) router.replace(ctx.entryDeepLink);
Notifications#
Your server notifies a user by sub (scope notifications.service). The notification appears in SALOPHA's notification inbox and as a push; tapping it opens your app at path. While your app is open, the page gets a notificationReceived event instead, so you can refresh in place.
await platform.notify({
sub: user.sub,
title: "Your order is ready", // at most 120 characters
body: "Order A12 is on its way.", // at most 300 characters
path: "/orders/A12",
dedupeKey: "order:A12:ready", // the same key is delivered once
collapseKey: "order:A12", // newer replaces older on the device
});
app.on("notificationReceived", ({ path }) => { if (path) refresh(path); });
- Send to one user with
subor up to 500 withsubs. - Each item answers
sent,no_consent,unknown_subjectorrate_limited(20 per user, per app, per hour). no_consentandunknown_subjectare final. Retry the others with backoff, from an outbox table, reusing the samededupeKey.- Ask for permission in context with
requestNotifications(); check withgetNotificationStatus().
Home-screen shortcuts#
On Android, createShortcut({ path?, label? }) pins your app's own icon (branding.iconUrl on your brand colour) to the home screen. It opens through the normal launch, so the same user is signed in. Users can also add it from the host's menu or your details page.
- Needs
shortcut.createand the manifest switchruntime.allowShortcut. canCreateShortcut()tells you whether it is possible; iOS has no API for it and answers{ supported: false, reason: "ios_not_permitted" }.
Messaging a merchant#
Customers message a store, restaurant or agency through SALOPHA's business chat: never WhatsApp, a phone number alone or a chat of your own. Each merchant in your app is connected to a SALOPHA business with its inbox, staff, automatic replies and transaction cards.
- Connect (in your merchant console, signed in through SALOPHA):
platform.businesses(userToken)lists the businesses the merchant manages.platform.bindMerchant({ sub, providerExternalId, businessId })connects one, orplatform.bindMerchant({ sub, providerExternalId, create: { name, categoryIds, phones, address, logo… } })creates the business from the merchant's data and connects it. Needs the server scopebusiness.binding.manage. Official apps and trusted developers are active at once; others after SALOPHA's review. One business per merchant. - Know who is reachable (your server):
platform.bindings()returns{ providerExternalId, status, chatAvailable, businessName }per merchant. Cache it and exposechatAvailablein your API. - Message (your page):
app.openChat({ providerExternalId: "store-1", draftText: "About order A12" }). It rejects withunavailablewhen the merchant isn't connected.
Orders and bookings you publish to the transaction hub with the business id show up as cards in that same chat.