patw0929 / react-smartbanner

Rewrite Smart App Banner in React.js.
https://patw0929.github.io/react-smartbanner/
MIT License
74 stars 56 forks source link

Doesn't work on IOS devices #40

Open jaredwilli opened 6 years ago

jaredwilli commented 6 years ago

When I try to view the banner when in device mode in chrome devtools, and using an IOS device setting, the banner does not show up. It also doesn't show on actual devices either.

I have seen this on the demo page too for this repo. Any ideas how to get it to work?

xanderdeseyn commented 6 years ago

Running into this issue as well. Were you able to fix it jared?

Boorasso commented 6 years ago

Try setting the prop "force" to "ios" to view the ios smart banner in chrome on a computer. Also did you make sure you cleared your cookies ? The banner won't reappear if you close it until you clear the cookie.

jaredwilli commented 6 years ago

Actually my work priorities changed and I am no longer working on making this banner for our site. But I was not ever able to get it to work. Cookies were cleared, and I tried to use the force for ios but that didn't work.

johnanisere commented 5 years ago

@jaredwilli Sorry about your issue.I've been unable to replicate the issue. Please note that you can only emulate ios/android devices in chrome dev tools using the network conditions tab.

screen shot 2019-01-14 at 1 00 11 pm screen shot 2019-01-14 at 1 00 40 pm screen shot 2019-01-14 at 1 01 22 pm
awreese commented 5 years ago

I can confirm @johnanisere is correct, simulating the User Agent works for testing in the browser.

dovvas commented 3 years ago

I had the same issue. I manipulated "setType(deviceType)" function and changed agent.device.vender === 'iOS' || agent.browser.name === 'Mobile Safari'. I know this way it doesn't support iOS < 6.

arpit-shrivastava-at-appointy commented 3 years ago

Anyone following up with this repo ? This is still happening in ios devices. Anyone can help ?

bastian-hidalgo commented 2 years ago

@arpit-appointy @dovvas @jaredwilli the reason that doesn't show on iOS devices its because @patw0929 doesn't want to give it, instead he propose to use the smart banner meta tag for iOS, look at the code:

  // iOS >= 6 has native support for Smart Banner
      } else if (
        agent.os.name === 'iOS' &&
        (this.props.ignoreIosVersion ||
          parseInt(agent.os.version, 10) < 6 ||
          agent.browser.name !== 'Mobile Safari')
      ) {
        type = 'ios';
      }

If you have a iOS version < 6 it will show you.

And i'm not saying that this is incorrect, in fact, use the meta tag for iOS:

<meta name="apple-itunes-app" content="app-id=myAppStoreID, app-argument=myURL">

As Apple suggest: https://developer.apple.com/documentation/webkit/promoting_apps_with_smart_app_banners

Obviously, is not customizable. but thats the reason.