Specify voice in twilio actions json - twilio

In one of my situations I need to be able to specify the voice in the default initiation of the autopilot. I have a strange behavior. Despite the style sheet set to a particular voice, the default initiation is not using that voice. Instead it is using may be a default voice? I don't know. However when the next intent is detected the voice switches to the correct voice specified in the style sheet.
{
"actions": [
{
"say": "Hello , May I speak to Mr Peter ?"
},
{
"listen": true
}
]
}
My Style sheet
{
"style_sheet": {
"voice": {
"say_voice": "Polly.Raveena"
},
[...]
}
}

Related

Why Google Slides not Autofit text in placeholders?

I have a simple slide where the placeholders are all set in: Shrink text on overflow.
Despite this, the text is not reduced and through the Api I discover that the Autofit is not set.
In setting it, however, I get the following error: Autofit types other than NONE are not supported
Code of requests:
requests = [
{
"updateShapeProperties": {
"objectId": 'gda51db96da_1_5',
"shapeProperties": {
"autofit": {
"autofitType": 'TEXT_AUTOFIT'
}
},
"fields": "autofit.autofitType"
}
}
]
This is an open issue, and needs a fix from Google's end.
Ref: https://issuetracker.google.com/issues/191389037

Does firebase set apns-push-type header automatically?

According to changes in iOS 13 for APNS, silent push notifications require additional header (apns-push-type).
I use Firebase as a mediator between backend and mobile, and I'm wondering if Firebase sets mentioned header automatically when content-available property is set to true.
It is already happening in AWS, as mentioned here.
Can I check somehow in iOS if this header was passed to silent push notification?
I've tested on my devices and everything is working after I updated Firebase dependency to the newest version, even in background. But still I don't have any proof how the header looks like.
After digging around a little bit and checking how some open source projects updated their code, here's an example on how to add apns-push-type to Firebase Admin Node:
(I'm using multicast, so your solution might differ.)
const message = {
priority: 'high',
sound: 'default',
notification: {
title: 'Message Title',
body: 'Message Body',
},
android: { ... },
apns: {
headers: { // Add these 3 lines
'apns-push-type': 'alert',
},
payload: {
aps: {
badge: 1,
sound: 'default',
},
},
},
tokens: [ ... ],
};
admin.messaging().sendMulticast(message);
I only had a few notifications failing so I haven't been able to fully confirm that the problem is solved yet.
This is what i'm using to send background notificaions to the ios devices. Notice that im setting "contentAvailable" instead of "content-available", everything needs to be a string.
"apns": {
"headers": {
"apns-push-type": "background",
"apns-priority": "5"
},
"payload": {
"aps":{
"contentAvailable": true
}
}
}
i'm using sendMulticast() method,
full example looks something like this:
var message = {
"tokens": tokensArray,
"data": {
"info":"someInfo"
},
"apns": {
"headers": {
"apns-push-type": "background",
"apns-priority": "5"
},
"payload": {
"aps":{
"contentAvailable": true
}
}
}
};
await messaging.sendMulticast(message)
Firebase support responded on my request.
As of today, Firebase does not automatically set the apns-push-type header if content_available is set. One should set it via the header in ApnsConfig.
They also recommend to update to the lastest admin SDK version.
I additionally set the apns-priorityheader. Unfortunately all steps didn't solve my problem.

Style the default "No video source" / "No video permissions" black rectangle

When the user is prompted for a permission on Safari, the video element is shown as a black rectangle with a strikethrough play button. How do I change this element's styling? Does it have a specific ID / class / tag?
I'm using Quagga JS as a barcode scanner. AFAIK Quagga creates a video element, then asks for camera permission. The optimal result would be to hide the element using display:none;, but I can't think of any way to accomplish this. I need the element to display the camera feed once the scanner has its permission, but before that it should either paint the screen black or be hidden.
I've fixed it by hiding it via JavaScript and showing it once the Quagga Feedback has finished. Note that a pure CSS solution would be much prettier.
// Hide the preview before it's fully initialised.
$('#videoBoundingBox').hide();
Quagga.init({
inputStream: {
name: "Live",
type: "LiveStream",
target: document.querySelector('#videoBoundingBox')
},
decoder: {
readers: [
"code_128_reader",
"ean_reader"
]
}
}, function (err) {
if (err) {
console.log(err);
setResult(err);
err = err.toString();
if (err.search("NotFoundError")) {
// No camera found. The user is probably in an office environment.
// Redirect to previous orders or show a background image of sorts.
} else if (err.search("NotAllowedError")) {
// The user has blocked the permission request.
// We should ask them again just to be sure or redirect them.
} else {
// Some other error.
}
return;
}
// Hide the preview before it's fully initialised.
$('#videoBoundingBox').show();
setResult("Initialization finished. Ready to start");
console.log("Initialization finished. Ready to start");
Quagga.start();
initializeQuaggaFeedback();
});

iPad iOS Safari getUserMedia acces specific camera ( front or back )

What is the right way to access the the front or back camera.
Currently I'm only able to access the "user" camera ( front ).
I can't switch to back camera using any constraints.
Using a specific device id is also not working:
var constraints = {
video: {
facingMode: "environment",
deviceId: "E858F78F6026428D45DD669617B4A881409AA4DA"
}
};
navigator.mediaDevices.getUserMedia(constraints).
Cany somebody please help me?
It is always accessing the front camera.
Following your question I think you already have successfully called getUserMedia() to get the user's permission to access the camera (otherwise you won't have get the front camera to work). This is needed because the label values in the following JSON will only be filled when the user has already granted access.
On iOS you now have to call navigator.mediaDevices.enumerateDevices() and will get a "response JSON" like that:
[
{
"deviceId":"<firstID>",
"kind":"audioinput",
"label":"iPhone Microphone",
"groupId":""
},
{
"deviceId":"<secondID>",
"kind":"videoinput",
"label":"Back Camera",
"groupId":""
},
{
"deviceId":"<thirdID>",
"kind":"videoinput",
"label":"Front Camera",
"groupId":""
}
]
using the deviceId of the device you want or let the user choose it using a basic UI will give you access to the back camera.
Caution: The deviceId values will change on each invocation of enumerateDevices()!
You can also pass this in as an argument when you are calling getUserMedia.
video: {
facingMode: {
exact: 'environment'
}
}
This will return the back camera's video:
navigator.mediaDevices.getUserMedia({
video: {
facingMode: {
exact: 'environment'
}
}
})

Apple watch real response data

Can you print and show me the output of this with real device I need to know the format of it.
- (void)didReceiveRemoteNotification:(NSDictionary *)remoteNotification withCompletion:(void (^)(WKUserNotificationInterfaceType))completionHandler
{
// This method is called when a remote notification needs to be presented.
// Implement it if you use a dynamic notification interface.
// Populate your dynamic notification interface as quickly as possible.
// After populating your dynamic notification interface call the completion block.
NSLog(#"%#",remoteNotification);
completionHandler(WKUserNotificationInterfaceTypeCustom);
}
This is the Payload response for the question
{
"aps": {
"alert": {
"body": "Test message",
"title": "Optional title"
},
"category": "myCategory"
},
"WatchKit Simulator Actions": [
{
"title": "First Button",
"identifier": "firstButtonAction"
}
],
"customKey": "Use this file to define a testing payload for your notifications. The aps dictionary specifies the category, alert text and title. The WatchKit Simulator Actions array can provide info for one or more action buttons in addition to the standard Dismiss button. Any other top level keys are custom payload. If you have multiple such JSON files in your project, you'll be able to select them when choosing to debug the notification interface of your Watch App."
}

Resources