import { EmitterSubscription } from './BatchEventEmitter'; export interface BatchPushEventPayload { isPositiveAction: boolean; pushPayload: Record; deeplink?: string | null; } /** * Batch's push module */ export declare const BatchPush: { /** * Ask users if they want to accept push notifications. * Required to be able to push users (or use requestProvisionalNotificationAuthorization - ios only). * */ requestNotificationAuthorization: () => void; /** * Ask iOS for provisional notifications (no alert to users). * Required to be able to push users (or use requestNotificationAuthorization). * * No effect on Android. */ requestProvisionalNotificationAuthorization: () => void; /** * Synchronizes the user's iOS token with Batch. Should be called at each app launch. * * No effect on Android. */ refreshToken: () => void; setShowForegroundNotification: (enabled: boolean) => void; /** * Enable or disable notifications. * * Android only. */ setShowNotifications: (enabled: boolean) => void; /** * Check whether Batch should display push notifications. * * Android only. */ shouldShowNotifications: () => Promise; /** * Clear the app badge on iOS. No effect on Android. * */ clearBadge: () => void; /** * Dismiss the app's shown notifications on iOS. Should be called on startup. * * No effect on Android. */ dismissNotifications: () => void; /** * Gets the last known push token. * Batch MUST be started in order to use this method. * * The returned token might be outdated and invalid if this method is called * too early in your application lifecycle. * * On iOS, your application should still register for remote notifications * once per launch, in order to keep this value valid. */ getLastKnownPushToken: () => Promise; /** * Gets the app's initial URL. * * On iOS, make sure to call this only once * (only the first call will return something, if Linking.getInitialURL doesn't return anything) */ getInitialURL: () => Promise; /** * Listen for push events * * dismiss and display are only supported on Android (you can still call addListener on those but it's a no-op). * * Push payload will vary depending on the platform. */ addListener(eventType: "open" | "dismiss" | "display", callback: (payload: BatchPushEventPayload) => void): EmitterSubscription; };