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

implement an option to ignore the iOS version #12

Merged
merged 2 commits into from
Dec 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/SmartBanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class SmartBanner extends Component {
title: PropTypes.string,
author: PropTypes.string,
url: PropTypes.string,
ignoreIosVersion: PropTypes.bool,
};

static defaultProps = {
Expand Down Expand Up @@ -70,7 +71,8 @@ class SmartBanner extends Component {
} else if (agent.os.name === 'Windows Phone' || agent.os.name === 'Windows Mobile') {
type = 'windows';
// iOS >= 6 has native support for Smart Banner
} else if (agent.os.name === 'iOS' && parseInt(agent.os.version, 10) < 6) {
} else if (agent.os.name === 'iOS' &&
(this.props.ignoreIosVersion || parseInt(agent.os.version, 10) < 6)) {
type = 'ios';
} else if (agent.device.vender === 'Amazon' || agent.browser.name === 'Silk') {
type = 'kindle';
Expand Down
8 changes: 8 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ <h2>Props</h2>
Custom URL.
</td>
</tr>
<tr>
<th scope="row">ignoreIosVersion</th>
<td><code>false</code></td>
<td>
Boolean to ignore the iOS version, so that the banner is also displayed on
devices that support the native banner.
</td>
</tr>
</tbody>
</table>
</div>
Expand Down