![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
fb-messenger
Advanced tools
Requires Node 8+
npm install fb-messenger --save
You must require fb-messenger and create an instance
// Constructor
const FBMessenger = require('fb-messenger')
const messenger = new FBMessenger({token, notificationType})
// token is optional, if not included, must be sent in each method, notificationType is optional, default = 'REGULAR'
messenger.setToken(token) // Sets the instance token
messenger.setNotificationType(notificationType) // Sets the instance notificationType
// Methods (notificationType and token are optional)
messenger.sendTextMessage({id, message, notificationType, token}) // Sends a text message
messenger.sendAudioMessage({id, url, notificationType, token}) // Sends an audio from URL
messenger.sendVideoMessage({id, url, notificationType, token}) // Sends an video from URL
messenger.sendImageMessage({id, url, notificationType, token}) // Sends an image from URL
messenger.sendFileMessage({id, url, notificationType, token}) // Sends an file from URL
messenger.sendQuickRepliesMessage({id, attachment, quickReplies, notificationType, token}) // Sends a Quick Replies Message
messenger.sendButtonsMessage({id, message, buttons, notificationType, token}) // Sends a buttons template message
messenger.sendGenericMessage({id, elements, notificationType, token}) // Sends a generic template message
messenger.sendListMessage({id, elements, buttons, top_element_type, notificationType, token}) // Sends a list template message
messenger.sendMediaMessage({id, elements, notificationType, token}) // Sends a media template message
messenger.sendOpenGraphMessage({id, elements, notificationType, token}) // Sends an open graph template message
messenger.sendReceiptMessage({id, payload, notificationType, token}) // Sends a receipt template message (No need for template_type in payload)
messenger.sendAction({id, actionType, token}) // Send an action type (One of 'mark_seen', 'typing_on', 'typing_off')
messenger.sendMessage({id, data, notificationType, token}) // Send a message from custom data
messenger.getProfile({id, token}) // Gets user information
messenger.setWelcomeMessage({pageId, message, token}) // Sets Page's Welcome Message (message can be a text string or a strucuted message)
messenger.setGreetingText ({pageId, message, token}) // Sets Page's Greeting Text
messenger.setPersistentMenu ({pageId, menuItems, token}) // Set's Page's Persistent Menu
messenger.setDomainWhitelist ({pageId, domains, token}) // Set's Page's Whitelisted Domains
messenger.sendThreadSettingsMessage ({pageId, body, token}) // Send Manually Page's Thread Settings
const FBMessenger = require('fb-messenger')
const messenger = new FBMessenger({token: '<YOUR TOKEN>'}) // Will always use this page's token for request unless sent on each method
messenger.sendTextMessage({id: '<ID>', text: 'Hello'})
const FBMessenger = require('fb-messenger')
const messenger = new FBMessenger({token: '<YOUR TOKEN>'})
try {
const response = await messenger.sendTextMessage({id: '<ID>', text: 'Hello'})
console.log(response)
} catch (e) {
console.error(e)
}
const FBMessenger = require('fb-messenger')
const messenger = new FBMessenger({token: '<YOUR TOKEN>'})
messenger.sendTextMessage({id: '<ID>', text: 'Hello', notificationType: 'NO_PUSH'})
const FBMessenger = require('fb-messenger')
const messenger = new FBMessenger({token: '<YOUR TOKEN>', notificationType: 'SILENT_PUSH'})
const FBMessenger = require('fb-messenger')
const messenger = new FBMessenger({token: '<YOUR TOKEN>', notificationType: 'NO_PUSH'})
try {
await messenger.sendTextMessage({id: '<ID>', text: 'Hello'}) // Send a message with NO_PUSH, ignoring response
console.log('Sent successfully')
} catch(e) {
console.error(e)
}
// Send an image overriding default notification type with callback
try {
const response = await messenger.sendImageMessage({id: '<ID>', url: '<IMG URL>', notificationType: 'REGULAR'})
console.log('Sent image, response:')
console.dir(response)
} catch(e) {
console.error(e)
}
messenger.sendTextMessage({id: '<ID>', text: 'Hello', token: '<YOUR OTHER TOKEN>'}) // Send message on another page
MIT. Copyright © Diego Rodríguez Baquero
FAQs
Facebook Messenger Platform API
The npm package fb-messenger receives a total of 28 weekly downloads. As such, fb-messenger popularity was classified as not popular.
We found that fb-messenger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.