Can GCM support multi-language user and content? - google-cloud-messaging

we are making a news app. Now we have three language options for our users and we have news in three languages. If a user choose English in the settings. we don't want them to receive the Malay language notification. Can we realize this kind effect with GCM(Google Cloud Messaging)?

Sure , You can use
different PubSub Topic for diffrent labguage
,
When your select language then subscribe to that language so user will receive GCM notification of only his/her language.
GcmPubSub pubSub = GcmPubSub.getInstance(this);
pubSub.subscribe(token, "/topics/"+LANGUAGE , null);

Related

Assigning webhooks to Firebase Messaging "subscribe to topic" event

In my current project I am using the Kreait Firebase PHP SDK to send out push notifications to Android & iOS devices that have subscribed to notifications on named topics. No issues thus far. However, rather than have fixed topic names I would now like to generate topic names based on the current "condition" of the connecting device. The condition could, for example, be a geographic location.
This is not too difficult either and I have modified my app to handle this. However, in order to put the ability to have such autogenerated topics to use I need to know the topic names on my server so I can send out targeted messages via Kreait. I find Google's Firebase documentation a bit dense at times and have not been able to establish whether it is possible to assign webhooks that get called by Firebase whenever a SubscribeToTopic, UnsubscribeFromTopic event occurs.
A simple question - does FCM even offer anything like this capability? If so, any pointers to the relevant documentation would be much appreciated.
There is no public API to get a list of topic names from Firebase, nor is there a way to hook into the subscription mechanism.
Your best bet is to simply make two calls when a user subscribes to a topic: one to Firebase, and one to your own backend API that keeps a list of active topics/conditions.

How do you handle Localization/i18N in notifications?

First of all thank you for your time reading and maybe answering this question.
We have a react native app that uses react native Localize to handle i18n, and Firebase to handle notifications, those are sended in a PHP server.
We save the user´s locale (which we take from the phone) in our database after sign up. When we send the notification we translate it according to the users locale before sending it to the app.
But the user has the ability to change his phone language, so the notification might arrive in a different language because he has change it.
We first tought of checking each time the user loads the app if it´s locale has changed and update the bbdd field.
But we are not sure if this is a right approach.
How do you usually manage it?
I am having the same problem. I believe that other solution is offer the language setting inside your own app instead depend of operating system language, already see others apps making it.
With the language config inside your app, can you have total control of language to send push notification if you persists it in your backend.

SMS API that allows you to specify FROM?

I'm wanting to move away from using $phonenumber#$provider domain because it is too limited in usability.
Is there a SMS service with a good API (prefer HTTP/s, XML, JSON) that allows you to send from a specific phone number?
The reason I want it to come from a specific phone number is because I have a Google Voice number I use for my business...
Since you want to use your google voice phone number maybe you just want to send the SMS though google voice. One way to connect w/ google voice is to use the Asterisk software. You would use Asterisk to talk to google voice over the SIP protocal - documented here:
http://michigantelephone.wordpress.com/2010/05/21/how-to-use-google-voice-for-free-outgoing-calls-on-an-asteriskfreepbx-system-the-easy-way/
and
http://eggie5.com/10-installing-asterisk-on-osx
For example I did this and then I interface asterisk from ruby code and can make calls, sms, etc.
Twilio will let you set the FROM number to any Twilio number that you own. Of course, you'd have to give up your Google Voice phone number. I'm pretty sure you won't find any SMS service that allows you to set the FROM number to an arbitrary number (just think of the mess it would cause).
See comment below indicating that the Google Voice number could be ported to Twilio.

how can I use youtube API to search channels by country?

I want to search Youtube channels and filter them by the user's country among other stuff
How can i do that ?
I never dealt with an API before , so it would be useful to direct me which language should I use and some tutorials on youtube APIs other than Google's.
you can use the api in different languages , you should go through developers API here , It has all details,
http://code.google.com/apis/youtube/getting_started.html#data_api
Search for standard feeds here ,
http://code.google.com/apis/youtube/2.0/reference.html
search appropriate URL according to your needs.

Testing SMS code without access to a texting plan

Is there any way to test SMS messaging without having a texting plan?
There isn't any way to setup the equivalent of a mock email server for the purposes of testing an SMS service is there? Are there any other ways to accomplish the task? Perhaps setting up something like a GrandCentral account that can receive text messages?
I am looking to test SMS messages to multiple accounts without having to find multiple people with texting plans and coordinating the effort.
Google now has the answer for which I seek. With the roll-out of their new Google Voice (previously GrandCentral) they added the ability to received text messages to the phone number (which currently is free). While technically somewhat of a text plan, one could theoretically sign up for a few accounts and be able to test multiple phone numbers.
http://www.google.com/voice/
Update (Nov 2010):
Perhaps an even better way to do this now is to use either Tropo (tropo.com) or Twilio (twilio.com). Both of them offer low cost SMS messaging and Tropo is free for development. I've been using Tropo and it's very quick and easy to setup and write and code for.
It would depend on the method of how you're sending out the SMS messages. If you're using the email method (<ten digit number>#<cell provider's doman>) you can fake it with a regular email account that can be purged automatically. If you're using an actual SMS publisher your best bet would be to refactor the design so that you can test that your function gets called the expected number of times, but doesn't actually send the messages. Then when you want to test the production-ready code you actually round up a group of people and try it out.
Having a provider that doesn't charge for incoming text messaging (like US Cellular) comes in handy for situations like that.
SMS text can be done under a few different protocols. I've had success with SMPP using the Easy SMPP .NET library and this java-based SMPP server simulator. It saved me a bunch of overpriced service charges.
you can send email to their phone:
18005551212#txt.att.net (IIRC)