Hello,

I've developed a mobile app for android with drupalgap. This app is based on a website which has SSL. Website's address is:

https://www.bestvoiprate.com

When I install this app to my phone or android emulator, and run the application for the first time, app cannot pass the snapshot phase (Loading part). If I wait for a long time and kill app, and restart again, app starts normally. If I clear the storage space from android app settings, same problem occurs again.

If I upgrade app without clearing the storage, app will start normally for the first run after upgrade.

You can test the app with this link if you want:
https://play.google.com/store/apps/details?id=com.kteknoloji.bestvoiprate

PS: I changed Drupal.settings.site_path to my another drupal website with no SSL installed, and build the same code, than app started without waiting at Loading screen.

Comments

coolman7’s picture

Issue summary: View changes
coolman7’s picture

Issue summary: View changes
coolman7’s picture

Issue summary: View changes
coolman7’s picture

This problem is not specific for SSL pages. There should be problem with drupal configuration or something else. I copied all source code and change the website address to another drupal website of my own with SSL . And I didn't get the same problem. So problem should not be with SSL. There should be a problem with https://www.bestvoiprate.com drupal site. But how can I determine what's the problem?

tyler.frankenstein’s picture

Status: Active » Postponed (maintainer needs more info)

Nice job on publishing your app!

You'll need to step through the DrupalGap bootstrap process, and place alert() messages along the way to figure out when/where it is crashing.

Alternatively, you can try to figure out how to view console.log() output messages when compiling to Android. The only way that I am aware of is using DDMS inside of Eclipse, which is a pain in the butt to set up compared to just using the PhoneGap CLI.

coolman7’s picture

I debugged code with drupalgap_alerts. drupalgap_services_preprocess has been reached but drupalgap_services_postprocess has never been reached. So it stuck between drupalgap_services_preprocess and drupalgap_services_postprocess. What can be wrong? How can I debug further? I cannot find any other code to call drupalgap_services_preprocess or drupalgap_services_postprocess.

tyler.frankenstein’s picture

Those are hooks, so instead search for "services_preprocess" and/or "services_postprocess".

coolman7’s picture

I searched them too. I can only find them in jdrupal-7.x-1.0.min.js. But it is unreadable. So I'm stuck.

tyler.frankenstein’s picture

Switch to a jDrupal dev snapshot (aka a .js file instead of a .min.js file), to inspect its source code, or visit the jDrupal project page.

coolman7’s picture

I've just discovered the root cause of the problem: Simple Mobile Redirect module and drupalgap are incompatible.

https://www.drupal.org/project/simple_mobile_redirect

If I enable this module, this problem occurs. If I disable this module, the problem disappears.

Let me summarize the problem again:

If Simple Mobile Redirect is enabled and set Redirect Android parameter of module something like domain.com/mobile-detected,
mobile application on android device loops forever or at least for 5-10 minutes at the loading screen. If I wait a few minutes and kill the application and restart again, application starts normally.

If I disable this module, application starts normally.

I believe Simple Mobile Redirect module loops some pages that drupalgap wants to load from drupal website. But I have no idea how to fix this problem.