Is there a way to push a link for more information to the users device if they asked a question to your Action through a voice only google home device?
You seem to be looking for multi-surface conversations, where the Action can transfer seamlessly from a Google Home to a phone.
Then you create a New Surface intent and you'll get a notification on your phone to show the content.
if (conv.screen) {
conv.ask(`You're already on a screen device.`);
conv.ask('What else would you like to try?');
} else if (screenAvailable) {
const context =
`Let's move you to a screen device for cards and other visual responses`;
const notification = 'Try your Action here!';
const capabilities = ['actions.capability.SCREEN_OUTPUT'];
conv.ask(new NewSurface({context, notification, capabilities}));
} else {
conv.ask('It looks like there is no screen device ' +
'associated with this user.');
conv.ask('What else would you like to try?');
};
Related
I'm using Google Play Games service in my unity game and want to silently login my game so that the dialogue popup at the top shows only once.
Right now everytime I open the game that dialogue comes up. like this
And it takes around 5s for the dialog thing to complete that's why I want to do it silently so that user can directly enter to game if they have just signed in.
I've seen in some games that when we opens the game for the very first time only then that dialogue comes and on next further opening the dialogue doesn't comes and we directly enter to the game.
My code is
void Start()
{
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
.AddOauthScope("profile")
.RequestServerAuthCode(false)
.Build();
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
if (!PlayGamesPlatform.Instance.localUser.authenticated)
{
Debug.Log("We're not authenticated in, let's authenticate first");
PlayGamesPlatform.Instance.Authenticate(SignInInteractivity.CanPromptOnce,
(code) =>
{
if (code == SignInStatus.Success)
{
Debug.Log("We're not signed in, let's signin first");
/// Signed in! Hooray!
PlayFabClientAPI.LoginWithGoogleAccount(new LoginWithGoogleAccountRequest()
{
ServerAuthCode = PlayGamesPlatform.Instance.GetServerAuthCode(),
CreateAccount = true,
}, OnGoogleLoginSuccess, error =>
{
Debug.Log("Error " + code);
// TODO: Move to splash scene with practice mode only
});
}
else
{
/// Error signing in. We'll want to show a sign in button
}
}); /// <--- That "true" is very important!
}
else
{
Debug.Log("We're already signed in");
}
}
so the main issue is that PlayGamesPlatform.Instance.localUser.authenticated
always returns false.
Thanks!
Recently I publish my mobile application but there is a unique problem. In some devices people download application in google play and easily use the application. But some devices has need to clear all application data from settings then open again because if they don't do this they can't see onboarding screen and also can't fetch data from internet. In flutter I basically use Hive local storage at main dart to route after installation
//Here if onBoard box is true user will see welcomescreen
if (Hive.box('settings').get('onBoard') == true) {
screen = const WelcomeScreen();
}
//Here if user already registered but click sign out button isRegistered box will be false and user
//will go LoginPage again
else if(Hive.box('settings').get('isRegistered') == false){
screen = const LoginPageDesign();
}
//! If on boarding not true (false or null) user will route OnBoarding page
else {
screen = const OnBoarding();
}
The problem is some android devices backsup local storage data to the cloud. You can go through this article from android: https://developer.android.com/guide/topics/data/autobackup.html
So, to overcome this issue, just navigate to your AndroidManifest and do the following just under application tag:
<application
...
android:allowBackup="false"
android:fullBackupContent="false"
tools:replace="android:allowBackup"
...
</application>
switch(Hive.box('settings').get('isRegistered')){
case null:
screen = const OnBoarding();
break;
case false:
screen = const LoginPageDesign();
break;
case true:
screen = const WelcomeScreen();
break;
}
Interestingly once I tested with internal test,
Android 13 real devices has no problem it goes first onBoaring but with Android 10 it goes directly WelcomeScreen I don't understand how it is possible to take true for this situation should always null at fresh start.
EDIT : Problem is interestingly fixed once add another Hive.box for registeration ...
How to implement this example :
let device = this.googleAction().getRequest().getDevice();
console.log(device);
this.tell('Thanks for your precise location');
https://raw.githubusercontent.com/jovotech/jovo-framework-nodejs/master/examples/google_action_specific/appAskForPermission.js
Did you ask for 'precise location' first as shown in the example you linked?
this.googleAction().askForPreciseLocation('Precise Location pre text');
If a user gives you the permission, it then jumps into the 'ON_PERMISSION' handler, where you can access the information as explained:
if (requestUser.permissions.indexOf('DEVICE_PRECISE_LOCATION') > -1) {
let device = this.googleAction().getRequest().getDevice();
console.log(device);
this.tell('Thanks for your precise location');
}
You can find more information in the Jovo Docs: Google Assistant > Data > ON_PERMISSION.
I tried open my app if installed in iPhone from safari browser simply passing like myApp:// using javascript document.location="myApp://"; if not redirect to another webpage to display app details. but when app not installed safari throw "Cannot open Page" alert ,if redirect to another webpage that time also safari alert box not dismiss automatically.
Any one help me to how redirect the webpage without safari cannot open page alert if app not installed on device.
My Code :
Simply html file and body onload="checkdevice();return false;"
display message in textarea "document.getElementById('txtMsg').value"
function checkdevice() Check browser detection
{
if((navigator.userAgent.match(/iPhone/)) || (navigator.userAgent.match(/iPad/)) || (navigator.userAgent.match(/iPod/)))
{
document.getElementById('txtMsg').value ="Running on iPhone /iPod /iPad Device";
checkAppExists();
return true;
}
else
{
document.getElementById('txtMsg').value ="Please run this page on iPhone / iPod / iPad Device";
checkAppExists();
return false;
}
}
function checkAppExists()
{
var time = (new Date()).getTime();
window.location="myApp://";
setTimeout(function(){
var now = (new Date()).getTime();
if((now-time)< 400)
{
window.location="http://mydomin.com/appdetails.html";
}
else
{
document.getElementById('txtMsg').value ="App Installed"; * App will launch here *
}
},300);
}
I am writing an application for Android with Adobe AIR + using facebook action script 3 SDK.
Can I show standart apprequest dialog to user on Android phone?
FB.ui({method: 'apprequests', message: 'You should learn more about this awesome game.', data: 'tracking information for the user'});
How can I call it from facebook action script 3 SDK? Thanx!
take a look of this script, that answer you question
How can I call it from facebook action script 3 SDK?
private function inviteFriends():void
{
var dat:Object = new Object();
dat.message = "Let's invite friends for our Super Extra Max Facebook App, more info go to http://blog.ukasz.com";
dat.title = 'Super Extra Max Facebook App';
// filtering for non app users only
dat.filters = ['app_non_users'];
//You can use these two options for diasplaying friends invitation window 'iframe' 'popup'
Facebook.ui('apprequests', dat, onUICallback, 'popup');
}
and this is the handler
private function onUICallback(result:Object):void{
if(result == null){
trace('User closed the pop up window without inviting any friends');
return
}
var invitedUsers:Array = new Array();
invitedUsers = result.request_ids as Array;
trace('You Have Invited ', invitedUsers.length,' friends');
//Simple if else if you want user to invite certain amount of friends
if(invitedUsers.length > 1){
trace('GREAT, USER IS GENERATING TRAFFIC');
}else{
trace('No Good, User invited only one friend.');
}
}
Thanks to Lucas