react-native-ibm-mobilefirst-push
Version:
React Native SDK for IBM Mobile Push. Works with IBM Mobile First.
70 lines (62 loc) • 1.25 kB
JavaScript
/* Licensed Materials - Property of IBM
* 5725-I43 (C) Copyright IBM Corp. 2018. All Rights Reserved.
* US Government Users Restricted Rights - Use, duplication or
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*/
/* author - Yash Soni | yashsoni21@in.ibm.com */
const notificationTemplate = function() {
return {
id :"",
url : "",
alert : "",
payload : {}
};
}
/**
* This class represents a MFPSimplePushNotification.
*/
class MFPSimplePushNotification {
/**
* @type {string}
*/
id;
/**
* @type {string}
*/
url;
/**
* @type {string}
*/
alert;
/**
* @type {Object}
*/
payload;
/**
* @ignore
*/
constructor(obj = notificationTemplate()) {
for(var prop in obj){
this[prop] = obj[prop];
}
}
/**
* @returns {string} - The url.
*/
getUrl() {
return this.url;
}
/**
* @returns {string} - The alert msg.
*/
getAlert() {
return this.alert;
}
/**
* @returns {Object} - The payload object.
*/
getPayload() {
return this.payload;
}
}
export default MFPSimplePushNotification