Sending automated emails from Firebase through Google Cloud Platform (no third parties) - email

We've been doing some research for many hours already.
The first solution that appears everywhere (other StackExchange questions too) is using third-party service SendGrid.com and sometimes in conjunction with Zapier, but that's not the approach we are wanting to implement.
For sending without third-parties in the middle, the first solution that seemed viable was "Firebase Triggers", which was anounced on Google I/O 2014 but never came to life and seemingly was merged into Google Cloud Functions which is still in Alpha.
I'm pretty sure I had seen the solution almost a year ago in a link on the FireBase blog, but the only post that seems to have existed upon that matter is now empty.
We've never worked before with GCP, but our logic tells us this matter should be solved (inside Google) using with another GCP existing API, and the Mail API is apparently the correct one, but there seems not to be any way our Firebase Web App could make the request.
Could anyone (preferably with GCP experience) please explain what's the situation here, and how does Google expects it's FireBase developers to send emails to their clients?

Firebase Functions
As gracefully stated by #ajostergaard, TODAY Google has announced its much waited Google Cloud Functions, but precisely for Firebase they've implemented their own specific Firebase Functions which substitutes the Triggers shown in conferences since Nov. 2014 (more than 2 years ago!) and mentioned in Firebase groups .
This is an example link that explains exactly how to do what is asked in this question:
Sending emails from Firebase (FINALLY! and just in time for our WebApp)

Related

Customer-Supplied Encryption Key feature is not available (but it is!)

Not had a problem using the Customer-Supplied Encryption Key feature until today, when trying to access some stored files this error keeps appearing, even though it is supported in the UK and has been working perfectly fine for the past 18 months until now.
Am using the service via the Firebase Spark Plan so cannot ask Google for help directly, so just wondering if anyone else is having an issue?
Regarding the circumstances you described I advise you even if you don't have enough support level to open a ticket to our support platform, you can create a private issue tracker here specifying your Google Cloud Project Number and the link to this Stackoverflow question. If you follow this process, I'll be able to get this case, because I'm sure that we will need to perform some actions on your project to investigate deeper the root cause.

Google Fit Rest Api Step Counts inconsistent and different from Fit App

This seems to be a common enough problem that there are a lot of entries when one googles for help but nothing has helped me yet.
I am finding that the results provided by the REST API for estimated_steps are wildly different from those that appear in the device app.
I am running a fetch task for users via cron job on a PHP/Laravel app.
I'm using this https://developers.google.com/fit/scenarios/read-daily-step-total - estimated_steps to retrieve the step count.
Some days the data is correct. Some days its wildly different. For instance, on one given day, the REST API gives step count of 5661 while the app shows 11,108. Then there are six seven days when the stream is correct.
Has anyone faced this sort of behavior? I've tested for timezone differences, logged and analyzed the response json to see if i'm making some obvious mistake, but nope.
You may check this How do I get the same step count as the Google Fit app? documentation. Be noted that even when using the right data source, your step count may still be different from that of the Google Fit app.
This could be due to one of the following reasons:
On Wear, the Fit MicroApp when connected will display step counts queried on the phone and transferred over via the Wearable APIs. Other MicroApps accessing local-only data will only get watch steps. We are working on making this easier for developers.
Sometimes the step calculation code for the Google Fit app is updated with bug fixes before we are able to release the fixes to developers (which requires a Google Play Services release). We are also working on making it possible for developers to access fixes at the same time.
The Fit app uses a specific data source for steps and it adds some functionality (which can be seen on the documentation) on top of the default merged steps stream.
You can access the "estimated" steps stream as shown here:
derived:com.google.step_count.delta:com.google.android.gms:estimated_steps
Hope this helps!

Accessing Onedrive For Business Files via REST api in something other than a .NET application?

