How to use FCM pkg on Django? - django

I'm using the fcm_django package to send notifications API to Firebase but I have some confusion about those two concepts on Firebase like so: (registeration_id and device_id)
https://fcm-django.readthedocs.io/en/latest/#setup
I placed the "server_key" of Firebase to registration_id but don't understand what does device_id means and what is the value I should put on it?
after answering the above questions I tried to send notification from Django by the admin page on Django by creating registration_id which is "server_key" and defining the type which is a "web", but when I created this object I didn't see any message has been sent to Firebase cloud.
Note:-
I want to send notifications to only one device not many users.
so, can anyone help me to achieve this mission succeeded?
Thanks in advance

The device_id is a token that is generated by the Firebase SDK on each device/app combination that wants to receive messages from FCM.
To learn how to access this token, have a look at the documentation for Android, Web and iOS.
Once you have the token on the specific client, you will need to send it to a place where the fcm-django package can then also access it; typically a cloud hosted database, such as the Realtime Database or Firestore that are also part of Firebase.
From there your Django can then get the token, and pass it to the fcm-django API.

Related

GCP Identity platform integration with golang backend

I am developing web platform which has to have 3 type of users (user, admin, partner companies). For the authentication I am considering to use google Identity platform with multitenancy (probably users in one tenant and admins are in different tenant).
As I understand from documentation, how do we integrate identity platform to our application is to create identity platform provider from console and integrate it into frontend with UI. From front-end, without contacting backend service we can sign up, login and logout by calling firebase SDK and it will give us authentication token. From backend I can check that token with middleware and decide if I agree the user as authenticated or not. Correct me if I am wrong.
Then I can get some metadata of authenticated user from the token, maybe email or name etc. But I want to store user related information on noSQL database as well. For example, if user wants to change his email I need to handle it in backend server, also, I'd like to store users log (access and audit log on somewhere else). In case of, I am using frontend UI and SDK how do log the access and audit information on my backend? also, when changing user's information, do I just write handler function in backend end update user's data with REST API or Admin SDK? what is the best practice over here? Or should I better write my own login and logout function on my backend then call REST API or Admin SDK? is there preferred way? Google is showing me only integration way of authentication from frontend?
BTW, I am deploying backend application on google cloud run, and frontend would be developed in react and should be deployed maybe in firebase or in cloud run as well.
Thanks
As per the Documentation,Yes your understanding is correct to integrate identity platform to the application.
You can store the user related information on a noSQL database like Firestore or Firebase Realtime Database. You can write the Rest API to change or update the user's information in the database.
If you want to write your own login and logout function, I don’t think it is necessary because Firebase Admin SDK provides these features. But if you want to manage user authentication in the backend for specific requirements, you can write your own login and logout function on the backend and use the Firebase Admin SDK.
For access and audit log information you can use Firebase Analytics, Firebase Analytics helps you understand what your users are doing in your app. It has all of the metrics that you’d expect in an app analytics tool combined with user properties like device type, app version, and OS version to give you insight into how users interact with your app.
But finally, the best way would depend on your requirements and use case.

Is AWS SNS required for Firebase Cloud Messaging?

I have a production server running an application and also a mobile app for the same, I want to use FCM as my push notification service , but what I'm seeing from the google website and most stack overflow answers is somewhat conflicting. Stack has a lot of answers on how to get FCM running on SNS, I want to know is it possible to simply use FCM (as its free) or would I need SNS , if not why bother setting up SNS for FCM? Keep in mind I only want to use FCM through an API for a django server and not through the firebase console.
The Firebase documentation is clear on how to get started, and nowhere does it state that SNS is required. Just follow the documentation for your client app platform.
If you want to send messages from your AWS backend, you can just use the Firebase Admin SDK for your chosen backend OS. It will also not require SNS.
If you are having a specific problem with FCM, you should ask a new question explaining what you've done so far that doesn't work the way you expect, along with your code and links to the documentation you're working with.

Using FCM with django and flutter

I have a django backend server and I want to send notification to my flutter app. I want to use Firebase Cloud Messaging for this.
My question is, do I need to store something in my database to send notification to the app? I was planning to use django_push_notification on the backend side.
You need to store the device id on the server to be able to send push notifications to your app. You can use this django app to expose rest endpoints the id registration and sending notifications: https://github.com/xtrinch/fcm-django

FB Graph API - cannot enter with my own App token

i facing an issue regarding the FaceBook Graph API.
actually a friend of me, have an FB App whitch can be used for the Graph API.
But in that case I activate a FB dev APP for myself, i'm not able to generate a valid security Token with the App-ID and App-Security.
At first the App is live and activated. For that I don't understand the error message at the end.
Second I don't want to have a User-Token with a validation for an hour.
These are the step's i following:
getting App Token
https://graph.facebook.com/oauth/access_token? client_id=20179479xxxxxx&client_secret=3048xxxxxxxxxxxxxxx&grant_type=client_credentials
The result i'm receving:
"access_token": "20179479xxxxxxx|Pqxxxxxxxxxxxxxxxxx",
Now if im trying to use the Graph API Explorer and trying these token as authentication, I'm facing an #200 OAuthexception
my request:
Get -> /v2.12/coca-cola
"(#200) Access to this data is temporarily disabled for non-active apps or apps that have not recently accessed this data due to changes we are making to the Facebook Platform. https://developers.facebook.com/status/issues/205942813488872/",
Have somebody any ideas how to solve or what i'm missing here?
With the Security Token from my friend he can use the example with coca-cola from the developer like in the documentation and example from FaceBook as well.
Thanks in advance
Facebook is changing the API due to a security issue. This means new apps have more restrictions and less access (for the minute) than apps that were already registered and using the API, probably why your friends key works. Seen as your app is either new or hasn't recently accessed the data you are requesting, you currently cannot fetch it.
Its not known what features will be removed from the API following this incident - as a result I wouldn't come to rely to heavily on any feature the API offers.
Im hearing that the ability to retrieve events could either be removed or the data you can access from an event is going to be severely limited, however thats not from any official facebook source. All apps will be subjected to a review according to this official facebook post, before they are granted access to the Events API, Groups API, and Pages API.

Application as an API in WSO2API 1.7

I have published an application as API in WSO2 api manager.So when subscriber visits the wso2 store and opens the api,should be able to see the result(call to the restful service deployed) as though a JSON response.Currently as the subscriber opens the api, they are only able to see the API details with the Production and Sandbox urls which they do not understand how to be used.Isn't there a way I may allow them to open up into a front end UI message which the user understands to go ahead rather than arriving at a new place which is not understood.or any better way of handling it.
Product you need for this is WSO2 APP Manager. not API manager