AJAX Plugin broken when exporting to Cordova with WKWebView?

Bugs will be moved here once resolved.

Post » Tue May 10, 2016 11:51 am

Problem Description
The AJAX Plugin seems to be broken when exporting to Cordova with WKWebView. I tried downloading a local resource -- an XML file -- to parse.

On desktop and when exporting to Cordova with WKWebView disabled this works fine.

When I enable WKWebView and use the following cordova plugins:
- cordova-plugin-wkwebview-engine
- cordova-plugin-httpd

This fails when I test on iOS. It triggers the AJAX error trigger but I don't know what the error is.

Attach a Capx
https://www.dropbox.com/s/f1wajoyprb9kq ... .capx?dl=1

Description of Capx
Attempts to download a local resource (an XML) via the AJAX plugin and then parse the output via the XML plugin.

Steps to Reproduce Bug
  • Open the project.
  • Export to Cordova. Be sure to tick 'Use WKWebView'
  • Build and run the app for iOS.
  • Note that the XML fails to parse and instead the AJAX error trigger is triggered.

Observed Result
The AJAX fails to load and instead the AJAX error trigger is triggered.

Expected Result
The AJAX call should succeed and the XML data should be parsed by the XML plugin.

Affected Browsers
  • Chrome: (NO)
  • iOS Cordova (YES)

Operating System and Service Pack
iOS 9.3

Construct 2 Version ID
Release 228
B
10
S
1
Posts: 13
Reputation: 472

Post » Wed May 11, 2016 10:47 am

You also need cordova-plugin-file in WKWebView mode. How exactly are you building? Is there a reason you excluded it? Construct 2 should specify it automatically when exporting for Cordova.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,361

Post » Fri May 13, 2016 6:19 am

Hi Ashley,

I actually do have cordova-plugin-file installed as well sorry. I was only listing the plugins I thought were necessary.

In reality I have a few plugins installed:
- cordova-admob-sdklibs
- cordova-libgoogleadmobads
- cordova-plugin-ad-adcolony
- cordova-plugin-ad-unityads
- cordova-plugin-ad-unityads-sdk
- cordova-plugin-admob-simple
- cordova-plugin-compat
- cordova-plugin-file
- cordova-plugin-game-center
- cordova-plugin-httpd
- cordova-plugin-inappbrowser
- cordova-plugin-inapppurchase
- cordova-plugin-media
- cordova-plugin-nativeaudio
- cordova-plugin-whitelist
- cordova-plugin-wkwebview-engine
- cordova-plugin-x-socialsharing

In my cordova config.xml I have these tags:

<plugin name="cordova-plugin-whitelist" spec="1" />
<plugin name="cordova-plugin-game-center" spec="1" />
<plugin name="cordova-plugin-inapppurchase" spec="1" />

Most of the time I don't seem to need to add plugins to this config file otherwise.

To build I just do:

cordova build

And then I open via Xcode and compile etc.

I've tested my setup with the exact same .capx and done exports with wkwebview enabled and disabled. When it's enabled I get the AJAX failure, when it's disabled the AJAX works fine.
B
10
S
1
Posts: 13
Reputation: 472

Post » Mon May 23, 2016 1:54 pm

Thanks, should be fixed in the next beta. Good catch.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,361

Post » Sun Oct 02, 2016 5:46 pm

Hello!

C2 release 227 |233, Intel XDK 3400 | 3522, exporting to iOS

With WKWebView AJAX not working.
B
17
S
6
G
1
Posts: 130
Reputation: 2,023

Post » Sun Oct 02, 2016 7:04 pm

@SparklingAir - please file a new bug following all the guidelines, this report was fixed and subsequently closed.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,361



Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests