Subscribe the device to receive notifications. When integrated into your app, the Pushbase SDK handles notification subscriptions and collects relevant device information to support reliable message delivery.
All data is collected at the time of subscription and is used solely to support notification delivery and targeting.

Notification Token

  • The SDK retrieves the device’s push token during subscription.
  • This token is used to deliver notifications via the Expo Push Service.

Device Metadata

  • The SDK collects hardware details such as:
    • Device manufacturer (Apple, Samsung)
    • Device model (iPhone 14, Pixel 7)
    • OS version and platform (Android or iOS)

Location & Localization

  • To support region-aware notifications, the SDK captures:
    • Locale (en-US,fr-CA)
    • Language and country
    • City and timezone
    • Coordinates - Latitude and longitude
Pushbase SDK offers a pre-built <SubscribeBanner> component which manages the technical complexities behind permission handling and subscription flow.

Subscribe Your First Device

Prerequisite : Before initiating a device subscription, you must first request notification permissions using expo-notifications.
import * as Notifications from "expo-notifications";

export function requestPermissionsAsync() {
  return Notifications.requestPermissionsAsync({
    ios: {
      allowAlert: true,
      allowBadge: true,
      allowSound: true,
    },
  });
}
Requesting a device subscription before notification permission is granted will result in an error.
After permission granted, subscribe device as below:
/* Import device subscription function */
import { subscribeToNotifications } from "@pushbase/sdk";

/* Later inside the app, subscribe device with optional user profile */
subscribeToNotifications({
  id: 1,
  name: "George Washington",
  email: "washington@wh.gov",
});
We recommend including your app user’s profile information—such as id, name, email, or phone—at the time of subscription. This allows you to easily identify which user is associated with each subscribed device in the Pushbase dashboard.