Android/iOS手机朝向获取

对于iOS手机:

苹果公司给出了一个枚举,如下:

2、对于获取手机屏幕
(1)

(2)

3、对于当前手机是不是横屏或者竖屏的判断
(1)判断是否是竖屏

(2)判断是否是横屏

对于Android手机:

判断手机方向的具体判断代码如下:

对于 Flutter:

使用 native_device_orientation 插件完成相同的检测功能。

参考链接


LocalAuthentication开发实践

在iPhone 5s加入Touch ID后,指纹识别的功能在App中逐渐受到青睐,特别是对于本地安全较高的应用(如带支付的App)指纹识别是必备的功能,它既能解决在验证过程中输入密码的繁琐过程,同时指纹识的安全等级更高。那么,要想在自己开发的应用中使用指纹识别,就必须要LocalAuthentication.framework提供的API,下面将详细地介绍如何使用这个框架来实现指纹识别功能。

基础用法

我们先来看下面的例子:

继续阅读LocalAuthentication开发实践

移动端系统生物认证技术详解

相信大家对于生物认证应该不会陌生,使用指纹登陆或者 FaceId 支付等的需求场景如今已经很普遍,所以基本上只要涉及移动端开发,不管是 Android 、iOS 或者是 RN 、Flutter 都多多少少会接触到这一业务场景。

当然,不同之处可能在于大家对于平台能力或者接口能力的熟悉程度,所以本篇主要介绍 Android 和 iOS 上使用系统的生物认证需要注意什么,具体流程是什么,给需要或者即将需要的大家出一份汇总的资料

继续阅读移动端系统生物认证技术详解

iOS - keychain详解及变化

keychain介绍

iOS keychain 是一个相对独立的空间,保存到keychain钥匙串中的信息不会因为卸载/重装app而丢失。相对于NSUserDefaults、plist文件保存等一般方式,keychain保存更为安全。所以我们会用keyChain保存一些私密信息,比如密码、证书、设备唯一码(把获取到用户设备的唯一ID 存到keychain 里面这样卸载或重装之后还可以获取到id,保证了一个设备一个ID)等等。keychain是用SQLite进行存储的。用苹果的话来说是一个专业的数据库,加密我们保存的数据,可以通过metadata(attributes)进行高效的搜索。keychain适合保存一些比较小的数据量的数据,如果要保存大的数据,可以考虑文件的形式存储在磁盘上,在keychain里面保存解密这个文件的密钥。

继续阅读iOS - keychain详解及变化

在macOS Big Sur(11.4)编译Hummer

最近在macOS Big Sur(11.4)编译Hummer

Android版本编译:

如果报错如下:

参考 ABIs [arm64-v8a] are not supported for platform. Supported ABIs are [armeabi-v7a, x86].

如果运行测试用例时报错如下:

解决方案为在项目中增加:

IOS版本编译:

参考链接


AX88179 USB网卡无法在macOS Big Sur(11.0.1)系统上正常使用

Background
Last year, we wrote that older macOS drivers, known as System Extensions (KEXTs), would begin to be deprecated as of the macOS 10.15 Catalina release. This week, as macOS 11 Big Sur is released, KEXTs have officially been deprecated and are no longer functional.

Instead, Apple is now enforcing the requirement for devices that require third-party drivers to operate as DriverKit Extensions (DEXTs). This change affects many products across the consumer electronics industry, including Docking Stations, USB peripherals, Security/Anti-Virus software, and Networking adapters.

Luckily, most platform vendors and integrated circuit (IC) manufacturers have been prepared for this change and began working on their DEXT implementation after Apple released pertinent documentation at their WWDC (World Wide Developer Conference) in June 2019.

Unfortunately, some vendors could not begin their full transition from KEXT to DEXT until this year. Not all pertinent DriverKit documentation was released at the 2019 event as expected, but, instead, was released at WWDC 2020 in June. Specifically, for Plugable and many other brands, this applies to ASIX-based USB Ethernet Adapters like our USB3-E1000, USBC-E1000, USB2-E1000, and USB2-E100, which we wrote about here for the release of macOS 10.15 Catalina:
https://plugable.com/2019/10/04/usb-ethernet-adapter-not-working-after-macos-catalina-10-15-update-we-can-help/

