Skip to content

makaronma-ct/basic-fcm-admin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

basic-fcm-admin

Reference

message data example

const msg: Message = {
  data: {
    id: Date.now().toString(),
    title: "TTIITLE",
    body: "This is body...",
    image: "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Rust_programming_language_black_logo.svg/121px-Rust_programming_language_black_logo.svg.png",
    url: "https://www.apple.com",

    /**
     * to display after receive: moment(data.sent_at).fromNow()
     */
    sent_at: moment().utc().format("YYYY-MM-DDTHH:mm:ssZ"),
  },
  // condition,
  topic: "all",

  // send with "notification" payload will cause popup notificaiton,
  // comment this if you want to customize the appearance of notification
  // notification,
  /**
   * @ios using "contentAvailable" will wake the slept app up (able to setup backgroundMessageHandler)
   */
  apns: {
    headers: {
      // "apns-priority": "5",
      // 'apns-push-type': 'background', // this make notif slient (no popup)
    },
    payload: {
      aps: {
        contentAvailable: true,
      },
    },
  },

  /**
   * @android
   */
  android: {},

  /**
   * @website
   */
  webpush: {},
};

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published