Giter Site home page Giter Site logo

Comments (3)

InderKumarRathore avatar InderKumarRathore commented on July 25, 2024

That's a really good thing, but user can use our project and make this a utility in the user's project. Let's keep this here and see if people love it and then I'll include it. Since this may be useful for you but for all the people we need to see.

P.S. Thanks for taking your time and creating this PR :)

from deviceutil.

armandzwan avatar armandzwan commented on July 25, 2024

Some improvements:

+ (BOOL)hasNativeGPS {
    switch ([self hardware]) {
            // iPhones
        case IPHONE_3G:
        case IPHONE_3GS:

        case IPHONE_4:
        case IPHONE_4_CDMA:
        case IPHONE_4S:

        case IPHONE_5:
        case IPHONE_5_CDMA_GSM:

        case IPHONE_5C:
        case IPHONE_5C_CDMA_GSM:

        case IPHONE_5S:
        case IPHONE_5S_CDMA_GSM:

        case IPHONE_6:
        case IPHONE_6_PLUS:

        case IPHONE_6S:
        case IPHONE_6S_PLUS:

        case IPHONE_SE:

        case IPHONE_7:
        case IPHONE_7_PLUS:

            // iPads
        case IPAD_2:
        case IPAD_2_CDMA:

        case IPAD_3:

        case IPAD_3_WIFI_CDMA:

        case IPAD_3G:

        case IPAD_4:
        case IPAD_4_GSM_CDMA:

        case IPAD_MINI_RETINA_WIFI_CDMA:
        case IPAD_MINI_RETINA_WIFI_CELLULAR_CN:

        case IPAD_MINI:
        case IPAD_MINI_WIFI_CDMA:

        case IPAD_MINI_3_WIFI_CELLULAR:
        case IPAD_MINI_3_WIFI_CELLULAR_CN:

        case IPAD_MINI_4_WIFI_CELLULAR:

        case IPAD_AIR_WIFI_GSM:
        case IPAD_AIR_WIFI_CDMA:

        case IPAD_AIR_2_WIFI_CELLULAR:

        case IPAD_PRO_97_WIFI_CELLULAR:

        case IPAD_PRO_WIFI_CELLULAR:

            return YES;
            break;

        case IPHONE_2G:

        case IPOD_TOUCH_1G:
        case IPOD_TOUCH_2G:
        case IPOD_TOUCH_3G:
        case IPOD_TOUCH_4G:
        case IPOD_TOUCH_5G:
        case IPOD_TOUCH_6G:

        case IPAD:
        case IPAD_2_WIFI:
        case IPAD_3_WIFI:
        case IPAD_4_WIFI:
        case IPAD_MINI_WIFI:
        case IPAD_MINI_3_WIFI:
        case IPAD_MINI_4_WIFI:
        case IPAD_MINI_RETINA_WIFI:
        case IPAD_AIR_WIFI:
        case IPAD_AIR_2_WIFI:
        case IPAD_PRO_97_WIFI:
        case IPAD_PRO_WIFI:
        case SIMULATOR:
            return NO;
            break;
        default:
            // this is tricky!
            NSLog(@"We have no information for your device's GPS capabilities listed in this category.");
            NSLog(@"Your device is: %@", [self hardwareDescription]);
    }
    return YES;
}

from deviceutil.

armandzwan avatar armandzwan commented on July 25, 2024

Another update

+ (BOOL)hasNativeGPS {
    
    switch ([DeviceUtil hardware]) {
        //////////////
        // iPhones

        case IPHONE_3G:
        case IPHONE_3GS:
            
        case IPHONE_4:
        case IPHONE_4_CDMA:
        case IPHONE_4S:
            
        case IPHONE_5:
        case IPHONE_5_CDMA_GSM:
        case IPHONE_5C:
        case IPHONE_5C_CDMA_GSM:
        case IPHONE_5S:
        case IPHONE_5S_CDMA_GSM:
            
        case IPHONE_6:
        case IPHONE_6_PLUS:
            
        case IPHONE_6S:
        case IPHONE_6S_PLUS:
            
        case IPHONE_SE:
            
        case IPHONE_7:
        case IPHONE_7_GSM:
        case IPHONE_7_PLUS:
        case IPHONE_7_PLUS_GSM:
            
        case IPHONE_8:
        case IPHONE_8_CN:
        case IPHONE_8_PLUS:
        case IPHONE_8_PLUS_CN:
            
        case IPHONE_X:
        case IPHONE_X_CN:

         //////////////   
         // iPads

        case IPAD_2:
        case IPAD_2_CDMA:
            
        case IPAD_3:
        case IPAD_3G:
            
        case IPAD_3_WIFI_CDMA:
            
        case IPAD_4:
        case IPAD_4_GSM_CDMA:
            
        case IPAD_MINI:
        case IPAD_MINI_WIFI_CDMA:
            
        case IPAD_MINI_RETINA_WIFI_CDMA:
        case IPAD_MINI_RETINA_WIFI_CELLULAR_CN:
            
        case IPAD_MINI_3_WIFI_CELLULAR:
        case IPAD_MINI_3_WIFI_CELLULAR_CN:
            
        case IPAD_MINI_4_WIFI_CELLULAR:
            
        case IPAD_AIR_WIFI_GSM:
        case IPAD_AIR_WIFI_CDMA:
            
        case IPAD_AIR_2_WIFI_CELLULAR:
            
        case IPAD_PRO_97_WIFI_CELLULAR:
            
        case IPAD_PRO_WIFI_CELLULAR:
        case IPAD_PRO_2G_WIFI_CELLULAR:
        case IPAD_PRO_105_WIFI_CELLULAR:
            
        case IPAD_5_WIFI_CELLULAR:
            
            return YES;
            break;
        //////////////
        // devices without native GPS
            
        case IPHONE_2G:
            
        case IPOD_TOUCH_1G:
        case IPOD_TOUCH_2G:
        case IPOD_TOUCH_3G:
        case IPOD_TOUCH_4G:
        case IPOD_TOUCH_5G:
        case IPOD_TOUCH_6G:
            
        case IPAD:
        case IPAD_2_WIFI:
        case IPAD_3_WIFI:
        case IPAD_4_WIFI:
        case IPAD_5_WIFI:
            
        case IPAD_MINI_WIFI:
        case IPAD_MINI_3_WIFI:
        case IPAD_MINI_4_WIFI:
        case IPAD_MINI_RETINA_WIFI:
            
        case IPAD_AIR_WIFI:
        case IPAD_AIR_2_WIFI:
            
        case IPAD_PRO_97_WIFI:
        case IPAD_PRO_WIFI:
        case IPAD_PRO_2G_WIFI:
        case IPAD_PRO_105_WIFI:
            
        case SIMULATOR:
            return NO;
            break;
        default:
            // this is tricky!
            NSLog(@"We have no information for your device's GPS capabilities listed in this category.");
            NSLog(@"Your device is: %@", [DeviceUtil hardwareDescription]);
            break;
    }
    return YES;
}

from deviceutil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.