cubiq / add-to-homescreen

Add to home screen call-out for mobile devices
http://cubiq.org/add-to-home-screen
2.29k stars 747 forks source link

Wrong location for iPhone + (landscape) #118

Open twobitfool opened 9 years ago

twobitfool commented 9 years ago

In landscape mode, the iPhone 6 Plus moves the buttons to the top.

iphone-6-plus-landscape

cubiq commented 9 years ago

can you post the user agent?

twobitfool commented 9 years ago

This was from iOS simulator, so not sure if it will match real device...

Mozilla/5.0 (iPhone; CPU iPhone OS 10_9_5 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A365 Safari/600.1.4
cubiq commented 9 years ago

please always test on the real device. the emulator is not actually fully supported

bboerendans commented 9 years ago

This is from a real iPhone 6 plus: Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A405 Safari/600.1.4

Looks like its not in the useragent defined. Maybe its an option to try something with "useragent iphone and screen resolution"?

cubiq commented 9 years ago

yes, it seems we have to test the screen size (darn!)

twobitfool commented 9 years ago

I just tested on real devices, and it looks pretty good. The box is in the correct position. But the arrow is a little off (on iPhone 6+ in landscape).

Here's a fix e8ea84ecc909f58c999176162be3aac6fa703850

Note: The position of the arrow differed slightly between the real device and the iOS simulator. I have some concern that the device was not "stock" because I had to manually remove/reset several Accessibility settings. However, the CSS value provided should be "close enough" for either environment.

P.S. This bug with the iOS simulator useragent has been moved to #120.

maddy2get commented 9 years ago

I am having different but same issue. It shows popup at wrong position. Please see the attached image.

Device: iPhone 5s OS: iOS 8.1.1

It works fine for iPhone 6 with same iOS 8.1.1

iphone-5s-ios-8 1 1

Any idea on how to fix this?

Thanks, Sanjay

cubiq commented 9 years ago

I thought this was fixed... are you using the latest version?

maddy2get commented 9 years ago

It doesn't seem so unfortunately. Any help would be appreciated. Thanks.

cubiq commented 9 years ago

it's just a matter of changing the CSS a bit, I'll have a look at it

maddy2get commented 9 years ago

I agree. May be media query based on screen size and .ath-ios8.

rbrewer commented 9 years ago

I'm still seeing the incorrect popup location reported earlier in this thread by @maddy2get (and in closed issue #116) on iOS 8.1.3 on a real iPhone 5 with the latest version of add-to-homescreen. Should I create a new issue @cubiq, or do you want to reopen #116? BTW, thanks for making this great little library available.