I'm using Firebase-Invites to share an item using sms and email.
Email is working as expected but Sms is being send only if all the characters are in latin.
Note: I know there is a limit of 100 chars and i'm not exceeding it.
From #Oleg Cherr answer i realise there is a limit of 40(!) instead of 100 when using not-latin characters (even only one!).
So i searched and find BalusC answer to how to know if there is at least one not-latin character:
boolean valid = input.matches("\\p{L}+");
In this case i set another, shorter message and it seems to work perfectly.
Related
My homemade Android email client app, using Java mail, works fine with google mail service.
One use case for which I would like some piece of advice does concern the 'unread messages':
Whenever I 'Mark as unread' an email in mail.google.com, my mobile app update the email as 'unread' accordingly. Good.
Now I am using inbox.google.com and the 'Mark as unread' option is not present anymore.
As explained on the How Inbox works with Gmail page from Google, some actions are identical and other are similar.
About 'Mark As Unread' feature, it is not present anymore in 'Inbox'.
Instead, a 'snooze' option is replacing it:
In GMail (mail.google.com): 'Mark as Unread'
In Inbox (inbox.google.com): 'Snooze' (NOT identical to 'Mark as unread', but has 'similar' behavior)
Question:
How can I figure out, in my android java code, that a message is 'snoozed'?
I googled for it and checked GMail's extensions but could not find an answer.
Note:
I also checked Imap messages userFlags and systemFlags: nothing there :/
Thanks.
It looks like a lot of Inbox's features are implemented as a special kind of label: one that you can search for, but not one that appears as an actual Label or any sort of metadata in the Gmail API (or IMAP).
Try this (if you're an Inbox-by-Gmail user): open the Gmail web client, and enter label:snoozed in the search box. It should find all your snoozed messages. Also works for label:pinned, label:done, label:trips and label:purchases (Inbox smart bundles), label:lowpriority, etc. (Also try creating a new label with any of those names: they're all "reserved for system use.")
Even though they don't appear in the Gmail labels.list API, you can use these special Inbox label searches with the q (query) parameter in threads.list and messages.list.
So to figure out if a message is snoozed from your code, see if its message id appears in messages.list called with q=label:snoozed.
I don't see any way to add or remove these special Inbox labels on a message through the API, unless/until Google exposes them like other labels. (FWIW, the special Gmail Categories do appear in the API, e.g., "Updates" is a system label with id CATEGORY_UPDATES. So maybe there's hope things like "snoozed" make it into the API, too, as those Inbox features find their way into Gmail.)
I'm developing an android application with communication integrated. My application have to show number of unread messages via app icon, it's will be look like that skype, facebook or etc. I can not found any solutions to perform it, please help me.
You can use this library
It works well for most of the devices.
PS. Nexus devices (or, more specific, the google launcher) does not support this!
You have to pass token with a message if a message is read or not.
Suppose we have a token 0 for read messages and 1 for unread messages.
If message read then make token 0 else it is 1.
To count the total number of unread messages, count the total number of unread messages (where token=1) from the list.
You can use this repo or use any repo from this link
Hi guys I need help from you all in Android mobile number verification process. I have a android phone I just need to verify the otp but in this case they using the auto verification method is it possible to verify my otp through fwd the msg or by using prank message app Pls anyone help me to solve my problem and thx in advance...
Assuming that you are asking for "how to implement OTP verification". There are number of ways to tackle this. Please look at the below link for two ways of achieving this using Google authenticator or using a SMS gateway.
Android one time password (OTP)
here is the tutorial to read the incoming messages using Broadcast receiver if you are going to use the second method.
"Reading incoming messages using broadcast receiver."
I believe you are trying to implement a way you can implement your own TTS (Text-To-Speech) Verification system that prompts the user to enter in the code.
If so, you can use Nexmo's Text To Speech Prompt.
All you have to do is make an HTTP call (For example: https://api.nexmo.com/tts-prompt/json)
From here you can use the parameters you want such as,
text - Body of the text message to be read to the end user
machine_detection - How to react when an answering machine is detected
lg - To determine what language the text is read in
bye_text - Body of the text message played after digits are entered successfully
failed_text - Body of the text message played after 3 failed attempts
There are many other parameters you can work with and customize your TTS prompt to capture/confirm data.
Full disclosure, I work at Nexmo
You can see more information how to implement this here
I need to put a deep link in my HTML for adding a contact to the Phone and then begin a new conversation in whatsapp.
I found this code
Send text to whatsapp
And this one:
Send text to user
I need to open a conversation with a specific contact even if I don't have the contact. My first question is, where can I get the username for whatsapp?
Having the abid I can try if it works but I dont know where to get that data.
Thanks a lot
Send Message
Without "+" or "00" at the beginning, just start country code and the number.
Example USA is +12025599025 then in the code given, replace NUMBER with 12025599025
this was worked for me:
whatsapp://send?text=MESSAGE&phone=+NUMERO&abid=+NUMERO
Obviusly "+NUMERO" is the wsp number and "MESSAGE" the preloaded message put in inhref` attribute
Recent solution (July 2017)
Malki's answer does solves the issue, but recently there's been published an official Whatsapp API I mentioned in THIS OTHER ANSWER (because S.O. policies I had to put a link to the solution, no duplicates).
This doesn't directly add the contact but allows you to open a copnversation with a concrete number, it can be very usefull to use it in your web sites. I've just found that it is possible to open a conversation to a number Using Click to Chat
To create your own link with a pre-filled message that will
automatically appear in the text field of a chat, use
https://wa.me/whatsappphonenumber/?text=urlencodedtext where
whatsappphonenumber is a full phone number in international format and
URL-encodedtext is the URL-encoded pre-filled message.
Example:https://wa.me/15551234567?text=I'm%20interested%20in%20your%20car%20for%20sale
NOTE: It opens WhastApp application if you click the link using a mobile phone browser (at least from Android)
The ABID (address book ID) is for an ID, not a name on your contact list.
In Whatsapp URL Scheme Documentation There are not (yet) documentation to send message to a specific contact.
The best way i found is to add the contact using this html code:
add number
(this will open Contacts app from your phone)
This is how you can create a link to send a WhatsApp message to a particular number.
Notice that you don't need to add the '+' symbol before the country -code. Just start with the country-code followed by the WhatsApp number:
Link Icon
I am trying to verify user by sending sms through twilio (Android Application).
Here is the Detailed summary-
(As in Snapchat)
During signup i want to validate user by sending dynamic run-time code to user mobile.
and after sending i have the verification field.
so what should i do ?
Twilio employee here.
This is a really common use case for Twilio and plenty of apps do the "phone number verification" thing you're looking for.
Let me boil down the steps on how to do this in human form, as this is much easier to explain than writing a bunch of code:
A user will type their phone number into a field to be verified.
When the user has typed in their number, you can compute a unique code (4 - 6 digits is all you need) however you like, and then use our REST API to send the number they entered the code.
At this point, you should save the unique code so you can reference it later.
Prompt the user to enter the code into a field within your app.
Compare the entered code to unique number you stored them and viola!
If the code is the same: you know that they own the phone number that you sent the message to. A very similar process is described in this 2-factor authentication how-to.
I hope that makes sense.
If you have any questions, please ask.
Disclaimer: I'm the maintainer of Django-phone-verify
While phait's answer is apt. People had asked in comments of the relevant apps with which they could accomplish user verification. Most of this is from my previous answer at https://stackoverflow.com/a/57461296/3535547 I'm just pasting an updated answer in this thread so that it is easier for users to find it.
What you're looking to accomplish is very easy with django-phone-verify app. It comes with Twilio and Nexmo already integrated and few endpoints which you can extend as per your use case.
This package aims at verifying if a phone number requested by a particular client belongs to them. It also takes care of ensuring that the same device provides the verification of passcode which initially requested a passcode to be sent, saving you a few hours of work.
This package also doesn't mess up with your current user model at all. You're free to use this package exactly for one thing: verifying phone numbers. Whether you do it for users, companies etc. depends on your use-case.
It follows Unix philosophy of Do one thing; do it well
Installation
pip install django-phone-verify
Configuration
Add app to INSTALLED_APPS:
# In settings.py:
INSTALLED_APPS = [
...
'phone_verify',
]
Add settings in your settings.py file:
# Settings for phone_verify
PHONE_VERIFICATION = {
'BACKEND': 'phone_verify.backends.twilio.TwilioBackend',
'TWILIO_SANDBOX_TOKEN':'123456',
'OPTIONS': {
'SID': 'fake',
'SECRET': 'fake',
'FROM': '+14755292729'
},
'TOKEN_LENGTH': 6,
'MESSAGE': 'Welcome to {app}! Please use security code {otp} to proceed.',
'APP_NAME': 'Phone Verify',
'OTP_EXPIRATION_TIME': 3600 # In seconds only
}
Migrate the database:
python manage.py migrate
You get two endpoints (Check API docs), one for registration of phone number and other to verify the passcode. You may override verify endpoint to also create a user as described in the usage docs: https://github.com/CuriousLearner/django-phone-verify/blob/master/docs/usage.rst