DocsOMobilePush Notifications
Features

Push Notifications

OMobileorravo.com/docs/omobile/push-notifications

FCM v1 Setup

  1. Create a Firebase project and download the service account JSON
  2. In OMobile admin → Settings → Push → FCM v1, paste the service account JSON
  3. Devices register via POST /wp-json/omobile/v1/devices/register with their FCM token

APNS Token-Based Setup (p8)

  1. Generate an APNS authentication key in Apple Developer Console
  2. In OMobile admin → Settings → Push → APNS, upload the .p8 file and enter Team ID + Key ID
  3. Devices register with their APNS device token

Expo Push Setup

Enter your Expo project's push access token in Settings → Push → Expo. Devices pass their Expo push token on registration.

Sending Push Notifications

Via Admin

OMobile → Push → Send Notification:

  • Target: All devices, a segment, or a specific device
  • Title + body + optional data payload
  • Schedule: immediately or future datetime

Via PHP

php// Send to a segment
OMobile_Push::send_to_segment(
    segment_id: 3,
    title: 'New article published',
    body: 'Check it out now',
    data: [ 'post_id' => 42, 'url' => 'https://example.com/post-42' ]
);

// Send to a single device
OMobile_Push::send_to_device(
    install_id: 'uuid',
    title: 'Hello',
    body: 'Your order has shipped'
);

// Broadcast to all
OMobile_Push::send_to_all( 'Breaking News', 'Story title here' );

Via WP-CLI

bashwp omobile push send --title="Hello" --body="World" --segment=3
wp omobile push send --title="Hello" --body="World" --all
Push Notifications — OMobile Docs — Orravo