File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ namespace iOSNativePlugin
99{
1010 public static class NativeUI
1111 {
12+ [ DllImport ( "__Internal" ) ] static extern void NativeUI_GetUnityViewSize ( ref double x , ref double y ) ;
1213 [ DllImport ( "__Internal" ) ] static extern void NativeUI_SafariViewFromUrl ( string url , CompletionCallback onCompletionCallback ) ;
1314 [ DllImport ( "__Internal" ) ] static extern void NativeUI_SafariPageSheetFromUrl ( string url , CompletionCallback onCompletionCallback ) ;
1415 [ DllImport ( "__Internal" ) ] static extern void NativeUI_RegisterStatusBarOrientationChangeCallback ( OrientationChangeCallback callback ) ;
Original file line number Diff line number Diff line change 33
44// SFSafariViewControllerDelegate 实现SafariView回调协议
55@interface NativeUI : NSObject <SFSafariViewControllerDelegate>
6+ +(CGSize)GetUnityViewSize ;
67+(void )SafariViewFromUrl : (NSString *)url onCompletionCallback : (CompletionCallback)callback ;
78+(void )SafariPageSheetFromUrl : (NSString *)url onCompletionCallback : (CompletionCallback)callback ;
89+(void )RegisterStatusBarOrientationChangeCallback : (OrientationChangeCallback)callback ;
2122
2223extern " C"
2324{
25+ void NativeUI_GetUnityViewSize (double &x, double &y)
26+ {
27+ CGSize size = [NativeUI GetUnityViewSize ];
28+ x = size.width ;
29+ y = size.height ;
30+ }
31+
2432 void NativeUI_SafariViewFromUrl (const char * url, CompletionCallback onCompletionCallback)
2533 {
2634 if (url == NULL )
Original file line number Diff line number Diff line change 33
44
55@implementation NativeUI
6-
6+ +(CGSize)GetUnityViewSize
7+ {
8+ return UnityGetGLViewController ().view .frame .size ;
9+ }
710// 获取单例
811+(instancetype )Instance {
912
You can’t perform that action at this time.
0 commit comments