How to use the detox.device.sendUserNotification function in detox

To help you get started, we’ve selected a few detox 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 flow-typed / flow-typed / definitions / npm / detox_v7.x.x / test_detox_v7.x.x.js View on Github external
title: "From push",
  subtitle: "Subtitle",
  body: "Body",
  badge: 1,
  payload: {
    key1: "value1",
    key2: "value2"
  },
  category: "com.example.category",
  "content-available": 0,
  "action-identifier": "default"
};
device.sendUserNotification(userNotificationCalendarTrigger);
device.sendUserNotification(userNotificationLocationTrigger);
device.sendUserNotification(userNotificationTimeIntervalTrigger);
device.sendUserNotification(userNotificationPushTrigger);

// $ExpectError
device.setOrientation("normal");
device.setOrientation("portrait");

// $ExpectError
device.setLocation();
device.setLocation(32.04, 34.78);

device.setURLBlacklist(["https://flow.org", "https://flow.org"]);
device.enableSynchronization();
device.disableSynchronization();
device.resetContentAndSettings();
device.getPlatform();

// Matchers
github flow-typed / flow-typed / definitions / npm / detox_v7.x.x / test_detox_v7.x.x.js View on Github external
},
  title: "From push",
  subtitle: "Subtitle",
  body: "Body",
  badge: 1,
  payload: {
    key1: "value1",
    key2: "value2"
  },
  category: "com.example.category",
  "content-available": 0,
  "action-identifier": "default"
};
device.sendUserNotification(userNotificationCalendarTrigger);
device.sendUserNotification(userNotificationLocationTrigger);
device.sendUserNotification(userNotificationTimeIntervalTrigger);
device.sendUserNotification(userNotificationPushTrigger);

// $ExpectError
device.setOrientation("normal");
device.setOrientation("portrait");

// $ExpectError
device.setLocation();
device.setLocation(32.04, 34.78);

device.setURLBlacklist(["https://flow.org", "https://flow.org"]);
device.enableSynchronization();
device.disableSynchronization();
device.resetContentAndSettings();
device.getPlatform();
github flow-typed / flow-typed / definitions / npm / detox_v7.x.x / test_detox_v7.x.x.js View on Github external
type: "push"
  },
  title: "From push",
  subtitle: "Subtitle",
  body: "Body",
  badge: 1,
  payload: {
    key1: "value1",
    key2: "value2"
  },
  category: "com.example.category",
  "content-available": 0,
  "action-identifier": "default"
};
device.sendUserNotification(userNotificationCalendarTrigger);
device.sendUserNotification(userNotificationLocationTrigger);
device.sendUserNotification(userNotificationTimeIntervalTrigger);
device.sendUserNotification(userNotificationPushTrigger);

// $ExpectError
device.setOrientation("normal");
device.setOrientation("portrait");

// $ExpectError
device.setLocation();
device.setLocation(32.04, 34.78);

device.setURLBlacklist(["https://flow.org", "https://flow.org"]);
device.enableSynchronization();
device.disableSynchronization();
device.resetContentAndSettings();
device.getPlatform();
github flow-typed / flow-typed / definitions / npm / detox_v7.x.x / test_detox_v7.x.x.js View on Github external
device.launchApp({ permissions: false, url: false });

// $ExpectError
device.terminateApp({ err: "err" });
device.terminateApp();
device.terminateApp("other.bundle.id");
device.reloadReactNative();
device.sendToHome();
device.installApp();
device.uninstallApp();
// $ExpectError
device.openURL({ url: "https://flow.org", sourceApp: false });
device.openURL({ url: "https://flow.org" });

// $ExpectError
device.sendUserNotification();
const userNotificationCalendarTrigger = {
  trigger: {
    type: "calendar",
    "date-components": {
      era: 1,
      year: 2017,
      month: 1,
      day: 1,
      hour: 0,
      minute: 0,
      second: 0,
      weekday: 0,
      weekdayOrdinal: 0,
      quarter: 1,
      weekOfMonth: 1,
      weekOfYear: 1,
github flow-typed / flow-typed / definitions / npm / detox_v7.x.x / test_detox_v7.x.x.js View on Github external
trigger: {
    type: "push"
  },
  title: "From push",
  subtitle: "Subtitle",
  body: "Body",
  badge: 1,
  payload: {
    key1: "value1",
    key2: "value2"
  },
  category: "com.example.category",
  "content-available": 0,
  "action-identifier": "default"
};
device.sendUserNotification(userNotificationCalendarTrigger);
device.sendUserNotification(userNotificationLocationTrigger);
device.sendUserNotification(userNotificationTimeIntervalTrigger);
device.sendUserNotification(userNotificationPushTrigger);

// $ExpectError
device.setOrientation("normal");
device.setOrientation("portrait");

// $ExpectError
device.setLocation();
device.setLocation(32.04, 34.78);

device.setURLBlacklist(["https://flow.org", "https://flow.org"]);
device.enableSynchronization();
device.disableSynchronization();
device.resetContentAndSettings();