Hello,
I am currently building a simple translator app and I'm trying to integrate the Google Translate API (v3). However, i keep encountering the following runtime error:
"Runtime Error: unable to invoke method 'toYailDictionary' in object od type string"
Steps i've taken:
i set up the web component and configured the URL
added authorization in the headers using Bearer Token
i structured the body of the POST request with a dictionary
Issue: Even though i pass a dictionary as the body, the app on my Iphone shows the above runtime error.
What is my mistake? Are there any specific limitations wth the Web Component that i should be aware of?
Ok. So I've looked at the code and I think I understand the code path that is failing. It looks like this bug would happen in both the Android and iOS versions. The problem is that the get value at key path block expects either a dictionary or a list of key-value pairs. Since you're passing in the responseContent directly without first parsing it into a dictionary, this fails. toYailDictionary is being called without first checking that the value has that method (not all items would/could) so it blows up there. As @ABG mentioned, you will need to add a call Web1.JsonTextDecodeWithDictionaries to first parse the content.
I've come up with a fix for this on the iOS side, which should go out in the next iOS release. I'll need to implement the Android version, so I expect that's two release out (early next year).