Current Status for ASIX-based Ethernet Adapters [Novemeber 13, 2020]
We began removing macOS support from our most popular wired network adapters (USB3-E1000 and USBC-E1000) in October 2019. We saw the continued potential for a poor or broken user experience with ASIX-based adapters on macOS and could not in good conscience market the adapters as fully compatible in the long-term as long as ASIX was unwilling to commit to continued development and support of their ICs on macOS.

We have continued to push ASIX for a DEXT beta driver to validate and test internally in the past year. Unfortunately, ASIX has been unable to deliver this solution as requested in anticipation of this significant macOS milestone. We expect a Beta driver from ASIX by the end of November for AX88179 products like the USB3-E1000 and USBC-E1000. Once the driver is validated, we will update this blog post and product driver pages with links to download the driver.

If a wired Ethernet connection is critical to your workflow, Plugable recommends not updating to macOS 11 Big Sur from macOS 10.15 Catalina.

At this time, Plugable is unable to provide a DEXT driver for the following products:
USB3-E1000 IC: AX88179
USBC-E1000 IC: AX88179
USB2-E1000 IC: AX88178 (ASIX has discontinued the IC in this product, and they have not committed to a compatible driver for macOS 11 Big Sur)
The USB2-E100 IC: AX88772 ASIX-based product continues to function, utilizing the in-box drivers in macOS.

We understand this news can be frustrating for our customers and is a situation we have been working to avoid for over one year. We will update this blog post as new information is available to us.

While we cannot promise a functional DEXT driver at any point in the future, if you would like to be notified of that news should it occur, please sign-up on the form below, and we will email everyone as soon as it is available.

继续阅读AX88179 USB网卡无法在macOS Big Sur(11.0.1)系统上正常使用

在macOS Catalina(10.15.5)上搭建Flutter开发环境

下载并安装目前最新的Android Studio 4.0,然后通过Android Studio 4.0安装Android SDK

下载目前最新的flutter

配置环境变量

上述环境变量,全部追加到 .bashrc 尾部

如果不增加到.bashrc 尾部,则在 Android Studio 4.0 创建项目的时候,会非常慢,主要是网络问题。

必要的环境配置,依赖下载

继续阅读在macOS Catalina(10.15.5)上搭建Flutter开发环境

XCode 无法显示Size Inspector

XCode 升级到4.5 以后,在View的设置界面中就再也找不到Size Inspector  的踪迹了,找了很长时间,才知道原来 到 4.5 的时候,引入了“Autolayout”功能来简化设计,可是,当需要手动配置某些复杂控件的时候,这个就不怎么智能了。

找到下面的方法禁止掉其自动的功能。只是所有的都要手动设置了。

在Interface Builder中选中View,然后在Attributes Builder中去掉“Use Autolayout”前面的钩,如下图:

1352635874_6561

Xcode4.5中app名称本地化

选中工程,在Info中的Localizations按+号,为InfoPlist.strings创建本地化。

image

添加完成后会出现这么几个文件,箭头指向的就是生成的语言信息文件

image

然后选中下图指示的文件

image

在空白处单击

image

选择 Add Row ,增加 “Application has localized disolay name”,如果你选择过 "Show Raw Key/Values",那么对应添加的应该是 "LSHasLocalizedDisplayName" 添加后,选择属性为 "YES"

接下来,就是 ,如果是给 iPAD ,iPhone 开发的则添加如下

在InfoPlist.strings(English)添加 CFBundleDisplayName = "TestLocalization";

在InfoPlist.strings(Chinese)添加 CFBundleDisplayName = "本地化测试";

如果是给 Mac 开发的,则添加

在InfoPlist.strings(English)添加 CFBundleName = "TestLocalization";

在InfoPlist.strings(Chinese)添加 CFBundleName = "本地化测试";