|
Post by fnllc on Aug 2, 2019 0:33:15 GMT
I'm trying to pass parameters to the RhoConnect query method. However, the params are not passed.
In my app I have the following in a controller action:
def do_sync Rho::RhoConnectClient.doSync(true, "app_mode=1") end
In the logs of my app I see the following:
Sync| Pull changes from server. Url: http://localhost:9292/app/v1/Track?p_size=2000&version=3&app_mode=1
The params are correctly passed into the URL to RhoConnect.
On my Rhoconnect server I have the following in my model:
def query(params) puts params ... end
"puts" return nothing in the log.
What is the proper way to retrieve params in RhoConnect?
|
|
|
Post by Super Admin on Aug 9, 2019 9:32:58 GMT
Hi,
What is a version of your Rhodes/Rhoconnect?
Regards, Konstantin
|
|
|
Post by fnllc on Aug 12, 2019 11:46:22 GMT
Rhoconnect 6.2 and Rhodes 6.1.16
|
|
|
Post by Super Admin on Aug 12, 2019 12:01:06 GMT
Ok, thanks. What is the OS installed on your device, Android, IOS or Windows?
|
|
|
Post by fnllc on Aug 12, 2019 13:03:24 GMT
Testing in iOS Simulator 12.4 right now. XCode 10.3. Deployment target 11.4. iOS SDK 12.4.
|
|
|
Post by Super Admin on Aug 12, 2019 13:07:29 GMT
Can you please do the same in Android Simulator?
|
|
|
Post by fnllc on Aug 12, 2019 14:53:58 GMT
I have the same problem on Android Emulator. The Rhoconnect Server is receiving the proper URL with the app_mode=1 parameter:
2019-08-12T14:51:26.155153+00:00 heroku[router]: at=info method=GET path="/app/v1/Logo?p_size=2000&version=3&app_mode=1" host=myappsync.herokuapp.com request_id=5f7b38b2-20b1-454e-9404-cadad9c93c06 fwd="173.153.84.220" dyno=web.1 connect=1ms service=728ms status=200 bytes=673 protocol=https
However, the following code on the Rhoconnect Server does not output anything:
def query(params) puts params ... end
2019-08-12T14:51:26.262883+00:00 app[web.1]:
|
|
|
Post by Vladimir Musulainen on Sept 3, 2019 8:48:20 GMT
There is the inaccuracy in documentation.
Instead must read
So, in your case the method call must be
def do_sync Rho::RhoConnectClient.doSync(true, "query={app_mode: 1}") end In this case method Model>>query receives params as string with content ''{app_mode: 1}".
The implementation of the method query in your RhoConnectServer is responsible to parsing query param from string to a hash if it is required.
Thank you for pointing out the mistake.
|
|
|
Post by fnllc on Sept 3, 2019 14:08:19 GMT
Thank you. This works now. Note that iOS has this warning:
Sync| Pull changes from server. Url: http://localhost:9292/app/v1/Track?p_size=2000&version=3&token=336733569708663&query={"app_mode":1} iPhoneNetRequest| Error decoding URL query: *** +[NSURLComponents setPercentEncodedQuery:]: invalid characters in percentEncodedQuery
|
|
|
Post by Vladimir Musulainen on Sept 3, 2019 17:17:27 GMT
it's possible URI encoding is required
|
|