Something seems to have broken when it comes to playing MP3 files and live streams using MediaResponse on Google Home.
Without releasing any new version or changing stream URLs, playback simply no longer work in our app (on a Google Home Mini - still works in Simulator though), and I notice the same problem in other similar apps. Playing radio from TuneIn still works.
Anyone else with this problem?
We had a similar issue with our Google Assistant application when providing a mp3 livestream using MediaResponse.
We previously ended the conversation like this
conv.close(new MediaObject({
name: "Name",
url: "https://url.to.livestream",
description: "Description",
image: new Image({
url: "https://url.to.image"
})
}));
What worked for us was to instead send the MediaObject using conv.ask()
conv.ask(new MediaObject({
...
}));
conv.ask(new Suggestions(["suggestion 1", "suggestion 2"]));
What is important here is to follow the MediaResponse with a Suggestions response since the app will fail otherwise.
"Your Action must include suggestion chips if the response is not a
final response." https://developers.google.com/actions/assistant/responses#media_responses
Maybe this will solve your issue as well?
Related
I've been developing an app with firebase and stripe payment. I've created a checkout session in stripe and added firebase dynamic links for the success_url and cancel_url. The URLs are working fine. I've tested them outside stripe with a simple html file and it opens the app and takes the user to the correct page. If the page doesn't exist it'll take the user to the assigned website. This is stripe checkout session code:
const session = await stripe.checkout.sessions.create({
line_items: [{
price_data: { currency: 'INR', unit_amount: amount, product_data: { name: 'name' } },
quantity: 1,
}],
mode: 'payment',
success_url: 'https://-------.page.link/payment-success',
cancel_url: 'https://-------.page.link/payment-failed',
payment_intent_data: {
application_fee_amount: fee
},
}, {
stripeAccount: req.query.stripeId,
});
I've changed up the actual link since I don't know how much I'm allowed to share. But I can guarantee the dynamic links works fine. But after payment, the test payment at least, it's suppose to open the app and take the user to a payment success page. AND it was working fine for the first 2 or 3 days. After payment it re-opened the app and took the user to the correct page. But when I tried a few days later, this is what it's taking us to:
Again, I've removed the link since I don't know how much I'm allowed to share. It won't even open the app right now. It just shows this message in the browser. Both success and cancel url are doing the same. Why does the links work outside the function but not in it? Has anyone ever faced any similar issues before? Any help will be greatly appreciated.
It seems like you're trying to open the Checkout Session in a WebView which causing the issue in the redirect. Webviews don't know how to handle an URL Scheme other than http:// or https://. That being said, your problem isn't uncommon and there are multiple ways of solving this.
Your first approach would be to open the Checkout Session in an external browser as described in this answer or try to create your own WebViewClient and override shouldOverrideUrlLoading method like described in this answer. Just note that since the last edit of that answer the signature of the shouldOverrideUrlLoading method has changed but the logic should still be used the same way but instead of dealing with the String url, you will have to deal with a WebResourceRequest.
Had the same issue. I solved it by changing the mode like following:
await launchUrl(
url,
mode: LaunchMode.externalApplication, // Add this line
)
url_launcher version => 6.1.7
I'm following this guide, I'm having this code:
var acs = ActionCodeSettings(
url: 'https://example.com/auth/widget',
androidPackageName: 'com.example',
iOSBundleId: 'com.example',
handleCodeInApp: true,
androidInstallApp: true,
androidMinimumVersion: '12',
);
var emailAuth = 'john.doe#pm.me';
FirebaseAuth.instance
.sendSignInLinkToEmail(
email: emailAuth, actionCodeSettings: acs)
.catchError((onError, stackTrace) {})
.then((value) =>
print('Successfully sent email verification'));
Sending the email works, but when I click on the email, then…
in iOS it opens https://example.com/auth/widget - which is the fallback
in Android it shows a circular loader for about 1s and then it "falls down" and nothing happens
The incoming link handler
FirebaseDynamicLinks.instance.onLink.listen((dynamicLinkData) {
print('got dynamic link! $dynamicLinkData');
}).onError((error) {
print('error error!');
});
I configured dynamic links in Firebase to point to to.example.com. I also added a manual dynamic link to.example.com/test which opens my app (the got dynamic link! message shows up) - so all seems fine, the problem seems to lie in the link generation.
The link structure I get by email is:
https://to.example.com/?link=https://example-abcd.firebaseapp.com/__/auth/action?apiKey…%26continueUrl%3Dhttps://example.com/auth/widget%26lang%3Den&apn=com.example&amv=12&ibi=com.example&ifl=https://example-abcd.firebaseapp.com/__/auth/action?apiKey%3D…%26continueUrl%3Dhttps://example.com/auth/widget%26lang%3Den
After some more painful hours of debugging and reading documentation I finally found it out. Most of this is in the flutter documentation, but since the documentation has broken links and is a bit all over the place it was hard for me to catch it all!
Android
I needed to decrease the androidMinimumVersion from 12 to 1. Then my app opens and I can receive the dynamic link. No idea why. My android simulator is android version 13 but the app never opened.
Before decreasing the android version I also set the sha256 setting in firebase, using gradlew signingReport documented in this answer. Not sure though this was required.
iOS
I forgot to do all the steps documented in receiving links on iOS section, namely:
add the dynamic links domain into associated domains
add FirebaseDynamicLinksCustomDomains into Info.plist
Overall, I found that to get this feature working was really really hard for me as a Flutter beginner. But I guess a lot of the setup I can re-use as the dynamic links capability seems to be something which comes in handy in the future.
I am trying to add a prompt link to my Google Action:
https://developers.google.com/assistant/conversational/reference/rest/v1/TopLevel/fulfill#link
My response looks like this:
payload.prompt.link = {
name: 'Open My Website',
open: {
url: 'https://mywebsite.com'
}
}
When testing on my Nest Hub, the link does show as a suggestion on the bottom of the page. However, when I click on it, it simply sends it as an utterance to my Action instead of open the web page.
Any idea why this is happening? And what is the expected behavior for prompt links? I cannot find much documentation on them.
This appears to be the Actions Builder implementation of Link-Out Suggestions, which were not originally available when the Actions Builder was released. They were, however, available for Dialogflow previously.
Link-Out Suggestions require the "WEB_LINK" device capability to work. Smart Displays do not have this device capability.
I'm writing a React App and I'm using Web Speech API for both speaking and voice recognition. I've written some code that works on desktop Chrome.
The way I ask for permission from the user is the following:
navigator.mediaDevices
.getUserMedia({ audio: true })
.then(function (stream) {
console.log('Succeeded');
/*Handle success*/
})
.catch(function (err) {
console.log('Failed: ', err)
/*Handle failure*/
});
However, this same code always goes to the catch callback when used from my Android phone, with the following written to the console:
Failed: DOMException: Could not start audio source
The site asks me if I want to allow microphone usage and when I go into the site settings, it says microphone and sound are both allowed, which makes me believe I've done the user interaction part well.
The site is served over HTTPS (already solved that issue), so I believe this is not an issue as well.
I'm using Xiaomi Mi 9 with Chrome Chrome 86.0.4240.185 in this test.
My first instinct is that I'm doing something wrong here? If this is the case, what?
Otherwise, what can I do to fix this issue?
Check if your Android app has required permissions:
android.permission.RECORD_AUDIO
android.permission.MODIFY_AUDIO_SETTINGS (might be optional)
You can check html or ejs file ;
you have to use in the body tags
Such as:
body
</div>
<script src="script.js"></script>
/body
My app is based on this code sample from Google: https://actions-on-google.github.io/actions-on-google-nodejs/classes/conversation_question.deeplink.html
Here is a snippet directly from my code:
app.intent('Default Welcome Intent', conv => {
conv.ask('Great! Looks like we can do that in the app.')
conv.ask(new DeepLink({
destination: 'MyBookApp',
url: 'https://www.mybooksite.com/read/123456789',
package: 'com.mybook.app.reader',
reason: 'handle this for you',
}))
})
// Create a Dialogflow intent with the `actions_intent_LINK` event
app.intent('Get Link Status', (conv, input, arg, status) => {
// possibly do something with status
conv.close('Okay maybe we can take care of that another time.')
})
When I run this app I see "Okay maybe we can take care of that another time." instead of my app being launched.
Is there code missing in my handler for the 'Get Link Status' intent? (I created the intent according to the comment above that line).
Am I passing the wrong params to the DeepLink object? I can't find docs for them anywhere.
Note: My app is definitely coded to handle http deep links including verification with Google Digital Asset Links and the deep link URL I'm testing with works perfectly from other apps.
Any suggestions or help is much appreciated!
Thanks in advance...
Your welcome intent handler is missing an additional call to conv.ask before the deep link call:
conv.ask('Great! Looks like we can do that in the app.')
All responses should have at least a simple response.