|
@@ -29,6 +29,7 @@
|
|
/*************************************************************************/
|
|
/*************************************************************************/
|
|
|
|
|
|
#include "ios.h"
|
|
#include "ios.h"
|
|
|
|
+#include <sys/sysctl.h>
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
|
#import <UIKit/UIKit.h>
|
|
|
|
|
|
@@ -42,6 +43,21 @@ void iOS::alert(const char *p_alert, const char *p_title) {
|
|
[alert show];
|
|
[alert show];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+String iOS::get_model() const {
|
|
|
|
+ // [[UIDevice currentDevice] model] only returns "iPad" or "iPhone".
|
|
|
|
+ size_t size;
|
|
|
|
+ sysctlbyname("hw.machine", NULL, &size, NULL, 0);
|
|
|
|
+ char *model = (char *)malloc(size);
|
|
|
|
+ if (model == NULL) {
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
+ sysctlbyname("hw.machine", model, &size, NULL, 0);
|
|
|
|
+ NSString *platform = [NSString stringWithCString:model encoding:NSUTF8StringEncoding];
|
|
|
|
+ free(model);
|
|
|
|
+ const char *str = [platform UTF8String];
|
|
|
|
+ return String(str != NULL ? str : "");
|
|
|
|
+}
|
|
|
|
+
|
|
String iOS::get_rate_url(int p_app_id) const {
|
|
String iOS::get_rate_url(int p_app_id) const {
|
|
String templ = "itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=APP_ID";
|
|
String templ = "itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=APP_ID";
|
|
String templ_iOS7 = "itms-apps://itunes.apple.com/app/idAPP_ID";
|
|
String templ_iOS7 = "itms-apps://itunes.apple.com/app/idAPP_ID";
|