Closed Nazar-Pa closed 4 years ago
@Nazar-Pa make sure you are sending the correct payload
{"template": "button", "buttonItems":[{"uiText":"Action 1", "actionText":"action 1 selected", "isPositive": true},{"uiText":"Action 2", "actionText":"action 2 selected", "isPositive": false}], "align": "h", "size":"l", "eventToCall":"android_event" };
Even spelling mistake can cause a null pointer exception at the moment. In the above JSON, make sure all the keys are present with correct spelling and case.
@Nazar-Pa see if you are sending buttonItems or not. If yes, check spelling.
I got your SampleDialogflowWebhook and using exactly same code without changing anything.
I also created an "Capture Android Event" and added an "android_event" event to that intent.
I can only get response when I switch it to "const params = { "template": "text" }", so with text there is no error.
As I said it works flawlessly when I am showing a simple text.
However I also noticed that in your screenshot you get response as "This is a message section for showing text" with simple text template. I do not know if I am doing something wrong. Because I get response as "Event captured successfully!" (below)
@Nazar-Pa do you see buttons on UI? How are you sending event if they are not?
@Nazar-Pa please uncomment the line const param_context = {name: "param_context", lifespan: 10, parameters: params}; Without this, you cannot set parameters to context!
It should work.
It never worked with Heroku. I ran it using Ngrok then it worked only once (with hyperlink) but failed again when I checked it few times more. I did not understand how this might happen if it worked once. Thank you very much anyway. I can send you my ngrok link if you still keep the app working somewhere, to check if it works with you. If not never mind, I will try to find the issue.
@Nazar-Pa the screenshot you shared, I see you have one line of code commented. Uncomment it as I said earlier.
Yes I did it. Still the same error and no answer. But as I said it worked just one time
On Fri, Jul 17, 2020, 05:38 Abhinav Tyagi notifications@github.com wrote:
@Nazar-Pa https://github.com/Nazar-Pa the screenshot you shared, I see you have one line of code commented. Uncomment it as I said earlier.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/abhi007tyagi/Android_Dialogflow_Chatbot_Library/issues/3#issuecomment-659822742, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANFXD7CQQOO6VE26OVY4HC3R37BR3ANCNFSM4O5JNHMQ .
@Nazar-Pa did you restarted your service after the code change? Or stop NGROK and try again? If you still get error, share the NGROK URL
@Nazar-Pa use this NGROK URL in your fulfillment https://acdaa9ac76c9.ngrok.io/webhook
Its on my machine and working fine. I will keep it active for 30min
@Nazar-Pa use Intent named as "Android Intent" and another with event as "Capture Android Event" as these are mapped to my service. Or let me know your intent names.
1.Here are my Intents:
I trained by Android Intent in a way as you see above, so when I type "capture android event", the "Android Intent" intent must be detected.
2.And I tried your URL but still same error:
Here I share my Ngrok url: https://30107d7eda6c.ngrok.io/webhook
Yes I restart the service everytime the code changes
@Nazar-Pa I am testing. For events, you don't need any training phrase, as it will interfere with event.
@Nazar-Pa I am not seeing any error at my end! Try to create your project from scratch and try again. I will look into it tomorrow. I will try and share a new update over the weekend.
@Nazar-Pa test android button action is used in Android Intent not in Capture Android Event. Do not add any training phrase to Intents that have event added to it.
I also used those phrases in "Android Intent" intent (as I showed above). I downloaded and built the project again but the error is still there.(
hey bro, I could find the issue. It was because I already had 2 output contexts I added to my Welcome Intent. Thank you very much again.
Great!
Hey, sorry for disturbing again. The app stops working when I try show messages with Buttons. I attach the screenshot from Logcat, There occurs error, and I could not find the solution. Do you perhaps have any idea what can be the issue?