PushToken
Where a server sends the device's push: the service and its token.
Usage
Register the iOS push token with your notification backend.
// Register the iOS push token with your notification backend.
import { notifications, type PushToken } from 'kuito';
export async function registerPush() {
const token: PushToken = await notifications.register();
const response = await fetch('https://example.com/push-devices', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify(token),
});
if (!response.ok) throw new Error(`Token registration failed: ${response.status}`);
}
// Call after notification permission is granted; Android push registration is unsupported.Type declaration
export type PushToken = Token;Members 2
| Name | Type | Required | Description |
|---|---|---|---|
service | "apns" | Yes | — |
token | string | Yes | What a server sends the push to: APNs' device token, in hex. |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.