1624161180
Business thrives more if you are not forgotten by the users.A innovative way to be in touch with our customers is by sending Push Notifications.Firebase provides various services and one among them is push notifications.I learnt this while working on a project at Virtual Cybertrons Pvt Ltd . We will learn how to send push notifications from a NodeJs server to web clients with FCM(Firebase cloud messaging) when the website is in background.
The steps are as follows :
Register on Firebase Console
Coding the service at client site
Sending a notification to website from Back end.
Sending messages.
#firebase
1594162500
A multi-cloud approach is nothing but leveraging two or more cloud platforms for meeting the various business requirements of an enterprise. The multi-cloud IT environment incorporates different clouds from multiple vendors and negates the dependence on a single public cloud service provider. Thus enterprises can choose specific services from multiple public clouds and reap the benefits of each.
Given its affordability and agility, most enterprises opt for a multi-cloud approach in cloud computing now. A 2018 survey on the public cloud services market points out that 81% of the respondents use services from two or more providers. Subsequently, the cloud computing services market has reported incredible growth in recent times. The worldwide public cloud services market is all set to reach $500 billion in the next four years, according to IDC.
By choosing multi-cloud solutions strategically, enterprises can optimize the benefits of cloud computing and aim for some key competitive advantages. They can avoid the lengthy and cumbersome processes involved in buying, installing and testing high-priced systems. The IaaS and PaaS solutions have become a windfall for the enterprise’s budget as it does not incur huge up-front capital expenditure.
However, cost optimization is still a challenge while facilitating a multi-cloud environment and a large number of enterprises end up overpaying with or without realizing it. The below-mentioned tips would help you ensure the money is spent wisely on cloud computing services.
Most organizations tend to get wrong with simple things which turn out to be the root cause for needless spending and resource wastage. The first step to cost optimization in your cloud strategy is to identify underutilized resources that you have been paying for.
Enterprises often continue to pay for resources that have been purchased earlier but are no longer useful. Identifying such unused and unattached resources and deactivating it on a regular basis brings you one step closer to cost optimization. If needed, you can deploy automated cloud management tools that are largely helpful in providing the analytics needed to optimize the cloud spending and cut costs on an ongoing basis.
Another key cost optimization strategy is to identify the idle computing instances and consolidate them into fewer instances. An idle computing instance may require a CPU utilization level of 1-5%, but you may be billed by the service provider for 100% for the same instance.
Every enterprise will have such non-production instances that constitute unnecessary storage space and lead to overpaying. Re-evaluating your resource allocations regularly and removing unnecessary storage may help you save money significantly. Resource allocation is not only a matter of CPU and memory but also it is linked to the storage, network, and various other factors.
The key to efficient cost reduction in cloud computing technology lies in proactive monitoring. A comprehensive view of the cloud usage helps enterprises to monitor and minimize unnecessary spending. You can make use of various mechanisms for monitoring computing demand.
For instance, you can use a heatmap to understand the highs and lows in computing visually. This heat map indicates the start and stop times which in turn lead to reduced costs. You can also deploy automated tools that help organizations to schedule instances to start and stop. By following a heatmap, you can understand whether it is safe to shut down servers on holidays or weekends.
#cloud computing services #all #hybrid cloud #cloud #multi-cloud strategy #cloud spend #multi-cloud spending #multi cloud adoption #why multi cloud #multi cloud trends #multi cloud companies #multi cloud research #multi cloud market
1594166040
The moving of applications, databases and other business elements from the local server to the cloud server called cloud migration. This article will deal with migration techniques, requirement and the benefits of cloud migration.
In simple terms, moving from local to the public cloud server is called cloud migration. Gartner says 17.5% revenue growth as promised in cloud migration and also has a forecast for 2022 as shown in the following image.
#cloud computing services #cloud migration #all #cloud #cloud migration strategy #enterprise cloud migration strategy #business benefits of cloud migration #key benefits of cloud migration #benefits of cloud migration #types of cloud migration
1603501200
Reinforcing Google’s decision made about deprecating the Google Cloud Messaging on 11th April 2019, everyone is required to migrate from GCM to FCM to ensure smoother push notification to the subscribed users. And, the migration part requires seamless efforts and technical expertise to carry out. So, this blog will unfold all the terms pertaining to GCM to FCM migration
Before talking about the migration part, let’s perceive GCM and FCM first.
As we can see, it’s really tough to compete with the brutally obsessed market wherein everyone is trying to pull the maximum number of customers toward their brand, and for doing so, they are ready to shake hands with emerging or trendy technologies. FCM is one of them that leverage its true potential whereby brands can push their customers with real-time efficiency to bring them back to the app or website with lucrative ideas, deals, or information.
GCM was introduced by Google in the year 2012 to allow brands to send push notifications to their users or subscribers in real-time. These push notifications could help brands engage and retain users in the long run. These push notifications act like a notification message about new mail, product release, upcoming deal, personalized discounts, and more.
But, GCM was imbibing some limitations that encouraged Google to bring a revolutionary technology approach in terms of FCM (Firebase Cloud Messaging). So, before arriving on how to migrate your GCM to FCM, let’s understand - what is Firebase?
Firebase is an end-to-end Mobile-as-a-Service platform that lets the developers build the apps without the need for managing the infrastructure. It acts as a real-time tool to connect and manage the client application, app server, etc. and provides the opportunity to engage and sustain the user base. It comprises the functionality to promote the app, service offerings, and acquire the user base. Such functional navigation incorporates core configuration, data storage, analytics part, and push notifications.
Initially, GCM was released to send push notifications but with increasing user complexities and market adoption, a serious need encouraged the advanced level of functionality to drive an effective approach and lead the customer-engaging campaigns more blissfully. Thereby, GCM was deprecated by FCM with more bonzer and modern customer-driven tactics considering the surmounting need of today’s marketplace where retaining the customers’ matters a lot.
Ensuring and implementing things in terms of registration logic, topic subscription, server-error handling part, etc. were not possible with GCM, and FCM is now taking care of these all issues. So, let’s peep more into how FCM overcomes things.
Migrating from GCM to FCM will enable you to leverage a multitude of functionality available in FCM for instance, platform overrides, topic subscription & combinations, sending push notifications directly leveraging Firebase console. Moreover, FCM can be integrated seamlessly with other Firebase products too for the advancement of your overall FCM experience. Such products include A/B testing, predictive analytics, etc.
#firebase #google-cloud-platform #google-cloud-messenger #google-cloud #fcm #gcm #firebase-cloud-messaging #messaging
1649307420
React Native uses JavaScript and React to build apps for iOS, Android, and the web from a single codebase. It also allows you to tap into the native features of each device, such as the device’s default themes, camera, geolocation, and push notifications. This means you can use React Native to build a complete mobile app that integrates with iOS or Android’s underlying settings, which makes it simple to implement push notifications, as I will demonstrate today.
In this article, we will learn how to build a simple React chat application that integrates with Firebase Cloud Messaging and the device’s push notifications to notify a user when they receive a new message.
To follow along with this tutorial, it is essential to have the following:
To set up the application, go ahead and create a project folder where you want your project to live, then initialize the application using this npx command:
npx react-native init chat_app_with_fcm
Once the above command is executed, a chat_app_with_fcm
directory that hosts your React Native settings will be created. Change the directory path to the newly created chat_app_with_fcm
folder:
cd chat_app_with_fcm
Let’s test if the bootstrapped React Native template is working. Make sure you have a connected device or an emulator, and then start the application as such:
npm run android
This will start a development environment that you can use to access the application on the connected device or emulator.
This guide is creating a chat application. To handle the chat functionality, we will use the react-native-gifted-chat package. The package will provide a ready-to-use, interactive UI for the chat application.
To install the package, open your project terminal and run the following command:
npm i react-native-gifted-chat
Once installed, navigate to the App.js
file and make the following changes.
First, import the GiftedChat
module:
import { GiftedChat } from 'react-native-gifted-chat'
Then, import the following Hooks:
import { useState, useCallback, useEffect } from "react";
Inside the App: ()
function, define a state for messages
:
const [messages, setMessages] = useState([]);
Define a useEffect
to set a default message when the application loads:
useEffect(() => {
setMessages([
{
_id: 1,
text: 'Hello there',
createdAt: new Date(),
user: {
_id: 2,
name: 'PartyA',
avatar: 'https://placeimg.com/140/140/any',
},
},
]);
}, [])
Next, define an onSend
event handler for when a user sends a message:
const onSend = useCallback((messages = []) => {
setMessages(previousMessages => GiftedChat.append(previousMessages, messages)) // append the new message to present messages
}, [])
Finally, replace the rendered view with the GiftedChat
component:
return (
<GiftedChat
backgroundColor={isDarkMode ? Colors.black : Colors.white}
messages={messages}
onSend={messages => onSend(messages)}
user={{
_id: 1,
}}
/>
)
After making the above changes, React Native will use its hot reload features and reflect the changes to your screen.
Let’s now connect this application to Firebase. To set this up, log on to your Firebase account and create a new project using the Add project card. Enter your project name, and then click Continue. Feel free to enable or disable Google Analytics on the next step, and then click Continue.
When your project is ready, click Continue again to go to the project dashboard. On this dashboard, create an Android application using the Android icon present on your project dashboard.
Under Android package name, enter the package name from your app. You can get this package name inside the /android/app/src/main/AndroidManifest.xml
file. Finally, hit Register app, download the google-services.json
file, and place it under your project’s android/app/
directory.
To connect our React Native application with Firebase, we have to configure the application with the Firebase credentials.
Under android/build.gradle
, add the following classpath
inside the buildscripts/dependencies
tags:
classpath 'com.google.gms:google-services:4.3.10'
Under the /android/app/build.gradle
file, add the google-services
plugin right below apply plugin: "com.android.application"
:
apply plugin: 'com.google.gms.google-services'
Next, install React Native Firebase like so:
npm i --save @react-native-firebase/messaging
These settings are ready. Now, let’s handle how React Native will use FCM to send the chat messages.
First, create an event handler to handle foreground message notifications. The handler will receive the incoming message, structure it, add it to the message state, and display an alert.
Navigate to the App.js
file and import React Native Firebase:
import messaging from '@react-native-firebase/messaging';
Under App()
, add a useEffect()
Hook, which will listen to any change in the messages
state:
useEffect(() => {
}, [messages]);
Inside the useEffect()
, add an event handler to listen to notifications:
// Get the notification message
const subscribe = messaging().onMessage(async remoteMessage => {
// Get the message body
let message_body = remoteMessage.notification.body;
// Get the message title
let message_title = remoteMessage.notification.title;
// Get message image
let avatar = remoteMessage.notification.android.imageUrl;
// Append the message to the current messages state
setMessages(messages => GiftedChat.append(messages, {
_id: Math.round(Math.random() * 1000000),
text: message_body,
createdAt: new Date(),
user: {
_id: 2,
name: "PartyB",
avatar: avatar,
},
}));
// Show an alert to the user
Alert.alert(message_title, message_body);
});
return subscribe;
To test this, go to the Firebase console of the application you created in the previous step. On the left sidebar, under Engage, click Cloud messaging. Then click the button Send your first message.
On the form that proceeds:
Now, under Target, click Select an app and then select your app. Click Next on the next step and then Review. On the resulting popup, click Publish.
On the app, you should receive the following notification.
Background message notifications work when the application is closed. Similarly to foreground notifications, we will be adding a handler.
To add the handler, make the following changes on App.js
before App()
:
// Register background handler
// Get the notification
messaging().setBackgroundMessageHandler(async remoteMessage => {
// Extract the body
let message_body = remoteMessage.notification.body;
// Extract the title
let message_title = remoteMessage.notification.title;
// Extract the notification image
let avatar = remoteMessage.notification.android.imageUrl;
// Add the notification to the messages array
setMessages(messages => GiftedChat.append(messages, {
_id: Math.round(Math.random() * 1000000),
text: message_body,
createdAt: new Date(),
user: {
_id: 2,
name: "PartyB",
avatar: avatar,
},
}));
// Send a notification alert
Alert.alert(message_title, message_body);
});
To test the functionality, you will have to close the application, then send a notification message from the console as in the previous section.
You should receive such an alert like the one below on your phone’s push notification bar.
Notifications are critical to modern mobile applications. I hope this guide has helped you learn the important skill of adding push notifications to React Native apps. As we have seen, Firebase Cloud Messaging and React Native Firebase makes this flow seamless and very easy.
Source: https://blog.logrocket.com/react-native-push-notifications-firebase-cloud-messaging/
1597017248
#firebase #firebase database #c# with firebase #c# with firebase tutorials #c# with firebase database #asp.net with firebase database