@@ -8,32 +8,16 @@ namespace iOSNativePlugin
88{
99 public static class Device
1010 {
11- [ DllImport ( "__Internal" ) ]
12- static extern bool Device_IsIPhoneNotchScreen ( ) ;
13-
14- [ DllImport ( "__Internal" ) ]
15- static extern bool Device_IsIPad ( ) ;
16-
17- [ DllImport ( "__Internal" ) ]
18- static extern int Device_GetDeviceOrientation ( ) ;
19-
20- [ DllImport ( "__Internal" ) ]
21- static extern bool Audio_IsBluetoothHeadphonesConnected ( ) ;
22-
23- [ DllImport ( "__Internal" ) ]
24- static extern bool Device_IsMacCatalyst ( ) ;
25-
26- [ DllImport ( "__Internal" ) ]
27- static extern bool Device_IsSuperuser ( ) ;
28-
29- [ DllImport ( "__Internal" ) ]
30- static extern void Audio_SetAudioExclusive ( bool exclusive ) ;
31-
32- [ DllImport ( "__Internal" ) ]
33- static extern void Device_PlayHaptics ( int style , float intensity ) ;
34-
35- [ DllImport ( "__Internal" ) ]
36- static extern string Device_GetCountryCode ( ) ;
11+ [ DllImport ( "__Internal" ) ] static extern bool Device_IsIPhoneNotchScreen ( ) ;
12+ [ DllImport ( "__Internal" ) ] static extern bool Device_IsIPad ( ) ;
13+ [ DllImport ( "__Internal" ) ] static extern int Device_GetDeviceOrientation ( ) ;
14+ [ DllImport ( "__Internal" ) ] static extern bool Audio_IsBluetoothHeadphonesConnected ( ) ;
15+ [ DllImport ( "__Internal" ) ] static extern bool Device_IsMacCatalyst ( ) ;
16+ [ DllImport ( "__Internal" ) ] static extern bool Device_IsSuperuser ( ) ;
17+ [ DllImport ( "__Internal" ) ] static extern void Audio_SetAudioExclusive ( bool exclusive ) ;
18+ [ DllImport ( "__Internal" ) ] static extern void Device_PlayHaptics ( int style , float intensity ) ;
19+ [ DllImport ( "__Internal" ) ] static extern string Device_GetLocaleISOCode ( ) ;
20+ [ DllImport ( "__Internal" ) ] static extern string Device_GetLanguageISOCode ( ) ;
3721
3822 public static Version GetIOSVersion ( )
3923 {
@@ -112,6 +96,19 @@ public static void PlayHaptics(UIImpactFeedbackStyle style, float intensity)
11296 /// 获取当前设备的ISO地区码(ISO 3166-1 alpha-2)
11397 /// </summary>
11498 /// <returns>ISO 3166-1 alpha-2</returns>
115- public static string GetCountryCode ( ) => Device_GetCountryCode ( ) ;
99+ [ Obsolete ( "Use Device.GetLocaleISOCode() instead" ) ]
100+ public static string GetCountryCode ( ) => GetLocaleISOCode ( ) ;
101+
102+ /// <summary>
103+ /// 获取当前设备的ISO地区码(ISO 3166-1 alpha-2)
104+ /// </summary>
105+ /// <returns>ISO 3166-1 alpha-2</returns>
106+ public static string GetLocaleISOCode ( ) => Device_GetLocaleISOCode ( ) ;
107+
108+ /// <summary>
109+ /// 获取当前设备语言的ISO码(ISO 3166-1 alpha-2)
110+ /// </summary>
111+ /// <returns>ISO 3166-1 alpha-2</returns>
112+ public static string GetLanguageISOCode ( ) => Device_GetLanguageISOCode ( ) ;
116113 }
117114}
0 commit comments