Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): Supported WKURLSchemeHandler to load custom url scheme #10751

Merged
merged 5 commits into from Mar 7, 2019

Conversation

vijaysingh-axway
Copy link
Contributor

@vijaysingh-axway vijaysingh-axway commented Mar 5, 2019

JIRA:
https://jira.appcelerator.org/browse/TIMOB-26860

Test:

  1. Create a Classic "Default Project" app.
  2. Replace the "app.js" code with the below code.
  3. Build and run on iOS.
  4. Verify that 2 images are displayed (a soccer balls and an appc logo).
var htmlText =
		'<!DOCTYPE html>' +
		'<html>' +
		'	<head>' +
		'		<meta name="viewport" content="width=device-width, initial-scale=1.0">' +
		'	</head>' +
		'	<body>' +
		'		<p>Relative Path Test</p>' +
		'		<img src="assets/images/tab1.png"/>' +
		'		<br/>' +
		'		<p>URL Scheme Test</p>' +
		'		<img src="app://Resources/assets/images/tab2.png"/>' +
		'	</body>' +
		'</html>';

var window = Ti.UI.createWindow();
var webView = Ti.UI.createWebView({
	html: htmlText,
});
window.add(webView);
window.open();

@build build added this to the 8.1.0 milestone Mar 5, 2019
@build build requested a review from a team March 5, 2019 10:35
@build
Copy link
Contributor

build commented Mar 5, 2019

Fails
🚫 Tests have failed, see below for more information.
Messages
📖

💾 Here's the generated SDK zipfile.

📖 ❌ 1 tests have failed There are 1 tests failing and 451 skipped out of 2995 total tests.

Tests:

Classname Name Time Error
android.emulator.Titanium.UI.TabGroup.events focus 6.251 timeout of 5000ms exceeded

Generated by 🚫 dangerJS against 7f97a30

Copy link
Contributor

@janvennemann janvennemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR passed

@ssjsamir ssjsamir self-requested a review March 6, 2019 13:57
Copy link
Contributor

@ssjsamir ssjsamir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FR Passed. HTML assigned to WebView "html" property is now able to access app's local files.

Tested using the following test case:

var htmlText =
		'<!DOCTYPE html>' +
		'<html>' +
		'	<head>' +
		'		<meta name="viewport" content="width=device-width, initial-scale=1.0">' +
		'	</head>' +
		'	<body>' +
		'		<p>Local Image File</p>' +
//		'		<img src="assets/images/tab1.png"/>' +
		'		<img src="app://Resources/assets/images/tab1.png"/>' +
		'	</body>' +
		'</html>';

var window = Ti.UI.createWindow();
var webView = Ti.UI.createWebView({
	html: htmlText,
});
window.add(webView);
window.open();

Test Environment

iPhone 6 (12.1 Sim)
APPC CLI: 7.0.10-17
Operating System Name: Mac OS Mojave
Operating System Version: 10.14.2
Node.js Version: 8.9.1
Xcode 10.1

@jquick-axway
Copy link
Contributor

jquick-axway commented Mar 6, 2019

@ssjsamir , can you uncomment the <img src="assets/images/tab1.png"/> line and test that too please? We want to test both paths "assets/images/tab1.png" and "app://Resources/assets/images/tab1.png" on iOS, since they both broke in 8.0.0. Thanks.

Note that relative img paths such as "assets/images/..." is the higher priority since its cross-platform with Android and Windows too. The "app://" URL scheme is iOS only.

@vijaysingh-axway
Copy link
Contributor Author

@ssjsamir I have updated PR to fix paths "assets/images/tab1.png" also. Please verify again.
Thanks @jquick-axway !

@ssjsamir
Copy link
Contributor

ssjsamir commented Mar 7, 2019

@jquick-axway @vijaysingh-axway Now able to see the image as well when using assets/images/tab1.png

@sgtcoolguy sgtcoolguy merged commit e2f291f into tidev:master Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants