Luna  Hermann

Luna Hermann

1594882200

Notify Users, Part 2 — Firebase Cloud Functions

This article complements my other article on “Firebase Notifications”. To test firebase notifications, one can simply use the Firebase Cloud Messaging console on Firebase. But in actual you would notify users when there’s a new email or a new tweet or trigger a reminder or give away free tokens in gaming apps; all-in-all to engage users with your app, to lure them to open or use your app. To be able to achieve this, mostly notifications would be sent using cloud functions or server-side code.

USE CASE

How to write a cloud function to send firebase notifications. Such cloud functions can be set to listen to changes on your Firebase table or can be triggered using HTTP. In this article, I will share with you how to write a cloud function and execute it as an HTTP function.

IMPLEMENTATION

Below are the steps to set up, write, deploy, and test your cloud function.

Step 1: Setup Firebase Cloud Messaging API

  1. A good starting point is of course the firebase documentation.
  2. Make sure you have added your project on firebase. (step 1 in the above documentation)
  3. Install node.js.

_> _You would need node NVM (Node Version Manager) only if you want to use multiple versions of node, else you don’t. (I did not install NVM on Windows but was needed on Mac. Refer #7 below)

>_ NPM (Node Package Manager) is installed by default with Node.js._

4. Add the below line to the PATH variable in “bash. profile” file in your home directory.

export PATH=”$PATH:/user/local/bin”

5. You can check the version of node installed using the below command in command prompt

node — version (You need version 6 and above)

npm -v (you need 5 or later)

You need node version 6 and above, npm version 5 or above.

6. I could not install Firebase CLI because of some permission issues on Mac. The same has been mentioned in this firebase google tutorial and the solution was to reinstall Node.js using NVM.

7. From the terminal install NVM. The link has a curl command to download and install.

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash

8. Close & reopen the terminal to verify the installation. Use the command below, the output should be “nvm”

command -v nvm

9. Re-install Node.js using the below command,

nvm install node

10. Then Use the below command to install Firebase CLI (Command Line Interface)

npm install -g firebase -tools

11. Type the below command to check the version of firebase

firebase — version

12. Login into firebase from the command. Use the below command

firebase login

Type”y” to the question “Allow Firebase to collect anonymous CLI usage and error reporting information? (Y/n)”

Chrome browser will open up asking you to pick the account associated on Google FireBase.

Click “Allow” on the disclaimer screen that follows.

You should see a “Firebase Login Successful” screen on the browser as well as on the command prompt.

13. Initialize your project on Firebase by using the below command. Make sure you are in the directory where you want your firebase app will be initialized. Eg: …/sandbox/firebase.

#firebasenotifications #firebase-cloud-functions #flutter-app-development #flutter #firebase

What is GEEK

Buddha Community

Notify Users, Part 2 — Firebase Cloud Functions
Adaline  Kulas

Adaline Kulas

1594162500

Multi-cloud Spending: 8 Tips To Lower Cost

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.

  • Deactivate underused or unattached resources

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.

  • Figure out idle instances

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.

  • Deploy monitoring mechanisms

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

Luna  Hermann

Luna Hermann

1594882200

Notify Users, Part 2 — Firebase Cloud Functions

This article complements my other article on “Firebase Notifications”. To test firebase notifications, one can simply use the Firebase Cloud Messaging console on Firebase. But in actual you would notify users when there’s a new email or a new tweet or trigger a reminder or give away free tokens in gaming apps; all-in-all to engage users with your app, to lure them to open or use your app. To be able to achieve this, mostly notifications would be sent using cloud functions or server-side code.

USE CASE

How to write a cloud function to send firebase notifications. Such cloud functions can be set to listen to changes on your Firebase table or can be triggered using HTTP. In this article, I will share with you how to write a cloud function and execute it as an HTTP function.

IMPLEMENTATION

Below are the steps to set up, write, deploy, and test your cloud function.

Step 1: Setup Firebase Cloud Messaging API

  1. A good starting point is of course the firebase documentation.
  2. Make sure you have added your project on firebase. (step 1 in the above documentation)
  3. Install node.js.

_> _You would need node NVM (Node Version Manager) only if you want to use multiple versions of node, else you don’t. (I did not install NVM on Windows but was needed on Mac. Refer #7 below)

>_ NPM (Node Package Manager) is installed by default with Node.js._

4. Add the below line to the PATH variable in “bash. profile” file in your home directory.

export PATH=”$PATH:/user/local/bin”

5. You can check the version of node installed using the below command in command prompt

node — version (You need version 6 and above)

npm -v (you need 5 or later)

You need node version 6 and above, npm version 5 or above.

6. I could not install Firebase CLI because of some permission issues on Mac. The same has been mentioned in this firebase google tutorial and the solution was to reinstall Node.js using NVM.

7. From the terminal install NVM. The link has a curl command to download and install.

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash

8. Close & reopen the terminal to verify the installation. Use the command below, the output should be “nvm”

command -v nvm

9. Re-install Node.js using the below command,

nvm install node

10. Then Use the below command to install Firebase CLI (Command Line Interface)

npm install -g firebase -tools

11. Type the below command to check the version of firebase

firebase — version

12. Login into firebase from the command. Use the below command

firebase login

Type”y” to the question “Allow Firebase to collect anonymous CLI usage and error reporting information? (Y/n)”

Chrome browser will open up asking you to pick the account associated on Google FireBase.

Click “Allow” on the disclaimer screen that follows.

You should see a “Firebase Login Successful” screen on the browser as well as on the command prompt.

13. Initialize your project on Firebase by using the below command. Make sure you are in the directory where you want your firebase app will be initialized. Eg: …/sandbox/firebase.

#firebasenotifications #firebase-cloud-functions #flutter-app-development #flutter #firebase

Adaline  Kulas

Adaline Kulas

1594166040

What are the benefits of cloud migration? Reasons you should migrate

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

Were  Joyce

Were Joyce

1624418820

Spring Integration AWS 2.5.1 and Spring Cloud Stream Kinesis Binder 2.2.0 Available

Dear Spring Community,

Today it’s my pleasure to announce releases of Spring Integration for Amazon Web Services extension versions 2.5.1 and Spring Cloud Stream Binder for AWS Kinesis 2.2.0.

These releases can be downloaded from Maven Central:

compile 'org.springframework.integration:spring-integration-aws:2.5.1'
COPY

If you don’t use Kinesis Binder. Or via Binder dependency:

compile 'org.springframework.cloud:spring-cloud-stream-binder-kinesis:2.2.0'
COPY

Spring Integration for AWS extension of 2.5.1 has some minor bug fixes after the previous 2.5.0 announcement.

The Spring Cloud Stream Binder for AWS Kinesis 2.2.0 is the first release in the project generation which is based on a new independent Spring Cloud for AWS artifact. It also was upgraded to the latest Spring Cloud 2020.0.3 and has some other bug fixes and improvements.

#[object object] #aws 2.5.1 #spring cloud #spring cloud stream kinesis binder 2.2.0 available #spring integration aws 2.5.1 and spring cloud stream kinesis binder 2.2.0 available

Desmond  Gerber

Desmond Gerber

1622797715

Time Zone Of Cloud Functions for Firebase Scheduler Does Not Change

Time Zone of Cloud Functions for Firebase Scheduler does not change

I am currently creating and deploying a function to be executed periodically in the Cloud Functions for Firebase scheduler as shown below. The key point is that I want it to be executed every day at 0:05 Japan time as .timeZone(‘Asia/Tokyo’).

The deploy itself is working fine, but when I look at the content in GCP’s Cloud Scheduler, the Time Zone is set to (America/LosAngeles) as shown in the image below, and the actual execution time is off from Japan time.

I manually changed the time zone to Japan time in the Cloud Scheduler function management screen and confirmed that the desired behavior was achieved, but when I deploy the function again, it is still set to (America/LosAngeles).

#cloud-scheduler #cloud-functions #nodejs #firebase #google-cloud-scheduler