I'm working with the latest version of the 'Feedback' plugin. The Lightbox Popup works fine on my desktop, but when I try to open the form on a mobile device (Android) I get the following error message:
You cannot access AJAX views directly...
Bad request...
Sorry. The request is invalid or incomplete.
I also get an ajax white box that attempts to open, but then shows a white empty box with the words 'error:default' in the center and a 'close' selection.
Sometimes the form will open, but more often I get the error messages. I'd greatly appreciate any help or ideas.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Steve W.@SAWill
Steve W. - 0 likes
- iionly@iionly
iionly - 0 likes
- Steve W.@SAWill
Steve W. - 0 likes
- iionly@iionly
iionly - 0 likes
- Steve W.@SAWill
Steve W. - 0 likes
- Steve W.@SAWill
Steve W. - 0 likes
- iionly@iionly
iionly - 0 likes
You must log in to post replies.....Also, I'm using Elgg version 2.3.1. Thanks again for any help.
Which option have you set for the Feedback button location (fixed to left side, footer menu or extras menu)? With the feedback button fixed to the left side (button moves to the bottom of the page if width of screen is small) the feedback window is slightly differently implemented as with the other two options (where you get a lightbox popup). So, the feedback button fixed to the left side might work also on Android. I don't know at the moment what might cause the lightbox loading issue on Android. I would need to see if I can reproduce the issue (not easy as I can't access my test installations via Android...). Maybe it's a timeout issue with loading of JS/AMD modules on your Android phone (how's the connection speed?). Or there might be some conflict with another plugin (maybe causing the timeout in the end) if some plugin(s) on your site has some different, mobile device-specific mode.
Thanks for your reply. I am using the setting for applying it to the footer menu. Also, I'm not using any other mobile device plugin. I've verified that it's not just my Android device that is effected. It's happening the same for all of my Android devices. But after further research, I realized that the error happens specifically on mobile devices for which I have a Google Play application installed for my website. Somehow, Google is disabling ajax request from applications. I found this applicable info on a site called Telerik:
Removing the targetSdkVersion value automatically switches the SDK that is used when building to the minSdkVersion. Basically, what you say is that your app works with target sdk 11 which is Android 3.0.x and does not work with sdk 21 which is Android 5.0. The reason for this are the changes made in the Android 5.0 WebView behavior and namely the blocking of third party cookies. You can read about them here. Using cookies in hybrid mobile apps is not a best practice. The reason for this is that cookies are shared between all web views in all apps on the device. This can lead to mixing cookies between a browser (with the same domain as your ajax requests) and your app. Things can get messy. It is much more natural to use localStorage in mobile apps as a place to remember user auth.
Regarding Andy's problem below, this can be due to lack of an INTERNET permission of your app. If your app does not make ajax calls at all or they return a status code 0, go to your Project Properties -> Android -> Permissions and check if the INTERNET permission is turned on.
I hope this information helps.
I verified that my application's manifest.xml file has the INTERNET permission set to 'on' and, also, that the sdk version applied is always overridden by the Gradle Build script used in Android Studio ver 2.3.3. So there is no point in writing sdk info into the manifest.xml file. So this leaves me where I started; how to get the feedback ajax call to work despite the Google Play application?
Is your site https? I found these
https://stackoverflow.com/questions/35754298/all-ajax-post-requests-are-getting-sent-as-get-requests-in-android-play-stor
https://stackoverflow.com/questions/20036260/phonegap-android-app-ajax-requests-to-https-fail-with-status-0
These postings seem to indicate that a failing ajax requests might be due to a missing or incorrectly installed ssl certificate. Could this be the problem on your site?
I'm afraid that I can't debug any issues with Google Play apps. And it might not even limited to the Feedback plugin either if an app blocks ajax requests. I would think that other ajax requests without Elgg wouldn't work either.
Yes, I do have an https site, but I have verified via "https://www.sslshopper.com/ssl-checker.html#hostname=a2ss43.a2hosting.com%20" that my certificates are good. As far I as know, the 'Feedback' plugin is the only one I have so far with an ajax request. I narrowed the problem down to the latest Andoid ADK version is not accepting third party page requests. The only way I believe that it can be fixed is:
1. Manually lower the SDK version from my Android Studio app, which entails having to create a whole new app project because Google Play does not allow updates with lower SDK versions.
2. Write a workaround code in one of the app files (not really doable at the moment, with my limited coding ability).
3. Find another plugin that does not use ajax request in the Elgg plugin directory. So far, I haven't been able to find a plugin other than the "Feedback" one that works with Elgg version 2.3.3.
I'd greatly appreciate any other suggestions that I may be missing. Thanks again.
I've tried option one, but it did not work because the latest SDK version is hard coded into the Android Studio program. This leaves me with options two or three where, currently, I don't have any quick answers. I'd appreciate any other suggestions.
You could try it with version 2.0.0 of the Feedback plugin. If I remember correctly, this version does not yet use ajax requests. But this version has a bit less functionality compared to the latest version.
Or you can try to figure out how to get your Android app to not block the ajax requests. I have absolutely no knowledge about Android app coding, so I can't give you any advice here. But googling for example for "android sdk ajax request blocked" or similar searches should give you some results indicating that there are ways to give an app certain permissions, allow cross-domain request (even though the ajax request of Feedback is for the same domain...) and maybe whitelisting domains. What exactly might be necessary is beyond my knowledge though.