Verwendung

Obtain an iOS push token.

tsx
// Obtain an iOS push token.
import { notifications, platform } from 'kuito';

// On each launch: the token can change. Android rejects with ERR_UNSUPPORTED for now.
if (platform === 'ios') {
  const { service, token } = await notifications.register();

  await fetch('https://api.example.com/devices', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ service, token }),
  });
}

Signaturen

ts
(): Promise<Token>

Parameter

Keine Parameter.

Rückgabe

Promise<Token>

Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.