I apologize for my fundamental lack of knowledge in regards to these technologies in advance. I'm having a bit of trouble understanding the whole Azure AD/Authentication process in general, and I don't feel that Microsoft's support documents adequately describe much of the process.
I appears to me that the REST requests themselves are quite simple, and the following page seems to detail them quite well. https://msdn.microsoft.com/en-us/office/office365/api/files-rest-operations
However, what I fail to understand is the authentication process.
My goal here is to determine if what I'd like to do is even possible, so I will begin with that. What I need to be able to do is to be able to make REST API calls from a JSP or potentially a PHP script to access a link to a file located on a user's Onedrive for Business account. To put it simply, I would just like to be able to quickly get a publicly accessible link to a user's file. From the perspective of having access to the REST API, that seems to be a simple task, my challenge is understanding and implementing the capability to do so.
Correct me if I am wrong, but my current understanding of the process goes something like so.
Create an application in Azure AD, you need to define a location for signing on. I'm not certain how this works at all, does the defined location need to be making a request to sign on somehow? Does it need to exist on the same domain? I honestly have no idea the nature of how you actually go about signing in, but it requires some authentication of the application as well.
Once you have signed in, you have access to a 'security token' that has information about the application and what it can access. how is this token stored? A server session, browser cookies?
Somehow you pass this token along with your REST request and it is determined that you have access to the information you are requesting.
I have used pre-made JavaScript file pickers in the past to facilitate the selection of user files for things such as Google Drive and Dropbox, but it doesn't appear as though any such tools exist for Onedrive for Business, so I will need to become familiar with the authentication process myself. Looking into the Microsoft documentation has only served to confuse myself more, and unfortunately all of the examples are for .NET projects as far as I can tell. I am afraid that this means that is it only possible to access this information from a .NET project, but please correct me if this is not the case.
I realize that this question appears extremely ignorant, and that's likely because it is. Moving from JavaScript file pickers to something like this appears to be a significant leap in required technical prowess, and I'm still rather new, so please forgive my inexperience. Most importantly I'd like to know if what I'm looking to do is possible at all, and secondly if there are any readily available resources that are a little more focused than the Microsoft documentation.
Thanks in advance for any assistance.
There are some great resources available for coding for Office 365 and not just those on MSDN.
The best place to start is http://dev.office.com. This is the destination for information on O365 development. You can get to the documentation, training materials and code samples. The code samples have a filter so you can search on a number of properties including language and product. There are samples of course for .net, but also for iOS, Android and PHP, which is what you mention you want to use for your project.
http://dev.office.com/code-samples-detail/2138
This sample connects to the calendar, but the important part is understanding the authentication process for your application to Azure AD. Once you get the authentication working, you can call the other O365 services by getting the resource url to the appropriate resource from the Discovery Service.
If you need more samples, http://github.com/officedev is the place to look. These samples are from Microsoft, the community as well as the code used in Microsoft and community training events and presentations.
If you prefer, some great training courses exist on Microsoft Virtual Academy for Office 365 development. These are online videos that are broken into chapters and sections so you can easily find what you need. They often have labs associated with them as well. I recommend the Intro to Office 365 Development - Section 5 to get a quick overview of the Office 365 APIs and then look at the Deep Dive: Integrate Office 365 APIs in Your Web Apps.
If you still have questions, this is the place to post them. Hope this helps. Reply if you have any questions.

Real time web page

I want to build simple web based app, where users, for example, could push the spacebar button, and then do something further, like answer a question, and while other users at the same time only sees that this question is not available any more for answer. When user submits answer, everyone see it.
All right, here is an example. I have seen TV shows, where four players have one button, if one or two of them know answer, they hit a button, and one lamp turns on and the first is allowed to answer, while other keeps their mouths shut. I want to build the same idea, but in the web.
But problem is that, I don't know where to start, what keywords I should search for help on google and so on. I see, that it might work on HTML5, maybe JavaScript and so on.
I have idea using Ajax, but request it every second to get latest actions made seems rubbish. Also I found one service called Pusher, but it has limited users in one time, which doesn't fit my needs.
I need just ideas. Thanks.
Before you read the rest, a disclaimer: I work for Realtime.co but I do believe I can help here so I'm not trying to "pitch a sale".
You can check out Realtime (www.realtime.co). It's basically a set of tools for developers to use real time technologies on their projects. It uses websockets but does fallback to whatever the user's browser supports (such as long polling, for example).
Behind Realtime you have a one-to-one/one-to-many/many-to-many messaging system that will transport your messages to and from your users.
There's also a plus which is the fact that the Realtime framework is actually cross-platform. This means that you can even have your web users communicate with iPhone users, Android, users, Windows Phone, desktop applications, server applications, etc..
You can learn about the JavaScript API here: http://docs.xrtml.org/getting_started/hello_message.html#javascript.
You only need to register at Realtime.co as a developer and start using the free license.
I really hope that helps.
Okey, I think I will go with node.js.
Writing all this previous post, made me think in right way :)

GAPI Class, Google Analytics API

I am about to start a new project in the Google Analytics API & PHP.
I read that Google Analytics will be deprecating XML v2.3 and v2.4 and in 6 months time, so aparently you will only be able to use v3 and retrieve information in JSON format.
http://analytics.blogspot.com/2011/12/introducing-google-analytics-core.html
My question is the following: Does this means that GAPI class won't work any longer? Anyone who has used this class before can help me answering this question ??
http://code.google.com/p/google-api-php-client/
In that case, any alternative suggestions of PHP classes that do the same thing.
Thanks so much
I've been using GAPI for a while now. And I can say with some confidence that yes it will break, if not due to XML it will be due to some other change google makes.
Having said that GAPI is the best solution I have found out there for php. It does break every 6 months to a year, usually needs one or two lines changing to fix. But GAPI is pretty popular so at least you know when your clients are calling saying analytics is throwing errors at them, you wont be the only dev tearing your hair out.
9 times out of 10, by the time I've got a problem someone else has found the fix - which is nice.
There are a few other php options out there but GAPI seems to be the most popular (usually the best way to go imho)
My approach is to build an analytics summary in the dashboard and provide a link to google analytics underneath so clients can see the full data or go there when GAPI breaks. I have been putting all my sites on the same modular system for a while now. I keep GAPI as a library in my admin layout module, this means I can make the fix once and roll it out to all my sites without too much drama.
In summary, use it but expect it to break - that way you wont be disappointed when it does.