Skip to content

Commit

Permalink
Merge pull request #12 from Intermaps/ignore-ios-version-option
Browse files Browse the repository at this point in the history
implement an option to ignore the iOS version
  • Loading branch information
patw0929 authored Dec 31, 2016
2 parents e3b8787 + 2c17c68 commit 7290f63
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
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

0 comments on commit 7290f63

Please sign in to comment.