Resources

Renesas IoT Sandbox Documentation

FCM Library

This library is used to send push notifications to devices using Firebase Cloud Messaging.


Import


To use this library and its functions, you must use the import line at the beginning of your Base Python code.

import FCM


Functions


FCM.send_fcm_notification

Usage: FCM.send_fcm_notification(key, registration_ids, body, sound=None, badge=None, title=None, icon=None, tag=None, color=None, click_action=None, body_loc_key=None, body_loc_args=None, title_loc_key=None, title_loc_args=None, data=None, priority='high'))

Send an FCM notification to the devices identified by registration_ids. For parameter definitions refer to the Downstream HTTP JSON tables.

  • Credit cost: 1
  • Parameters:
    • key: str|unicode FCM API key
    • registration_ids: list see Table 1
    • body: str|unicode see Table 2a/b
    • sound: str|unicode see Table 2a/b
    • badge: str|unicode see Table 2a/b
    • title: str|unicode see Table 2a/b
    • icon: str|unicode see Table 2a/b
    • tag: str|unicode see Table 2a/b
    • color: str|unicode see Table 2a/b
    • click_action: str|unicode see Table 2a/b
    • body_loc_key: str|unicode see Table 2a/b
    • body_loc_args: str|unicode see Table 2a/b
    • title_loc_key: str|unicode see Table 2a/b
    • title_loc_args: str|unicode see Table 2a/b
    • data: str|unicode see Table 1
    • priority: str|unicode see Table 1
  • Returns: None
  • Raises: FCMException on error



Sample Code

import FCM

FCM.send_fcm_notification(app_key,[FCM_token],notification['message'], sound="chime”)

Getting Started
User Roles & Permissions
Streams, Tags, & Data Types
Dashboard Widgets
API
Workflow Studio
Workflow Libraries
Metering
Special Characters
Third Party Integration
Mobile
API Explorer

FCM Library

This library is used to send push notifications to devices using Firebase Cloud Messaging.


Import


To use this library and its functions, you must use the import line at the beginning of your Base Python code.

import FCM


Functions


FCM.send_fcm_notification

Usage: FCM.send_fcm_notification(key, registration_ids, body, sound=None, badge=None, title=None, icon=None, tag=None, color=None, click_action=None, body_loc_key=None, body_loc_args=None, title_loc_key=None, title_loc_args=None, data=None, priority='high'))

Send an FCM notification to the devices identified by registration_ids. For parameter definitions refer to the Downstream HTTP JSON tables.

  • Credit cost: 1
  • Parameters:
    • key: str|unicode FCM API key
    • registration_ids: list see Table 1
    • body: str|unicode see Table 2a/b
    • sound: str|unicode see Table 2a/b
    • badge: str|unicode see Table 2a/b
    • title: str|unicode see Table 2a/b
    • icon: str|unicode see Table 2a/b
    • tag: str|unicode see Table 2a/b
    • color: str|unicode see Table 2a/b
    • click_action: str|unicode see Table 2a/b
    • body_loc_key: str|unicode see Table 2a/b
    • body_loc_args: str|unicode see Table 2a/b
    • title_loc_key: str|unicode see Table 2a/b
    • title_loc_args: str|unicode see Table 2a/b
    • data: str|unicode see Table 1
    • priority: str|unicode see Table 1
  • Returns: None
  • Raises: FCMException on error



Sample Code

import FCM

FCM.send_fcm_notification(app_key,[FCM_token],notification['message'], sound="chime”)