For Android devices I am using dryRun attribute to control message is delivered to device or not, generally I have used this parameter to check the pntoken is invalid or not without sending a sample message to device.
I am searching for same attributes or a way to check whether token is valid, expired or invalid for IOS devices.
There is no Dry run option for iOS but you might want to go with message without any alert.
{
"aps": {
"category": "categoryName"
}
}
With above payload call will go through but nothing should show up on the device.
Based on this documentation, to run a quick test of your push notification setup for Apple Push Notification Service (APNS), use the Send Test Notification page.
Here are the steps that you need to do.
Enter a connection token string in the Recipient field, OR search for a recipient by clicking Search, and then select one of the search results. By default, the Search results list displays the five devices most recently registered for your connected app.
a. To find other devices, enter a user name in the Search text box.
b. Click Go to generate a list of all devices currently registered under that user name.
Optionally, for Alert, enter an alert message or dictionary per Apple’s specifications.
For Badge, enter a badge number or 0 for no badge.
For Sound, enter the name of a sound file in the application bundle, or enter default to use the system default alert sound.
Optionally, to use a custom payload, enter your payload’s JSON value in the Custom Payload field.
Click Send to send the test push notification, or click Clear to reset the form.
For more information, check this SO question and this thread if it can help you.
Related
I would like to know which are my posibilities as a developer to implements a send message voice action, in a messaging app (like a custom Telegram app), for spanish users. I want to implement the send new message action, I does not interested in replying to received messages (this is already implemented).
This is an example of I want to implements:
Create Message action
The user tells an utterance like "I would like to send a message with whatsapp".
A widget asks for a contact to send the message (if the user did not especificated one).
The app sends the message.
This is the same working example for spanish language: Create Message action (spanish)
I already know that there are built-in intents but the CREATE_MESSAGE built-in intent is only available for en-us locale. I also checked the custom intents but there are also only availables for en-us locale as I know. Which more options do I have?
PD: My final goal is to make the app compatible for Android Auto so I'm making it compatible with google assistant first.
Thanks in advance.
As you note, the actions.intent.CREATE_MESSAGE BII is only available in en-US right now. This is probably the best one, since it provides getting and sending a message without any additional work.
You may want to see if actions.intent.OPEN_APP_FEATURE will work for your needs. It has the downside that it does not have the fields available in CREATE_MESSAGE, but it might be a useful way to open the app.
However...
If you're planning on targeting Android Auto, that platform is even more restricted. If you're building an Android Auto app, you are limited to use only the actions.intent.GET_PARKING_FACILITY or actions.intent.GET_CHARGING_STATIONS BIIs. If you are willing to have it return a widget, you get a little more flexibility in what BIIs it accepts, but these don't let you send a message or open the app (even in en-US).
I want to send mail on click of a button without opening mail application using IONIC only. Is this possible in IOS and ANDROID? I have used email composer but it opens mail application.
So the logic here is that it would be actually pretty bad (for users) if mobile apps / web-apps would gain ability to send emails without user's explicit action to do so. Think of spam bot networks that would emerge etc.
You have 2 options:
create your own server side logic (API) that clients call to and
perform email action via an "email as a service".
help user to open email client with "pre-filled" email details
For #1 you can use sendgrid.com and similar services, so that your own service could call sendgrid and dispatch emails/
For #2 there are simple web techniques (not ideal though) like so:
submitIdea() {
let formattedBody = `Hi, here is my idea...: \n \n \n`;
window.location.href = `mailto:ideas#yourdomain.com?subject=Idea for web app from ${this.foundation.userData.user.nickname}&body=`+encodeURIComponent(formattedBody);
this.foundation.analytics.track("idea", "user clicked submit button");
};
This will open app default email client and will help user to type less of text or supply certain app details automatically.
I used this to help with user support / feedback type of emails, where app version etc context can be auto populated.
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 having a problem with the lite version of messenger (android only)
This version of the application does not support bot messages with templates or buttons (including the get_started button)
In my case this is an example:
I could not find a parameter in the webhooks to provide the user's platform.
So I have to ask the user: do you use the lite version?
And then set a different flow.
But this means that I must also give the possibility to disable the lite mode when browsing from the web or from the non-lite application (to guarantee a better user experience)
Does Facebook Messenger Bot provide information about the channel where the message was originated ?
This information is not provided via webhook, currently. The closest you can get is detecting user agent in the webview.
A not ideal but doable option would be to have something like a 'Switch to Lite' button in the persistent menu
One way to identify where message event originates from is to use the payloads. You can specify a unique payload when setting up your bot and check what you receive to react on. get_started, persistent_menu, quick_replies have a payload field that you can set.
{
"get_started":{
"payload":"<GET_STARTED_PAYLOAD>"
}
}
We've had to code an OTP based authentication. I have seen some apps, like my bank's app, which when it sends the OTP also then immediately does a quick popup of the SMS that has just arrived, so I can see the OTP without leaving the app. I just memorize the number, close the popup, and get on with the login inside that app.
How do they do that? Is there some iOS/Android spec I should be looking at, which allows us to similarly popup the OTP without the user having to go to the SMS screen, then come back to our app? Thanks!
EDIT: I have very useful Android suggestions. Now looking for iOS variations of these recommendations. Understand iOS has much more stringent sandboxing limitations, so the "listener" may be more complex?
For android you need to use SMSListener as pointed out by #rushabh.
You can check at a great example here
Some Tips to achieve your mention task for your App.
Step - 1 create a Login Activity with necessary field like username , password and otp and Login Button.
Step - 2 When user fill the username and password make a web service call. with input params (username and password)
authenticate the values if true means send your OTP number as response else response error message.
Step -3 if response is number means create AlertBuilder for Pop window to show your OTP number in same Activity.
Step - 4 user saw the OTP in Login Activity itself and enters the OTP in opt area i.e (EditText).
Step - 5 When user tap the login Button authenticate the OTP value. and proceed to next Activity.