Critical Moments Docs
Quick StartHomepageAccount
  • Documentation Home
  • What is Critical Moments?
  • Quick Start
  • Concepts Overview
  • Remote Control / Service
    • Host Config on Github Pages
  • Config File Structure
  • Demo App
  • Homepage & Account
  • 📚Guides
    • Mobile App Toolbox: 13 Features Most Apps Need
    • Reduce App Churn with Notifications
    • Improve your App Store Rating
    • Feature Flags Guide
  • ⏰Notifications
    • Intro to Notifications
    • Notifications Spec
    • Smart Delivery
    • Badges
  • 🎯Conditional Targeting
    • Intro to Conditions
    • Built-in Properties
    • Custom Properties
    • Syntax and Operators
    • Conditional Guides
      • Working with Dates
      • Locations and Weather
      • Event and Property History
  • 🎪Events
    • Event Overview
    • Recommended Events
    • Built-In Events
  • 💬Actions / In App Messaging
    • Actions Overview
    • Modals
      • Modal Content Sections
      • Modal Buttons
      • Modal Images
    • Banners
    • Alerts
    • App Reviews
    • Open Link
    • Custom Actions
    • Conditional Actions
    • Triggers
  • 🎨Themes
    • Theme Overview
    • Built In Themes
  • ⛳Feature Flags
    • Feature Flag Guide
    • Conditional Feature Flags
    • Named Conditions Config
  • 🔑Trustless SaaS
  • 👋Support
  • 👩‍💻SDK API Reference
Powered by GitBook
On this page
  • Examples
  • Example Config
  • Spec

Was this helpful?

  1. Notifications

Smart Delivery

Delivery notifications at the perfect moment

Last updated 10 months ago

Was this helpful?

Our Smart Notification Delivery system allows timing the delivery of your notification based on realtime device conditions.

Examples

Here are some examples of how Smart Delivery can improve your notification click through rate:

  • Wait until the the device is being held (not flat on a table), before showing a notification, to increase visibility

  • Hold off on notifications if the user's battery is low or they are on low data mode

  • Wait until the evening and the user is connected to WiFi for sending an re-engagment notification for a game

Important: be sure to setup the background processing as described in our guide, or smart notifications can't detect the ideal moment to deliver.

Example Config

This object would be added to a notification object, to create a smart notification.

"idealDeliveryConditions": {
    "condition": "device_orientation != 'face_up' && device_orientation != 'face_down'",
    "maxWaitTimeSeconds": 8640000
}

Spec

Start by setting up up a notification in your config, as described in the notification. Once the standard notification is setup, add a idealDeliveryConditions json object to the notification config. It contains the following properties:

  • idealDeliveryConditions.condition: an ideal delivery condition in the form of a , defining the ideal conditions you'd like the notification delivered under. For example device_orientation != 'face_up' && device_orientation != 'face_down'

  • idealDeliveryConditions.maxWaitTimeSeconds : defines how long you're willing to wait for ideal conditions, before giving up and delivering anyways. An integer number of seconds, or -1 for forever.

The notification will still wait until at least the appropriate deliveryTime as defined in your notification. However, it will also check the ideal delivery condition. If the condition isn't met, it will keep checking until it's met or maxWaitTimeSeconds has elapsed to delivery the notification.

Understanding iOS Background Processing

Your app will occasionally get short periods of background runtime, and Critical Moments will use those times to check if any notifications meet their ideal delivery conditions.

However, the times when your app is run are controlled by Apple and are not deterministic. Don't expect a notification for the condition device_battery_state == 'charging' to fire the moment you plug in your phone. Factors like low battery and app-usage-frequency can impact how often Apple gives each app runtime.

We suggest using a reasonable maxWaitTimeSeconds as a fallback, to ensure your messages are still delivered after a fallback amount of time.

⏰
spec
conditional statement
Quick Start