Context handler does not work on iPhone app. Crashes!

Context handler does not work on iPhone app. Crashes!

I've used the sample code from your help pages regarding the context handler and it consistently crashed the app.

It consistently crashes upon the second context input

code sample on the Context Handler page causes the iPhone app to crash.

I'm using iOS 11.2

When I iterate through the Room Service context it crashes after I choose "House Keeping" or "Maintenance"

https://www.zoho.com/cliq/help/platform/bot-contexthandler.html

==

Sample Message Handler Code
response = Map();
if(message.containsIgnoreCase("ROOM SERVICE"))
{
context = '{"id":"Room Service","timeout":"300","params":[{"name":"room service","question":"Great! Here is a list of options for you to choose from.","suggestions": {"list":[{"text":"House Keeping"},{"text":"Maintenance"}]}},{"name":"time","question":"Okay cool. When can I send them over?","suggestions":{"list":[{"text":"Now"},{"text":"In half hour"}]}}]}'.toMap();
response.put("context",context);
}
else if(message.containsIgnoreCase("WIFI"))
{
context = '{"id": "Wifi", "timeout":"300","params":[{"name":"Wi-fi","question":"Confirm if you are in Room 307!", "suggestions":{"list":[{"text":"Yes"},{"text":"No"}]}}]}'.toMap();
response.put("context",context);
}
else if(message.containsIgnoreCase("CAB"))
{
context = '{"id": "Cab","timeout":"300","params":[{"name":"Cab","question": "When can I book the cab for you?","suggestions":{"list":[{"text":"Now"},{ "text": "After 1 hour"}]}}]}'.toMap();
response.put("context",context);
}
else
{
response = '{"text": "Hi! I am Lyte, the Room Service Bot. Heres what I can help you with! :happy!:", "suggestions":{"list":[{"text":"Room Service"},{"text":"Wifi"},{"text":"Cab"}]}}'.toMap();
}
return response;

Sample Context Handler Code
response = Map();
id = context.get("id");
params = context.get("params");
if(id.matches("Room Service"))
{
confirm = "Please check our other options then!";
if(params.get("confirmation").containsIgnoreCase("YES"))
{
// make api calls for the room service options
confirm = "Great! I've arranged for the " + params.get("room service").get("text") + "to be there " + params.get("time").get("text") + ". :thumbsup:";
}
response.put("text",confirm);
}
else if(id.matches("Wifi"))
{
txt = 'Please try again or call 0000 for more information!';
if(params.get("Wi-fi").containsIgnoreCase("YES"))
{
txt = 'Here is your wifi ID and password. \n ID - Room_307 \n Password - Hotel123';
}
response.put("text",txt);
}
else if(id.matches("Cab"))
{
txt = 'Your cab has been booked exactly one hour from now. Please meet the driver at the hotel lobby.';
if(params.get("Cab").containsIgnoreCase("NOW"))
{
txt = 'You Cab has been booked. Please meet the driver at the hotel lobby. :thumbsup:';
}
response.put("text",txt);
}
else
{
response.put("text","Context: " + context);
}
return response;
    • Sticky Posts

    • Customer payment alerts in Zoho Cliq

      For businesses that depend on cash flow, payment updates are essential for operational decision-making and go beyond simple accounting entries. The sales team needs to be notified when invoices are cleared so that upcoming orders can be released. In contrast,
    • Automating Employee Birthday Notifications in Zoho Cliq

      Have you ever missed a birthday and felt like the office Grinch? Fear not, the Cliq Developer Platform has got your back! With Zoho Cliq's Schedulers, you can be the office party-cipant who never forgets a single cake, balloon, or awkward rendition of
    • Accelerate Github code reviews with Zoho Cliq Platform's link handlers

      Code reviews are critical, and they can get buried in conversations or lost when using multiple tools. With the Cliq Platform's link handlers, let's transform shared Github pull request links into interactive, real-time code reviews on channels. Share
    • App Spotlight : PagerDuty for Zoho Cliq

      App Spotlight brings you hand-picked apps to enhance the power of your Zoho apps and tools. Visit the Zoho Marketplace to explore all of our apps, integrations, and extensions. In today's fast-paced world, seizing every moment is essential for operational
    • Automate your status with Cliq Schedulers

      Imagine enjoying your favorite homemade meal during a peaceful lunch break, when suddenly there's a PING! A notification pops up and ruins your moment of zen. Even worse, you might be in a vital product development sprint, only to be derailed by a "quick