Does C2DM registration id change when a different user logs in? - android-c2dm

From the documents it appears that there should be a valid Google-account on the phone before an application signs up and gets its registration id.
What happens when the user signs out of that application, and some new user signs in. Does Google issue a new registration id?

To push messages to a device you need the registartion id from the device.
You have to generate this id in your app via registration intent.
This registration id is an ID generated from the app, your device and your google account.
Once you have the ID and you are registered for C2DM you can push messages on the device with this id.
You will call an URL from google and post the register id through the url. Google then sends the push to the device (Google knows you because you are logged in in your google account on your device).
If you change the Google account you won't get any pushes, because the registration id is also generated with your Google ID.
You have to call for a new registration ID.
Here is a nice tutorial for push.
hope this helps

Related

Google Play Games - How to ask the user to create a gamerId account when signin in

When a user signs in my web based game with Google SignIn through a web browser, access is granted. However, when the app makes a call to the Games Services API, it returns the following error:
User registration incomplete
If the user goes then to the Android Play Games app and creates a Gamer ID account, it works.
So, is there any way to tell the user to create a Gamer ID account when she signs in if she wants to proceed? Or, better, can Google redirect her to a page for that, complete the process and then come back to the app?
The Gamer account (also sometimes informally referred to as Games lite account) can only be created on Android devices. Once it is created it can be accessed from other platforms.

How to pass user authentication through jitsi-meet external API

I am building chat capability in my web application. I am using jitsi as our chat server. There can be 2-4 user in a video chat session. These session will be locked. Web application will initiate the chat and will control who can join the chat room.
I am trying to embed jitsi meet inside an web page using jitsi-meet
external API listed here
https://github.com/jitsi/jitsi-meet/blob/master/doc/api.md .
Our jitsi-meet is not open to public and protected with XMPP
authentication. How can I pass the authentication information through
jitsi-meet API?
I also want to lock the conference room with password. Does jitsi-meet API
have this option?
I am new to this domain. So if you know a better solution please suggest.
Yes there is:
api.executeCommand('password', 'The Password');
Best way I am using with a php/mysql app is generating a room with a random name (usually complex) from the 1st user (the caller), protecting that room with a password and sending the rest of the users a message through the app so that they can connect to the same room with the first.
This way the first user is the end point and the rest connect to the room the first user made.
You should check the other users are online at the time the room is created. The only parameter is the room name which must at all times be unique. Maybe count participants after you enter. When the last user leaves the room, the room gets destroyed. So the users hold the room.
You can also send a mail instead of an internal message.
You need to add JWT token-based authentication in jitsi then you need to generate JWT token & pass it through Jitsi's external API, in this way:
const options = {
...
jwt: '<jwt_token>',
...
};
const api = new JitsiMeetExternalAPI(domain, options);
for more detail, you should checkout Jitsi's iframe docs

send notification to a particular user with notification hub - Azure and GCM

I am a software developer in Xamarin - Android, I want to create notification messages. For this purpose I use Azure notification hub, combined with Google's service - Google Cloud Messaging (GCM).
My problem comes when I want to send notification to a particular user. I realized that I need to use the "TAGS" When I compose a new user to the system (Uniqe TAG)
Indeed, it works great, but when the user logged off his account, and then connect to another one (with another TAGS) - the TAGS of his old account are kept in a certain time, and he continues to receive personal messages from the previous account!!!!
Does anyone know what can be done about it?
thank you very much
This is actually an issue a lot of people/apps have on iOS and Android.
What you should do is:
Register your app at your Azure Notification Hub (ANH) on first start and reregister at every app start, to keep registration in sync
If a user logs in, update the registration with an additional tag for this user (e.g. "user:XY")
Sending notifications to that user tag will of course result in notifications on all devices the user is logged in on
If a user logs out, update the registration without the user tag (omit the user tag, so the registration doesn't have user tag anymore afterwards)
The registration will be updated immediately on ANH and sending notifications to the user (tag) will not result in notifications on that specific client
If the user can logout on your app without internet connection, you won't be able to update the registration of course and you will still have the problem of getting notifications for a logged out user. But as soon as another user logs in, the registration should get updated with the new user tag and everything should be fine again...
What you shouldn't do:
"Developers should never unregister the client app as a mechanism for logout or for switching between users..."

GCM: registration id or token

For Google cloud messaging, is there a use for storing the token? Or can we just work with the registration id? Trying to setup push notifications and was wondering why they use both tokens and registration ids.
Use the token on your server, to specify the device you want to send a message to. You, as a developer, have no significant use for the registrationID, in terms of actually sending the message.
From my understanding, token is used to authorize your application' access to Google Service while registration id is the unique identifier of an app on a specific device. GCM uses Registration ID to identify the device and app to send push notification to. So to answer your question, you need both of them.

Client ID and Client secret to access foursquare api

I am going to access foursquare api. As I was going through their documentation,I am going to use
https://api.foursquare.com/v2/venues/search service to serach for the venues.
To use this api we need client id and secret and has to be appended in the above URL.
But how to get this client id and scret. Should I register my app in the foursquare site.
Is the following url correct for registering the app:
https://foursquare.com/developers/register
If it is correct,it is asking for the app market id. Our application is not in any of the app market because it is an enterprise app.So in that case how to get client id and client secret??
Kindly help.
You can complete the form without inputting details about App Market IDs by simply hitting the 'Save Changes' button (the App Market fields are not validated on submit). This will bring you to a screen that contains your client id & secret.