We are developing an app that requires the users to be connected to the internet either via WiFi or via 4G or 3G.
Can we use GCM, Google Cloud Messaging, to register and verify a user instead of SMS ?
That is, we are trying to find an alternative to text message or SMS, for sending a verification code to the user, similar to the way that apps like WhatsApp do.
If you want to provide 2 step authentication for users of your website, certainly GCM is a very good option. Create table that links GCM ids to user ids. YOu will of course need to write a bit of code to handle GCM registration id changes.
If you want to provide 2 step authentication for users of your android app. GCM certainly isn't a good option. Why because the 2 step authentication should involve a different device.
You can also try Google Authenticator app. No need for SMS when you use it.
Related
Hello Everyone,
I have create gmail app and complete all types of functionality but one functionality not implemented this one is mail receive in our gmail app.
Me search any types solution for receive mail and i have found one solution is google cloud Pub/Sub but this pub/sub how to implemented in our app is not idea show please tell me any one how to used pub/sub in android.
Cloud Pub/Sub is not the right choice for receiving messages on Android. The service is designed for inter-service communication. Using it on Android would present two problems:
The limit on the number of topics and subscriptions per project. Only 10,000 topics and subscriptions are allowed and only 10,000 subscriptions per topic. If you plan to scale out to many devices, you will run up against these limits quickly.
Security/authentication issues. You would need to ship the credentials within the Android application and so you will either have to generate service accounts for every individual device or use the same one across all devices. What do you do if those credentials are compromised? In the former case, you have to keep track of all of them and revoke the right one. In the latter case, revoking the privileges means all of your devices stop working.
You need something like Firebase Cloud Messaging to send data to Android devices. You may use Cloud Pub/Sub as a means to generate notifications out of GMail, but the subscriber would be another server-side application or perhaps a Cloud Function that passes the notification on via Firebase Cloud Messaging.
I've been looking into implementing firebase for my mobile applications. I understand how to set it up on the applications. Followed some tutorials
https://www.sitepoint.com/creating-a-cloud-backend-for-your-android-app-using-firebase
https://www.androidhive.info/2016/06/android-getting-started-firebase-simple-login-registration-auth/
My questions are:
Can I authenticate my users by only username or uuid no password required?
How can I set up the database to get data from my current server.
Can I push different notifications to each user and have the option to send to a group or all users?
Thanks in advance
Yes you can achieve this using Firebase Anonymous Authentication for Android and for iOs. IMHO, is my actual favorite because you can actually log in a user without getting any information from them, no email, no password and no OAuth authorization necessary. You need just to click a button an log in.
An important thing to remember is that when the user decides to become a real user, you can merge those two accounts into a real account.
You can easily get data from your server accordingly to your operation system, Android or iOs.
For push notification i recomand you using Firebase Cloud Messaging. Is a cross-platform messaging solution that lets you reliably deliver messages at no cost.
Hope it helps.
I'm wondering, is it possible to make Facebook application send message via GCM service to my android app updates about new posts/messages/contacts etc? I'm almost sure that something like that is possible for Google+, and also I noticed that Facebooks API messages structure is very similar (or identical) to GCM messages. That is why i think it should be possible.
In other words: Is it possible to make Facebook application work as a server that stores devices IDs and sends messages on some changes via Google Cloud Messaging?
You'd have to drop in some kind of middleware to handle the interaction between the Facebook and Google API's -- with that being said, it's definitely possible.
Facebook's API offers the ability to subscribe to events (realtime). There's only a handful of events that you can subscribe to, and everything is outlined here and here.
Alternatively, you could long poll for data that's not revealed via their realtime API. Just think about API limites, etc. before hand.
Keep in mind that you'll need to create a Facebook application, and your users will have to authenticate the Facebook application so that you have information to whatever info you're trying to access. Sames goes for Google.
We have a system that generates android apps automatically. The users enter in our website and login in their accounts and the users make a description of wich functionalities want and our system automatically generates the signed android apk and publishes on market.
The apps are published on the market with our developer account, not with the user account.
Such users would need PUSH notifications, for example, through GCM, to their applications. Therefore, we need to know if there is any way to automate the process so that users only have to enter on our website their google accounts and the message they want to send their applications, and our system must automatically send the messages to the phones that uses the user applications.
You have to remember and highlight the following factors:
Applications are published in the market under our developer account.
Users who have created their apps through our system have their own google accounts (not developer accounts) and want to send their messages from their accounts of Google and to its applications only, not those of others users and not using our google developer account.
The whole process should be automatic and transparent to the user, since they should only provide these data, their google account, the message they want to send, and the app that must receive the message.
Would it be possible to do this by GCM?
There is a GCM API with which to communicate to perform all these steps automatically?
Thanks
I think you could, but the user must register in GoogleApis to have their own SENDER_ID, then you should make a webservice in which you associate each user to their SENDER_ID and provide them an interface that only send notificatios using their SENDER_ID, however you should have a strong enough server to achieve this since Big Data could be an issue because you must also store the device_ids associated with each of your clients application, also you would be getting registration and unregistration intents from each application installed.
I have used Both Server Side (Grails) & Client Side (Titanium) to send notifications to the android device. So, I will be explaining you both one by one. But before that you need to add ADT plugin in to your Grails framework.check out http://tinyurl.com/chfthpe
I have one single Gmail account signed up for C2DM.
What I would like is that my app, thanks to this account (after having requested registration IDs and auth tokens for each device), could be able to provide messages to all the devices in which the app is installed.
I want to know if is it possible to use the C2DM in this way..
Thanks a lot
(for any details, just ask me.. )
ps I made the c2dm work on the emulator, but of course I cannot try what written before because I would need several phones..
Going off your question and comments, it sounds like you're just wondering if you can send c2dm notifications to an indeterminate number of devices using only one sender id.
That is exactly the way c2dm is supposed to work. You create one sender id to use on your backend servers, and that sender id is used in your app to register for c2dm notifications. Your backend then gathers all registrations ids and uses your one sender id to push notifications interested parties.
If I understood your issue correctly, the answer is: you can't.
You will have to send one http request, to google servers, for each device you want to reach.
There's no way to broadcast a message to all the users who have registered to your service.
It' frustrating because in my case I send a newsletter for all my users, so opening a connection to millions of users is expensive.
To solve the scalability issue I have created a simple appengine map-reduce task that loops through all the user registrations and create the http connection to the google services, it's the fastest you can go because it dynamically instantiate new servers for your delivery needs.
C2DM has been deprecated. GCM has replaced it, and it allows you to send messages to 1000 devices with one HTTP POST.
C2DM->GCM Migration Guide:
http://developer.android.com/guide/google/gcm/c2dm.html