FCM v1 Setup
- Create a Firebase project and download the service account JSON
- In OMobile admin → Settings → Push → FCM v1, paste the service account JSON
- Devices register via
POST /wp-json/omobile/v1/devices/registerwith their FCM token
APNS Token-Based Setup (p8)
- Generate an APNS authentication key in Apple Developer Console
- In OMobile admin → Settings → Push → APNS, upload the
.p8file and enter Team ID + Key ID - 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