1import { ConfigPlugin, createRunOncePlugin } from 'expo/config-plugins';
2
3import { withNotificationsAndroid } from './withNotificationsAndroid';
4import { withNotificationsIOS } from './withNotificationsIOS';
5
6const pkg = require('expo-notifications/package.json');
7
8export type NotificationsPluginProps = {
9  /**
10   * Local path to an image to use as the icon for push notifications.
11   * 96x96 all-white png with transparency. We recommend following
12   * [Google's design guidelines](https://material.io/design/iconography/product-icons.html#design-principles).
13   * @platform android
14   */
15  icon?: string;
16  /**
17   * Tint color for the push notification image when it appears in the notification tray.
18   * @default '#ffffff'
19   * @platform android
20   */
21  color?: string;
22  /**
23   * Array of local paths to sound files (.wav recommended) that can be used as custom notification sounds.
24   */
25  sounds?: string[];
26  /**
27   * Environment of the app: either 'development' or 'production'.
28   * @default 'development'
29   * @platform ios
30   */
31  mode?: 'development' | 'production';
32};
33
34const withNotifications: ConfigPlugin<NotificationsPluginProps | void> = (config, props) => {
35  config = withNotificationsAndroid(config, props || {});
36  config = withNotificationsIOS(config, props || {});
37  return config;
38};
39
40export default createRunOncePlugin(withNotifications, pkg.name, pkg.version);
41