@@ -15,4 +15,5 @@ namespace oxygine
bool nsImageLoad(Image& mt, void* pData, int nDatalen, bool premultiplied, TextureFormat format);
void iosGetMemoryUsage(size_t& a);
-}
+ void iosNavigate(const char*);
+}
@@ -2,10 +2,12 @@
#if TARGET_OS_IPHONE
#import <UIKit/UIImage.h>
+#import <UIKit/UIApplication.h>
#else
#import <AppKit/AppKit.h>
#endif
+
#include "ios.h"
#include "Image.h"
@@ -152,4 +154,12 @@ namespace oxygine
a = 0;
}
+ void iosNavigate(const char *url_)
+ {
+#if TARGET_OS_IPHONE
+ NSURL *url = [NSURL URLWithString: [NSString stringWithUTF8String:url_]];
+ [[UIApplication sharedApplication] openURL:url];
+#endif
+ }
@@ -51,6 +51,7 @@
#include "core/android/jniUtils.h"
#elif __APPLE__
#include <TargetConditionals.h>
+#include "ios/ios.h"
#ifdef OXYGINE_SDL
@@ -854,6 +855,8 @@ namespace oxygine
var url = Pointer_stringify($0);
window.open(url, '_blank');
}, str);
+#elif __APPLE__
+ iosNavigate(str);
OX_ASSERT(!"execute not implemented");