How to use expo-notifications - 10 common examples

To help you get started, we’ve selected a few expo-notifications examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo / apps / notification-test-app / example / App.tsx View on Github external
constructor(props) {
    super(props);

    Notifications.addOnForegroundNotificationListener('testScreen',
      (foregroundNotification: Notifications.LocalNotification) => {
        console.log(foregroundNotification);
      }
    );
    Notifications.addOnUserInteractionListener('testScreen',
      (userInteraction: Notifications.UserInteraction) => {
        console.log(userInteraction);
      }
    );
  }
github expo / expo / apps / notification-test-app / example / App.tsx View on Github external
constructor(props) {
    super(props);

    Notifications.addOnForegroundNotificationListener('testScreen',
      (foregroundNotification: Notifications.LocalNotification) => {
        console.log(foregroundNotification);
      }
    );
    Notifications.addOnUserInteractionListener('testScreen',
      (userInteraction: Notifications.UserInteraction) => {
        console.log(userInteraction);
      }
    );
  }
github expo / expo / apps / notification-test-app / example / src / MainButtonGroup.tsx View on Github external
async function () {
                   Notifications.cancelAllScheduledNotificationsAsync();
                }
            ,
github expo / expo / apps / notification-test-app / example / src / MainButtonGroup.tsx View on Github external
async function () {
                    let interval = 10 * 1000;
                    let id = await Notifications.scheduleNotificationWithTimerAsync(
                        createNotification(this.title),
                        {
                            interval,
                            repeat: false,
                        }
                    );
                    Notifications.cancelScheduledNotificationAsync(id);
                }
            ,
github expo / expo / apps / notification-test-app / example / src / ChannelGroup.tsx View on Github external
async function () {
                    let interval = 2 * 60 * 1000;
                    Notifications.presentLocalNotificationAsync(
                        createNotification(this.title, "first channel"),
                    );
                }
            ,
github expo / expo / apps / notification-test-app / example / src / MainButtonGroup.tsx View on Github external
async function () {
                    Notifications.presentLocalNotificationAsync(
                        createNotification(this.title),
                    );
                }
            ,
github expo / expo / apps / notification-test-app / example / src / MainButtonGroup.tsx View on Github external
async function () {
                    let interval = 5 * 1000;
                    let notification: any = createNotification(this.title);
                    notification.android = { exact:true };
                    Notifications.scheduleNotificationWithTimerAsync(
                        notification,
                        {
                            interval,
                            repeat: false,
                        }
                    );
                }
            ,
github expo / expo / apps / notification-test-app / example / src / MainButtonGroup.tsx View on Github external
async function () {
                    let interval = 10 * 1000;
                    let id = await Notifications.scheduleNotificationWithTimerAsync(
                        createNotification(this.title),
                        {
                            interval,
                            repeat: false,
                        }
                    );
                    Notifications.cancelScheduledNotificationAsync(id);
                }
            ,
github expo / expo / apps / notification-test-app / example / src / ChannelGroup.tsx View on Github external
async function () {
                    Notifications.createChannelAsync(
                        "first channel",
                        {
                            name: "first channel name",
                            description: "channel description",
                            sound: true,
                            priority: 5,
                            vibrate: false,
                            badge: true,
                            groupId: "first",
                        },
                    );
                }
            ,
github expo / expo / apps / notification-test-app / example / src / ChannelGroup.tsx View on Github external
async function () {
                    Notifications.createChannelGroupAsync("first","first name");
                }
            ,