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

Get ios version number in platform #8173

Merged
merged 2 commits into from Mar 16, 2017
Merged

Conversation

muxin
Copy link
Contributor

@muxin muxin commented Mar 16, 2017

Needed in #7670 and #7653

/cc @dvoytenko

@ampprojectbot
Copy link
Member

Hi, ampproject bot here! Here are a list of the owners that can approve your files.

You may leave an issue comment stating "@ampprojectbot retry!" to force me to re-evaluate this Pull Request's status

/to dvoytenko jridgewell

  • src/service/platform-impl.js

/to aghassemi alanorozco camelburrito chenshay choumx cramforce cvializ dvoytenko ericlindley-g erwinmombay gregable honeybadgerdontcare jridgewell kmh287 lannka mkhatib mrjoro muxin newmuis powdercloud zhouyx

  • test/functional/test-platform.js

For any issues please file a bug at https://github.com/google/github-owners-bot/issues

* Direct string equality check is not suggested, use startWith instead.
* @returns {string}
*/
getIosVersion() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should do a getMinorVersion instead. is that too complicated?

@dvoytenko could you take a look pls

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getMajorVersion is for browser major version. I thought if we have a getMinorVersion, that should be for browser too, but there's no such use case yet. Also, there's no use case for getting android version, so that's why I only created getIosVersion

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just name getIosVersionString().

@muxin muxin requested a review from dvoytenko March 16, 2017 18:45
@ampprojectbot
Copy link
Member

Hi, ampproject bot here! Here are a list of the owners that can approve your files.

You may leave an issue comment stating "@ampprojectbot retry!" to force me to re-evaluate this Pull Request's status

/to dvoytenko jridgewell

  • src/service/platform-impl.js

/to alanorozco camelburrito chenshay choumx cramforce cvializ dvoytenko ericlindley-g erwinmombay gregable honeybadgerdontcare jridgewell kmh287 lannka mkhatib mrjoro muxin newmuis powdercloud zhouyx

  • test/functional/test-platform.js

For any issues please file a bug at https://github.com/google/github-owners-bot/issues

if (!this.navigator_.userAgent) {
return '';
}
let version = this.navigator_.userAgent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to first test that this is indeed iOS? E.g. if (!isIos()) {return '';}?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I see in the user agent string, iPhone|iPad|iPod is always followed by OS 10_3. But it doesn't hurt to check. I'll check it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. But there could be "OS ???" in other browsers as well. Since the method is called getIosVersionString, we should make sure it's indeed iOS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I see, for ios it's always iPhone OS 10_3 together, haven't seen any other platform using OS ???. Anyway I added the check.

@camelburrito
Copy link
Contributor

Wait for @dvoytenko to approve

@muxin
Copy link
Contributor Author

muxin commented Mar 16, 2017

Merging it because it's blocking #7670. @dvoytenko If there's any other comments I can address later.

@muxin muxin merged commit 762dba7 into ampproject:master Mar 16, 2017
@muxin muxin deleted the get-ios-version branch March 16, 2017 20:18
mrjoro pushed a commit to mrjoro/amphtml that referenced this pull request Apr 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants