This is an automated email from the ASF dual-hosted git repository.

shazron pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-device.git


The following commit(s) were added to refs/heads/master by this push:
     new d65cdf6  CB-14106 - device.model is different on simulator and on real 
device (#80)
d65cdf6 is described below

commit d65cdf62e368c8c59258616bd949b8a2d82bcf54
Author: Daniel Toplak <d.top...@cadenas.de>
AuthorDate: Wed May 23 07:07:09 2018 +0200

    CB-14106 - device.model is different on simulator and on real device (#80)
---
 src/ios/CDVDevice.m | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/ios/CDVDevice.m b/src/ios/CDVDevice.m
index 4d75a57..de53533 100644
--- a/src/ios/CDVDevice.m
+++ b/src/ios/CDVDevice.m
@@ -28,6 +28,9 @@
 
 - (NSString*)modelVersion
 {
+#if TARGET_IPHONE_SIMULATOR
+    NSString* platform = 
NSProcessInfo.processInfo.environment[@"SIMULATOR_MODEL_IDENTIFIER"];
+#else
     size_t size;
 
     sysctlbyname("hw.machine", NULL, &size, NULL, 0);
@@ -35,7 +38,7 @@
     sysctlbyname("hw.machine", machine, &size, NULL, 0);
     NSString* platform = [NSString stringWithUTF8String:machine];
     free(machine);
-
+#endif
     return platform;
 }
 

-- 
To stop receiving notification emails like this one, please contact
shaz...@apache.org.

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org
For additional commands, e-mail: commits-h...@cordova.apache.org

Reply via email to