Skip to content

Fail to detect iPad ios 13+ #20

Open

Description

@jooohyunpark

On latest ios(13+) Safari, it detects iPad as a desktop. Works properly on chrome and other mobil devices. Could you take a look at this issue?

Activity

  1. dotneet commented on Oct 5, 2019

    @dotneet
    Collaborator

    Hi, @byjoohyunpark

    With latest iPad, Desktop Mode is enabled by default.
    So I think that that is expected result.

  2. jooohyunpark commented on Oct 11, 2019

    @jooohyunpark
    Author

    Hey @dotneet, thanks for the reply. Safari in IPad IOS 13+ now forces desktop mode as a default. This issue is solved by disabling it. But I guess eventually we will need some extra layer to deal with this setup.

  3. ruchitabavishi commented on Nov 7, 2019

    @ruchitabavishi

    I am having the same issue, can you please let me know how did you disable the force desktop mode.

  4. sunilrana123 commented on Nov 8, 2019

    @sunilrana123

    You can create one plugin like below as a temporary solution: This way you can set the device to tablet in case of ipad

    export default (context, inject) => {
    if(context.store.state.userAgent.includes('iPad')) {
    inject('device', { isTablet: true });
    }
    };

  5. 777genius commented on Dec 25, 2019

    @777genius
    Contributor

    @sunilrana123 your code will overwrite all $device property, so there will be only isTablet: true. You need to pass the remaining properties to save them:

    export default function (ctx, inject) {
      const customIsTabet = ctx.isTablet || ctx.store.state.userAgent.includes('iPad')
    
      inject('device', {
        isTablet: customIsTabet,
        isMobile: ctx.isMobile,
        isMobileOrTablet: ctx.isMobileOrTablet,
        isDesktop: !ctx.isMobileOrTablet,
        isIos: ctx.isIos,
        isWindows: ctx.isWindows,
        isMacOS: ctx.isMacOS,
        isDesktopOrTablet: !ctx.isMobile,
        isAndroid: ctx.isMobileOrTablet && !ctx.isIos
      })
    }

    Hope this helps.

  6. atinux commented on Jan 27, 2021

    @atinux

    You can now overwrites any flags or add new ones by creating a Nuxt plugin with the v2 of this module.

    See https://github.com/nuxt-community/device-module#add-a-custom-flag

  7. iBobik commented on Nov 7, 2021

    @iBobik

    iPad even in desktop mode could be detected by a touch events, because no macOS has touch screen.

  8. krkaa commented on Nov 11, 2021

    @krkaa

    iPad useragent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15". How to detect is tablet for iPad?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions