ImmersiveResponse and Interactive Canvas - actions-on-google

I can hear a response. I just cannot see the new immersiveResponse, or basically the web app sample from Google. Which I copied to my own web server.
The following is the JSON response output from the PHP script that is sent to the smart display
{
"payload": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Hello, I am the AI voice test."
}
},
{
"ImmersiveResponse": {
"loadImmersiveUrl": "https://mywebsite.com/webapps/index.html",
"suppressMic": false,
"updatedState": { "spin": false }
}
}
]
}
}
}
}
I was hoping to see the spinning triangle on my smart display. If I go to a browser and use the loadImmersiveUrl link with the proper website instead of mywebsite.com, then I can see the web app run with a spinning triangle. BTW, the mywebsite.com part was only changed for this post.
I used a PHP script to make a quick proto type, and it works, except no web app.
Any help would be greatly appreciated.

You have a capitalization typo in your response JSON. Instead of "ImmersiveResponse" it should have a lowercase-i:
{
"immersiveResponse": {
"loadImmersiveUrl": "https://mywebsite.com/webapps/index.html",
"suppressMic": false,
"updatedState": { "spin": false }
}
}

Related

List Report custom action in extension not displayed

I have created a Custom Action to a List Report FE through an extension. The whole purpose is to export the data to a spreadsheet. While testing it from VS Code, all the added extensions do work. But after the app is deployed, none work.
FES is running SAPUI5 version 1.52.18 (S/4HANA 1709), in case you wonder.
Can't figure out if this is an error with the installation or in the extension I created.
Please find the code below:
Manifest:
"extensions": {
"sap.ui.viewExtensions": {
"sap.suite.ui.generic.template.ListReport.view.ListReport": {}
},
"sap.ui.controllerExtensions": {
"sap.suite.ui.generic.template.ListReport.view.ListReport": {
"controllerName": "com.sap.inventoryvariance.ext.controller.ListReportExt",
"sap.ui.generic.app": {
"ZGM_INV_VAR": {
"EntitySet": "ZGM_INV_VAR",
"Actions": {
"onExport": {
"id": "ExportBtn",
"text": "Export",
"press": "onExport",
"requiresSelection": false
}
Extension:
sap.ui.controller("com.sap.inventoryvariance.ext.controller.ListReportExt", {
onExport : function(oEvent) {
alert('ExportToExcel');
}
});
I even tried using the setting "useExportToExcel": true. While testing from VS Code, both work (but VS Code lowest SAPUI5 version is 1.65):
But from the deployed app, nothing happens:

Scale-to command beh for Pixellena image API

I’m using the Pixellena image API and have an issue using the scale-to command for scaling an image. The same issue occurs both when using the demo page and with the SDK.
It doesn't matter if I use different output widths, I get the same problem, see below
I am using the below adjustments
"shifter": {
"steps": [
{
"scale-to-width": 90
}
]
},
"encoder": {
"quality-measure": "fsim-c",
"qual-threshold": 0.9
}
}
Thanks for asking Daniel. It is Vladir from Pixellena. Definitely this error message does not help at all. We have opened an issue to improve it. We'are also updating the doc, but probably there are yet old references elsewhere. In any case you can see here, that now the "scale-to-width" changed to "scale-to": {"width": 90}, so if you give it a try using the adjustments as below:
{
"shifter": {
"steps": [
{
"scale-to": {
"width": 90
}
}
]
},
"encoder": {
"quality-measure": "fsim-c",
"qual-threshold": 0.9
}
}
it should work. If not please let me know and we will look deeper. Thanks a lot for asking. We appreciate your question, and that you're using our API.

Asking for Confirmation overriding previous responses in Google Actions

The Problem
I have a Google Actions SDK project and I am using the nodejs client library for building fulfillment. I am facing some problem trying to use the Confirmation Helper intent. It is overriding previous responses given before it. Let me give you a simplified example of the problem:
First, Action says, "Hi, hope you are having a great day"
Then, Action asks for a Confirmation, "Do you want today's weather report?"
But in the simulator, all I hear is the second question. I am targeting a Voice Only situation, so I really need all the responses. Interestingly, I can see all the responses in the AUDIO tab of simulator. How can I hear both of these phrases?
I am copy/pasting the response JSON as shown in the RESPONSE tab.
{
"expectUserResponse": true,
"expectedInputs": [
{
"possibleIntents": [
{
"intent": "actions.intent.CONFIRMATION",
"inputValueData": {
"#type": "type.googleapis.com/google.actions.v2.ConfirmationValueSpec",
"dialogSpec": {
"requestConfirmationText": "Do you want today's weather report?"
}
}
}
],
"inputPrompt": {
"richInitialPrompt": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Hope you are doing well!"
}
}
]
}
}
}
],
"conversationToken": ""
}
How can I fix this situation. Thanks!
This is intentional behavior as using one of the intents like Confirmation will be the only response, and other responses will be ignored.
There are two potential ways to get around this.
Combine all of your responses to be in the Confirmation
Create your own Yes/No intent and use simple responses for everything.

Sencha Cmd disable compressor

Does anyone know how to remove compression of javascript file in sencha cmd?
I want that my production app.js file what fully readable.
And I want to configure this in my app.json if possible.
I did this:
/**
* Settings specific to production builds.
*/
"production": {
"compressor": null, // compressor null
"output": {
"js": {
"optimize": false, // optimize false
},
"appCache": {
"enable": false,
"path": "../cache.appcache"
}
},
"loader": {
"cache": "${build.timestamp}"
},
"cache": {
"enable": false
}
}
But whereas the compressor option work, at the end my file is still "compressed" (not minified but still in one line).
I try the optimize method in the ideal situation, I would like all Sencha Cmd optimization to be perform except to shrink everything in one line...
If somebody know.
Thanks in advance!
thanks to #bnz, the proposed answer was not fully right but it helps me found the solution.
So, to disable the last compression of the app.js file during the build process, you have to go to your <appFolder>/.sencha/app/production.properties and this directive:
enable.resource.compression=false
I did not found yet how to set this in the app.json
No answer worked for me, but I found further possible solutions at Sencha Forum (that worked): https://www.sencha.com/forum/showthread.php?315722-How-to-ignore-compression-in-production-build
I leave it here for future people reaching this thread :)
[copied from the link]
Sencha Cmd v6.5.3.16:
app.json:
"production": {
"compressor": {
"type": "none"
}
}
To disable optimizations:
"output": {
"js": {
"optimize": false
}
}
Sencha Cmd 6.2.2.36 (change all the following):
app.json:
"production": {
"compressor": {
"type": "none"
}
}
.sencha/app/production.properties:
enable.resource.compression=false
Using app.json you can add
"debug" : {
"enable":false/true
}
to your production build object.
If you wanna disable this in general, until the next app upgrade,
you can have a look under
.sencha/app/production.defaults.properties
OR better to overwrite the settings
.sencha/app/production.properties
You need to set
build.options.debug=true
there.

How can I make a chrome packaged app which runs in fullscreen at startup?

Currently it seems that the fullscreen ability can only be activated from a user action (mouse/keyboard event). Is there a way to circumvent this?
Now, you can just add the state:"fullscreen" property on your main .js:
chrome.app.runtime.onLaunched.addListener(
function() {
chrome.app.window.create('index.html',
{
state: "fullscreen",
}
);
}
);
Make sure you don't add resizable: false or bounds properties, and you add a "fullscreen" permision on the manifest.json.
{
...
"permissions": [
...
"fullscreen"
]
}
You can use the HTML5 Fullscreen API, which requires a user action:
button.addEventListener('click', function() {
document.body.webkitRequestFullscreen();
});
or the more "app-y" way using the AppWindow object, which doesn't require a user action:
chrome.app.window.current().fullscreen();
Both need the "fullscreen" permission in the manifest.json.
I have got it working with below code
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('index.html', {
'width': 1024,
'height': 768
},
function(win) {
win.maximize();
});
});
Check out https://plus.google.com/100132233764003563318/posts/2SuD7MVd8mG referring to recently landed changelist https://chromiumcodereview.appspot.com/12205002. You can lift sample code from either of those sources:
document.body.addEventListener('click', function() {
document.body.webkitRequestFullscreen();
});
Make sure in your manifest you're requesting the "fullscreen" permission and that you're testing on a sufficiently recent Chrome build (beta channel ought to have this feature by now, and dev definitely does).
Your question specifically refers to packaged apps, but in case anyone reading this answer missed this, this will work only with Chrome packaged apps.
main.js
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('index.html',{},function(window) {
window.fullscreen();
});
});
manifest.json
{
...
"manifest_version": 2,
"minimum_chrome_version": "23",
"app": {
"background": {
"scripts": ["main.js"]
}
},
"permissions": ["fullscreen"]
}
Edit: Per BeardFist's comment, my original answer was wrong on two fronts. You can do this on a Chrome Extension (which this is tagged as), but probably not on a packaged app.
For extensions you can make it go fullscreen using the state:"fullscreen" option, which can be applied with chrome.window.update. The code below chains the creation of the window via chrome.windows.create with chrome.window.update. In my experiments you could not set the fullscreen state directly through the window creation.
chrome.windows.create(
{url:"PATH/TO/POPUP"},
function(newWindow) {
chrome.windows.update(newWindow.id, {state:"fullscreen"})
});