FCM http v1 API integration for servers using programming languages including c++ that does not have SDK supports - firebase-cloud-messaging

We're considering to migrate legacy API to FCM HTTP v1 API to fully utilize FCM functionalities.
Although they provide API Client Library for various programming languages, it could not be possible to cover all programming languages including C++.
Because our push server is written in C++, we decided to implement the protocols. However, we could not find any documents on how to get access token using service-account.json file or server key that can be found in firebase console.
Is there anyone who integrated FCM HTTP v1 API without SDKs that FCM provides?

I figured out the problem.
These articles helped me to implement the protocol in C++. Now it works well. developers.google.com/identity/protocols/oauth2 developers.google.com/identity/protocols/oauth2/service-account

Related

Does exist a universal tool to describe different APIs (REST, WebSocket, gRPC, custom framework)?

My project uses different protocols to communicate with other services:
REST API
WebSocket (STOMP)
gRPC
own framework build over gRPC.
I need a tool, or a bunch of tools, which allow me to generate documentation for the APIs. In the best scenario, it's a maven plugin that generates a report with all APIs.
We use Swagger to describe the REST API. It has poor export options and needs a lot of annotations in the code, but describes the API well and offer the test machine.
Alternatively, Spring RestDocs (AsciiDoctor) could be used for the REST API describing. It offers a better format for reporting, but we prefer Swagger.
That's all I found for the REST API. But I didn't find anything for describing WebSocket API, gRPC and the custom framework.
I will be very grateful for any help and ideas to solve the problem.

Server Architecture .net/cocoa app

I'm planing on creating an native .net app for Windows as well as a native OSX application with swift.
These two applications should be able to communicate with the same server. With that I mean writing and reading from the same SQL Database, and have REST communication with the server.
Now I'm struggling to come up with a solution for the backend. I'm looking into Serverless backends like Azure or Google Cloud, but I'm not sure that I can use these Services with both my applications. Both Azure and Google Cloud have SDKs for .Net but I've never found one for Swift or Objective-C.
Are there such Services that allow me to communicate or should I just develop my own?
Do you have any good solutions for my problem? Or what is the best server architecture to use for this kind of problem? Any inputs are appreciated!
If your servers vend a REST API, no vendor SDKs should be required. REST is platform- and vendor-agnostic. All you need is an HTTP client, which Swift/ObjC most definitely do have. I use a serverless (AWS Lambda) setup from Swift, and it's easy. Though, I have done this kind of thing before :)
What I would do is setup a simple test server, and expose an API endpoint. Make sure you can reach it with curl from your machine. Then, take a look at the NSURLSession APIs in Foundation. They'll help you make an HTTP request similar to what curl can do. From there, you'll need to investigate serialization (like JSON), which Swift can also do easily (as of Swift 4, I believe).
Good luck!

Does api work like bytcode to provide multi-platform functionality

I've recently come across the term api and from what I have known api is a interface that connects/integrates between two programs and it can run on any platform.
And again from java we know that it turns it's source code into bytecodes and this bytecode can run on any platforms since it is platform independent.
So my question is does api work/run just like as a bytecode to provide multi-platform functionality
And if not is there any similarities between them or thier process? If please anyone could explain it to me it would be a great help. Thanks in advance.
API does not work like bytecode
Actually, API and Bytecodes are a completely different thing
For Bytecode,
let's try to understand it in java. java compiler compiles a java program then produce bytecode. Then the bytecode is interpreted by java interpreter in different machines and generate different executable files as the requirement of different machines and os.
this is how java maintains it's multi-platform property
Now, API,
API stands for Application Programming Interface. An API is a software intermediary that allows two applications to talk to each other. In other words, an API is the messenger that delivers your request to the provider that you’re requesting it from and then delivers the response back to you.
there are many types of API's out there
but I think you are referring to Web API and it's multi-platform functionality and how it works.
A Web API is an application programming interface for either a web server or a web browser
A Web API works as server-client architecture.
client request to server through HTTP protocol, server responds to client through HTTP protocol
actually whole api service is provided through HTTP protocol, and this api service can provide to any device using HTTP protocol
this has nothing to do with bytecode

want to understand whatsapp work flow and architecture

I have some questions like how whatsapp server is working, though I read in internet, I want to understand much. And what is XMPP? how it is working, How can I send data through XMPP. how can I integrate XMPP with application, can anyone pls explain?
WhatsApp under the hood?
There are rumors WhatsApp uses a customized version of XMPP. Sources are closed so we can only guess.
Understanding XMPP will however give you all the tools to create your own WhatsApp clone.
What is XMPP?
According to Wikipedia (which hosts further references):
Extensible Messaging and Presence Protocol (XMPP) is a communications protocol for message-oriented middleware based on XML (Extensible Markup Language).
Which is to say that XMPP is an xml based convention for exchanging messages between parties. It's best known implementation is Ejabberd chat server.
XMPP can however be used for other things, among them the web of things.
How to send messages?
Assuming you want to create a chat application, you will need:
An Ejjaberd server up and running.
An appropriate xmpp SDK for you language/framework. Example: Smack for Java or agsXMPP for C#.
A good kick-starting tutorial about how xmpp works can he found here: part one and part two.
There is also the RFC which contains the most comprehensive documentation out there.

Is there any solution for generating the restfual api code both for client and server

The functions for operating the restful api is quite same. Is there any project that can generate the source code for different platform such android,ios and backend stuff.
I suggest you to use API description languages such Swagger ou RAML.
After having described your RESTful application with a language like this, you will be able to generate things like server skelekons and client sdks with different technologies and languages. You can even generate documentations.
With Swagger, swagger-codegen will do that. swagger-ui may also interest you for the documentation part.
To finish, I would like to mention the Restlet studio that allows to define graphically and quickly the structure of RESTful applications and generate then the corresponding Swagger and RAML contents. The APISpark plaform provides a mecanism to introspect Restlet applications and generate the corresponding contents with these languages. It also allow you to generate a set of server skelekons and client sdks.
Hope it helps you.
I will suggest you to use Spring RESTful webservices starter kit. Which will manage your back-end with centralized database. Also Spring has its own android libs to communicate with REST Apis.