[SOLVED!] iframes and iOS devices?!!

Discussion and feedback on Construct 2

Post » Fri Sep 20, 2013 2:29 pm

Hi, all!

I was wondering if anyone had any tips/tricks/suggestions for how to make iframes and iPads/iPhones play nicely together.

We embed our games on our site with iframes and it works great... EXCEPT with iOS devices.
  • All of our games use the Touch Object
  • Every other hardware/browser combination works fine in the iframe
  • When a game is in an iframe, the iOS device doesn't seem to be activating the Touch Object.
  • All the games work fine on iOS devices if they are NOT in an iframe.

At first, I suspected that it might be a Mobile Safari issue, however, I had the same thing happen using Chrome for iOS. Ugh.

As I don't want to leave the Jobsian-Fondleslab crowd out in the cold, I'd like to get this fixed if at all possible.

Thanks! :)
-Johnjohxn2013-10-13 22:55:15
B
5
S
1
Posts: 17
Reputation: 409

Post » Fri Sep 20, 2013 2:43 pm

Does it help if you have an event like:

+ On any touch start
-> Browser object: focus
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,351

Post » Fri Sep 20, 2013 10:39 pm

Thanks for the suggestion, Ashley. Sorry to say, it didn't work.

The iframes don't seem to be receiving any touch input. If I tap the buttons in the iframe, the iPad offers to copy the iframe for me.

I did accidentally get a touch event to trigger once (and only once)on an iPhone(iOS7 & Safari). I was holding it vertically and pounding on the screen. The touch event triggered and then the browser freaked out (screen redraws of the iframe all over the place). As one would expect, it froze up after that. While finding new ways to crash Apple products is entertaining, it's not the sort of progress I was hoping for. :)

I have seen elsewhere that some coders are having issues with iOS and iframes in that they are not able to get the content inside the iframe to scroll. Possibly related? Yay Apple.

Any suggestions (short of "Android") definitely welcome!

Cheers,
John
B
5
S
1
Posts: 17
Reputation: 409

Post » Thu Oct 10, 2013 12:08 pm

Any update on this? I was just asked to make sure game will work in iframe on mobile.
B
22
S
7
Posts: 94
Reputation: 1,783

Post » Thu Oct 10, 2013 2:40 pm

Sorry to say, I've made no progress with this at all.

There seems to be an increasing amount of developers that are having problems with iOS and iframes (inability to scroll, iframe only partially being rendered, etc.). Despite the increase in reported problems, I've not seen any definitive solutions offered.

So, if you come across anything that might help, please let us all know! :)

Cheers,
-John
B
5
S
1
Posts: 17
Reputation: 409

Post » Fri Oct 11, 2013 11:35 am

Hello! I have maybe found a solution for this. I use the css importer plugin (http://www.scirra.com/forum/plugin-css-import_topic62115.html) to be able to include an external css file in my builds, and in that file i have:

html, body {
     background: transparent !important;
     color: transparent !important;
     background-color: transparent !important;
     position: absolute;
     top: 0;
     left: 0;
     right: 0;
     -webkit-backface-visibility: visible;
}

It works for me, try it out!
B
7
S
1
Posts: 22
Reputation: 526

Post » Fri Oct 11, 2013 12:56 pm

I know this isn't helpful in your current situation but you really should advice your clients to never use iframes

You know, for future reference
B
15
S
3
G
1
Posts: 91
Reputation: 1,664

Post » Fri Oct 11, 2013 1:55 pm

@johxn Thank you for bringing up this question. I'm having the same problem.

@jeansson Thanks for the potential solution. Will definitely try this out *fingers crossed*

@jn2002dk How else do you propose embedding an html5 game on a web page? I'd love to hear your suggested alternatives. I've been planning to use iframes because I thought that was our only option.
B
18
S
3
G
2
Posts: 28
Reputation: 2,694

Post » Sun Oct 13, 2013 8:50 pm

[QUOTE=divaweb]
@jeansson Thanks for the potential solution. Will definitely try this out *fingers crossed*
[/QUOTE]
How it went?


@jn2002dk good luck with suggesting anything to clients. I need to get iframe working for one pretty big important publisher. Their whole portals groups is based around iframes.
B
22
S
7
Posts: 94
Reputation: 1,783

Post » Sun Oct 13, 2013 10:09 pm

jeansson, I owe you a pint! It worked!

Your solution should probably be made a STICKY (at least until Apple gets their act together).

Now... anyone have any clever ideas about curing iOS's horrific audio support?!

Thanks again, jeansson - you saved us a lot of hair-pulling & gnashing of teeth.

Cheers,
-Johnjohxn2013-10-13 22:11:50
B
5
S
1
Posts: 17
Reputation: 409

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests