conv.askToDeepLink 不是函数
conv.askToDeepLink is not a function
即使在 V1 中,调用 askToDeepLink 的旧方法也不再适用于 DialogFlow。
app.askToDeepLink('Great! Looks like we can do that in the Android app.', 'tool for Android',
'sample://scheduleMeeting', 'com.sample', 'handle this for you');
有人知道在V2中调用askToDeepLink的方法吗?
如果您正尝试将您的 Android 应用程序之一与您的 Google 助理应用程序连接,您应该试试这个。
app.intent('ask_to_deep_link_detail', (conv) => {
const options = {
destination: 'Google',
url: 'example://gizmos',
package: 'com.example.gizmos',
reason: 'handle this for you',
};
conv.ask('Great! looks like maybe we can do that in the app.');
conv.ask(new DeepLink(options));
});
获取助手的结果
如果用户接受 link,与您的应用程序的对话将结束,您将不会收到进一步的请求。如果他们拒绝 link,您将收到另一个请求,其目的是 actions.intent.LINK
和一个状态参数:
app.intent('ask_to_deep_link_confirmation', (conv, params, response) => {
conv.ask('Okay maybe we can take care of that another time.');
});
希望对您有所帮助。
即使在 V1 中,调用 askToDeepLink 的旧方法也不再适用于 DialogFlow。
app.askToDeepLink('Great! Looks like we can do that in the Android app.', 'tool for Android',
'sample://scheduleMeeting', 'com.sample', 'handle this for you');
有人知道在V2中调用askToDeepLink的方法吗?
如果您正尝试将您的 Android 应用程序之一与您的 Google 助理应用程序连接,您应该试试这个。
app.intent('ask_to_deep_link_detail', (conv) => {
const options = {
destination: 'Google',
url: 'example://gizmos',
package: 'com.example.gizmos',
reason: 'handle this for you',
};
conv.ask('Great! looks like maybe we can do that in the app.');
conv.ask(new DeepLink(options));
});
获取助手的结果
如果用户接受 link,与您的应用程序的对话将结束,您将不会收到进一步的请求。如果他们拒绝 link,您将收到另一个请求,其目的是 actions.intent.LINK
和一个状态参数:
app.intent('ask_to_deep_link_confirmation', (conv, params, response) => {
conv.ask('Okay maybe we can take care of that another time.');
});
希望对您有所帮助。