This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_httpGetMessages() { | |
this.http.get(this.base_url + 'messages').subscribe( (response: any) => { | |
console.log('_httpGetMessages', response); | |
let value: any = {}; | |
response.forEach(element => { | |
console.log(element); | |
value._id = element.slug; | |
this._db_messages.get(value._id, (err, doc) => { | |
if (err) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'); | |
function sendMessageToUser(deviceId, message) { | |
request({ | |
url: 'https://fcm.googleapis.com/fcm/send', | |
method: 'POST', | |
headers: { | |
'Content-Type' :' application/json', | |
'Authorization': 'key=AI...8o' | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This component shows a smaller image or a base64 encoded image till the bigger version is fully loaded. | |
Added a blur/fade effect for the transition. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ... | |
@NgModule({ | |
... | |
providers: [ TitleService ], | |
}) | |
export class AppModule { | |
constructor(titleService: TitleService) { | |
titleService.init(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class PushNotification { | |
// function to send push notification | |
function push_notification($user_device_tokens, $push_message, $title = "Demo Adventure") { | |
$api_key_access = '********************'; // API KEY for push notification | |
$headers = array('Authorization: key=' . $api_key_access, 'Content-Type: application/json'); | |
$msg = array( | |
"title" => "Notification title", | |
"body" => "Notification body", | |
"sound" => "default", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Accept: application/json"); | |
header("Content-Type: application/json"); | |
define('LOGIN_SUCCESS_MESSAGE', 'You are successfully login'); | |
define('LOGIN_FAIL_MESSAGE', 'Invalid email or password'); | |
define('SIGNUP_SUCCESS_MESSAGE', 'Signup successfull please login with email and password'); | |
define('SIGNUP_FAIL_MESSAGE', 'Signup fails'); | |
define('MAIL_SEND_SUCCESS', 'Mail send successfully.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install ionic cordova -g ---> Installing ionic cli in global | |
ionic start <projectname> <templatename> ---> To create the ionic project | |
ionic serve - to run the application in the browser. | |
ionic lab - to run the application in browser window with 3 platform screens. | |
ionic cordova platform add android or ios ---> to setup the platform | |
ionic cordova resources ---> creates the icon and splash images of different sizes of our images and splash paste in the resources folder. | |
ionic cordova run android ---> to run the application on the Androis SDK device. | |
ionic cordova run android -l ---> this cmd enables the live reload of the application. | |
ionic generate component, directive, page, pipe, provider, tabs ---> used to generate any of the mention, use only one at a time. | |
ionic plugin add <pluginname> - used to add any plugins in the project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* NodeJs script for Sending push notification using fcm | |
*/ | |
// Note : you must be install fcm-node by using command `npm install fcm-node` and then run the script using `node fcm-node.js` | |
const FCM = require('fcm-node'); | |
// Replace these with your own values. | |
const apiKey = 'api-key-here'; | |
const deviceID = 'device-token-here'; | |
const fcm = new FCM(apiKey); |