Giter Site home page Giter Site logo

Comments (15)

jinnan avatar jinnan commented on June 30, 2024 1

Bravo ! It works!! Good job, thanks a lot 👍👍👍 @dannycabrera

from get-ios-model.

dannycabrera avatar dannycabrera commented on June 30, 2024

Hi @jinnan, what iPad do you have and could you please give the model # on the back of your iPad. Should be something like A1432 (this is for my iPad mini). Thanks

from get-ios-model.

jinnan avatar jinnan commented on June 30, 2024

hi @dannycabrera I've tested on 2 iPads, their Model# are : A1474 and A1566

from get-ios-model.

dannycabrera avatar dannycabrera commented on June 30, 2024

@jinnan what iOS version are you running?

from get-ios-model.

jinnan avatar jinnan commented on June 30, 2024

@dannycabrera iOS 10.3.3 for A1566 and iOS 9.3.5 for A1474

from get-ios-model.

jinnan avatar jinnan commented on June 30, 2024

@dannycabrera I juste tested on my iPhone6S (iOS 10.3.3), it didn't work neither, I got the same exception.

from get-ios-model.

dannycabrera avatar dannycabrera commented on June 30, 2024

@jinnan likely related to the type (Xamarin-PCL structure project) of project. sysctlbyname is failing. Will check into it.

from get-ios-model.

jinnan avatar jinnan commented on June 30, 2024

@dannycabrera Ok, I'll wait for your good news, thank you :)

from get-ios-model.

jimbobbennett avatar jimbobbennett commented on June 30, 2024

I've just tried it out by calling the NuGet from an iOS app and it works. You shouldn't be able to add this package to a PCL, so maybe we ned to change the NuGet to only install into Xamarin.iOS projects?

from get-ios-model.

dannycabrera avatar dannycabrera commented on June 30, 2024

@jimbobbennett agree, not sure this belongs in a PCL. Still new to creating nuget packages so do you know what needs to change to only allow Xamarin.iOS projects? Thanks

Also, already have the iPhone 8, 8 Plus and X ready to go, just waiting on the hardware strings.

from get-ios-model.

jinnan avatar jinnan commented on June 30, 2024

hi @jimbobbennett
I haven't try it in a single iOS project, but I believe it works well. In my PCL structure, the package is only available for iOS project, so I just added it to my iOS project. I added an abstract class in PCL project so I can call the funcrion from PCL. Also, I tried to call it directly in delegate page of iOS project during the initialization, and I got same exception.
I'll try it in a new PCL project later, there should be something different between single iOS project and PCL structure project.

from get-ios-model.

jinnan avatar jinnan commented on June 30, 2024

Hi again @dannycabrera @jimbobbennett

I created a new PCL structure project and a new project iOS, resp. None of them worked with the package....

In detail:

  • In Visual Studio Community for Mac, File-> New Solution... -> iOS App -> Single View App
  • Add the package from Nuget to the project
  • I put "Console.WriteLine(Xamarin.iOS.DeviceHardware.Model);" in ViewDidLoad
    The function is called, but I still got "Unkown" and the same exception

Did I do something wrong?

from get-ios-model.

dannycabrera avatar dannycabrera commented on June 30, 2024

@jinnan was able to replicate issue on Single View App. Have an idea on what it could be so let me test out a few things. Keep you posted.

from get-ios-model.

dannycabrera avatar dannycabrera commented on June 30, 2024

@jinnan I pushed package v1.1 to nuget and should get indexed here in a bit so be on the lookout. Let me know if that works.

from get-ios-model.

dannycabrera avatar dannycabrera commented on June 30, 2024

Weird issue, all I did was rebuild package and that did the trick. Glad it works now and thanks for reporting it.

from get-ios-model.

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.