Input doesn't work on HTML5 with iPhone (DEF-3526) (SOLVED)


#1

I am having issues with getting input from an iPhone on html5 builds.

I have this simple “empty mobile” app on itch. It is built with Debug to get the prints but a Release version behaves the same. The only thing that I have changed is that I have added a script to print the input and change position of the logo. It works as it should on mac/windows but on iPhone the action_id is nil.

function init(self)
	msg.post(".", "acquire_input_focus")
end

function on_input(self, action_id, action)
	print("action_id == ", action_id)
	if action_id == hash("click") and action.pressed then
		print('action_id == hash("click") and action.pressed - OKAY!')
		go.set_position(vmath.vector3(action.x, action.y, 0), "/go1")
	end
end

I tried other Defold games, I stumbeled upon Ben James Word Worm and on that it accepts the input. I downloaded the source for it and built it with 1.2.147 and the input stopped working. I asked Ben and he said he simply uploaded the “raw” html build. His setting for Word Worm is also identical to the Empy Defold project.

Am I missing something to be able to get input from iPhones on my html5 builds?

Here is the EmptyProject (2.5 MB) files if you want to verify everything.


#2

Maybe it’s better to use touch triggers in your input_bindings ?


#3

And if you built with 1.2.146 it worked?


#4

Maybe it’s better to use touch triggers in your input_bindings ?

Unfortunately it doesn’t help, I have tried multi-touch, mouse-button-left and mouse-button-1.

And if you built with 1.2.146 it worked?

I have tried on 147, 146, 145 and 142. They all give me action_id == nil


#5

But wait, you will get action_id == nil for mouse movement and action_id ~= nil when you press/release mouse button. And you are expecting action_id to not be nil while the finger touches the screen as you would for a native iOS build?


#6

I am expecting action_id to be what mouse-button-left is assigned to when clicking on HTML5 including on an iPhone. Please understand that it works fine on on Android, Mac and Windows. It is only on iPhone that the behaviour is different. Hence the title.

I might be missing something obvious. So if someone could just download the Zip file and take a look I would be very graceful.


#7

HTML5 builds input is still not working on iOS devices. Have this been looked into?


#8

Not yet I’m afraid. I’ve made a note to investigate tomorrow.


#9

Could you upload the test project pls?


#10

There is a link in it in the first post but here it is again Empty.zip.


#11

This is zip with bundle of the game, but I’m asking for the project.


#12

Oh! I must have uploaded the wrong zip, sorry about that!
EmptyProject.zip (201.0 KB)


#13

Ok, it seems like everything is fine with your example and with Defold as well.
You can test your example here: https://agulev.com/html/EmptyProject/

I’ve tried to embed WormWorm the same way as your game embedded and input doesn’t work too: https://e77723c1-5202-427b-abc0-27cc4a415185.htmlpasta.com

Also, your example works on itch.io:
https://agulev.itch.io/test?secret=ulLm0Dy6ODHhICXNYkQxyNNK3M
File has uploaded using next settings:


#14

Okay - so this is definetly itch doing something. Becaue your website works fine, but not your itch.io.


#15

yea, moreover it works when I’m logged in and doesn’t work after logout:


#16

And Word Worm is working regardless of being logged in our out.

I did ask Ben about it when I notice this and he said the following

I don’t do anything special before uploading to itch.io. I use the same ZIP package made for the Defold community page - that is, the game in a directory then zipped up.

Here are they settings for Word Worm on itch.io - I hope it helps!


#17

I notice in the video that even though it works it still give that weird “selected canvas” thing where it darkens it. On your website it doesn’t do that.


#18

Just want to confirm, that I’ve faced the same issue on iOS and HTML5 builds made by Defold and uploaded to itch.io. Faced it somewhere in December, 2018 and don’t remember if I wrote about it on forum, it seems I did not. I’ve checked few other HTML5 games on itch.io and the bug reproduced in every Defold games I’ve found but did not reproduced in non-Defold games.

But I did not dig deeper, as it’s not my target platform, just put a Notice and direct link to index.htm on itch’s CDN (you can find it in page sources). Pure page works as expected, there is something in Itch’s JS and wrappers, I think. Hope you’ll find the real reason.


#19

Fixed in 1.2.149