How to obtain GCM registration id using only C# code? - c#

I want to send push notification to Android device using Amazon SNS service.
But as listed on Amazon's official site:
You send push notification messages to both mobile devices and desktops using one of the following supported push notification services:
Amazon Device Messaging (ADM)
Apple Push Notification Service (APNS) for both iOS and Mac OS X
Baidu Cloud Push (Baidu)
Google Cloud Messaging for Android (GCM)
Microsoft Push Notification Service for Windows Phone (MPNS)
Windows Push Notification Services (WNS).
So I am using GCM as an intermediary to send push notification to my Android device.
Here is an another link that states how to create project with GCM: http://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html.
So far I have able to successfully create project in Google with my Server key and project number but only thing I am not getting is how to generate Registration Id and from where.
Do I need to programmatically generate registration id from my C# code?
But I couldn't find any code in C# to generate registration id. I have just find code in Android to generate Registration Id.

Having just set up SNS for a mobile app let me try and clarify a few things about SNS.
Amazon SNS is the intermediary not GCM. The workflow goes like this:
Using the GCM Project Key you set your app up for push notifications
A user downloads your app and when it launches, it connects to GCM
and lets Google know that this app/user combo would like to receive
push notifications.
GCM sends back a device token that represents this individuals device
and app instillation.
You send this device token to your c# server code where you can use
the SNS api to register the token with amazon and save it as a SNS
mobile endpoint.
Then you can use that endpoint Id and your server API key to send out
the notification.
This part of the documentation should be exactly what your looking for.
Hope this helps,
http://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html

Related

Is Firebase Cloud Messaging free for unlimited mobile user?

My project already have developed mobile application (hybrid using Cordova). Now we want to support a push notification for Android and iOS. We are planning to support push notification using Firebase Cloud Messaging (FCM). Idea is that our mobile app will be registered with FCM and we will use FCM to send push notifications to (read unlimited) mobile devices.
As per many site, FCM is free for push notification, but I did not see clear guideline by FCM sites.
Additionally FCM pricing model also says that 100 real database connections are free and after that you need pay as per licensing model.
Refer : https://firebase.google.com/pricing/
Question is, do I need a real database connection with FCM if I am interested only in push notification feature? Is push notification feature of FCM is free for unlimited mobile devices connected to same mobile application?
If anybody have official document on this, please share.
Firebase Cloud Messaging is a free Push Notification service (previous version known as Google Cloud Messaging).
Do I need a real database connection with FCM if I am interested only in push notification feature?
No. FCM is a separate service from Firebase Realtime Database.
Is push notification feature of FCM is free for unlimited mobile devices connected to same mobile application?
Like I mentioned initially, the FCM service is included free for any Firebase Plan. The Pricing documentation already shows this:
Included Free
Analytics, App Indexing, Authentication, Cloud Messaging, Crash Reporting, Dynamic Links, Invites, Notifications & Remote Config
And yes. There is no limit to the number of users you plan to connect using FCM. See my answer here.

Apple Push Notifications dropped from Azure

I have developed a ASP.NET MVC web application that exposes several APIs. One such API is to send a push notification via apple APNS to users. In my c# code i run parallel tasks for each notification that should be sent out. We are then calling Apple APIs direct. Some users are complaining that intermittently they do not receive push notifications. I wanted to know if there are some things to be aware of when attempting to send push notifications from Azure?
Thanks in advance.

cordova, Phonegap push plugin and c# for single registration?

is it possible to send a notification to a specific registration(device) using c# server side code to a cordova mobile application having the Phonegap push plugin?
Short answer is Yes:
But you don't send push notifications directly to devices, you have to go through the platform holders servers. For Android that GCM (google cloud messaging) and for IOS that's APNS (apple push notification server).
To interact with them you could use a library like PushSharp (free) or Amazon web services has a fairly cheep implementation called SNS (simple notification service). Amazon SNS has a .Net api that you can use on the server side.
Push Sharp

Google cloud message(android) and window form(C#)

I want to send message and specify phone number from destop window application(my app on destop) to android application(my app) on mobile device by google cloud message.
So I think I must create a new web service so that I can push message from that service to google cloud message.How can I can do that?
You will need the deviceID of your android device to send a notification to the device. So, you will need to design your web-service to have following functionality:
Receiving the deviceID from the android device.
Sending a message to the device whose deviceID is known to you. Your desktop app will need to talk to your web-service which can in-turn send message to google servers. GCM will handle sending notification.
The part of obtaining the deviceId of a android device to sending message is explained well here:
https://developer.android.com/google/gcm/index.html

Android and iPhone PNS details

i am crating a wcf data service for sending notification to iPhone and Android devices. i am writing server side code to register the devices, i just want to know what all information iPhone and Android send to server for registration process and what all things i need to store in my data base for sending notification to iPhone and Android.
Android and iOS PNS are really different, and will not send the same amount or structure of information to handle device registration, unregistration and message handling. You should start from the specific documentations from both those worlds and implement different services for each of them. These two worlds cannot be collapsed into one, I fear ...
WCF Data Service will not allow you to do push notifications to Android and iPhone. WCF Data Service (OData service = REST) offers only request response message exchange pattern where client (Android and iPhone) must ask for data by sending a request.

Categories