- 博客(495)
- 资源 (1)
- 收藏
- 关注
原创 ios swift app在后台或是被杀死了怎样使用蓝牙
iOS开发中APP在后台运行与扫描蓝牙遇到的坑iOS 唤醒被Kill的APP保证蓝牙的长连接Getting Location Updates for iOS 7 and 8 when the App is Killed/ Terminated/ Suspended
2021-01-21 19:22:57
17
原创 iOS swift 定时器
//TimeInterval 1后面的单位是秒 Timer.scheduledTimer(withTimeInterval: TimeInterval(1), repeats: true, block:{(timer: Timer) -> Void in //这里写需要重复执行的代码 })参考博客:Swift定时器的几种实现方式...
2021-01-18 16:57:59
17
原创 ios swift 打印Data
代码: func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) { print(#function) if let data: Data = requests[0].value { print(data) print(NSData(data: data)) }
2021-01-16 14:31:58
17
原创 UIScrollView storyboard 约束 布局
下面这边文章有用:Xcode 11 UIScrollView xib storyboard设置约束报错问题
2021-01-14 19:29:19
21
原创 iOS swift UITextField 限制输入指定的字符 限制输入字符的长度
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { if type == .cameraName { }else{ return true; } guard let text = te...
2021-01-13 19:24:52
29
原创 iOS swift 蓝牙
参考博客:RxSwift 封装 CoreBluetooth(三) 连接RxSwift 封装 CoreBluetooth(四) 外设接口设计及实现
2021-01-12 20:45:04
38
原创 Subscript ‘subscript(_:)‘ requires that ‘String.Index‘ conform to ‘RangeExpression‘
Subscript ‘subscript(_????’ requires the types ‘String.Index’ and ‘Int’ be equivalent解决如下: let index: String.Index = contentStr.index(contentStr.startIndex, offsetBy: i) btn.setTitle(""+contentStr[index...index], for: .normal)
2021-01-11 09:50:49
34
原创 (iOS, Swift)十六进制字符串转Data,Data转十六进制String
(iOS, Swift)十六进制转Data,十六进制转整形,Data转String
2021-01-07 20:44:08
45
原创 Failed to load resource: net::ERR_CLEARTEXT_NOT_PERMITTED
参考博客:Failed to load resource: net::ERR_CLEARTEXT_NOT_PERMITTEDandroid:usesCleartextTraffic
2021-01-07 14:48:06
24
原创 APK REQUIRES VALID PRIVACY POLICY APK REQUIRES PROMINENT DISCLOSURE
我用了极光推送,却没有在隐私政策中具体说明推送的用途
2021-01-07 10:53:39
27
原创 ios tableview Header In Section字体大小
Swift - 修改tableView分组(section)头部、尾部的字体颜色和大小
2021-01-06 20:29:32
30
原创 iOS swift 延迟执行
//now后面的单位是秒 DispatchQueue.main.asyncAfter(deadline: .now()+1, execute: { print(Thread.current) print("yanc") print(self.peripheral?.services) })打印:<NSThread: 0x2829bc940>{number = 1, name
2021-01-06 15:55:20
18
原创 Fiido Smart Lock Privacy Policy(飞道智锁隐私政策)
EnglishThe app uses the bluetooth of the phone to communicate with the lockApp or get the location of the phone, so that when the lock is connected to the App via Bluetooth, the location of the phone, that is, the current location of the lock, can be re
2021-01-04 11:27:19
51
原创 invalid mode ‘kCFRunLoopCommonModes‘ provided to CFRunLoopRunSpecific
出来开关是开的,我按了一下关,就打印出了invalid。。。也不影响运行,我就没管它
2020-12-30 17:06:09
22
原创 android(mac)查看秘钥文件的有效期(信息)
1.打开终端,进入本机java虚拟机的bin目录cd /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin2.执行下面的命令keytool -list -v -keystore 秘钥文件地址 -storepass 秘钥库密码keytool -list -v -keystore /Users/macvivi/Desktop/锁/上架/smartLock1.keystory -storepass 1234563
2020-12-29 12:57:12
47
原创 android对应用进行签名(生成签名文件秘钥key)
文章目录1.缘起:传apk到google play,说是apk没有签名2.根据google官网上的指导出了问题:JKS秘钥库使用专用格式。建议使用。。。3.解决方法1.缘起:传apk到google play,说是apk没有签名2.根据google官网上的指导出了问题:JKS秘钥库使用专用格式。建议使用。。。对应用进行签名(google play)要翻墙3.解决方法参考下面的博客:JKS 密钥库使用专用格式。建议使用 "keytool -importkeystore生成的秘钥问题如下图:
2020-12-28 20:53:47
59
原创 cordova(ios android)蓝牙权限 手机蓝牙开关开启 跳到设置界面
用到的cordova插件:app权限相关:cordova-diagnostic-plugin (github)弹框插件:cordova-plugin-dialogs(github)本人代码://处理蓝牙不可用,function dealBluetoothIsNotOn(){ console.log("getBluetoothState") cordova.plugins.diagnostic.getBluetoothState(function(state){ c
2020-12-25 18:43:07
39
原创 cordova(ios android)位置权限 gps位置开关开启 跳到设置界面
文章目录1.cordova插件代码2.iOS请求用户授权的系统位置弹框也是可以用代码调出来的1.cordova插件代码插件:cordova-diagnostic-plugin (github)代码://授权都是ok的才会给回调,否则不会有回调,去找用户要授权去了function locationAvailable(callBack) { //位置是否授权 cordova.plugins.diagnostic.isLocationAuthorized(function (a
2020-12-25 12:23:56
83
原创 cordova cordova-plugin-dialogs插件的navigator.notification.confirm方法和alert的方法同时调用,在iOS上app会死掉
2020-12-23 14:12:08.580079+0800 XXX[22388:4404947] [Presentation] Attempt to present <UIAlertController: 0x1018d1a00> on <MainViewController: 0x100b08c30> (from <MainViewController: 0x100b08c30>) which is already presenting <UIAlertCon
2020-12-23 14:25:45
25
原创 cordova app权限管理 跳到设置界面
android插件:cordova-plugin-android-permissions (github)ios插件:cordova-plugin-permissionScope (github)
2020-12-23 13:03:47
76
原创 cordova 蓝牙 因为android10位置权限,而导致蓝牙无法扫描的问题
文章目录1.问题描述1.1 扫描无法开始BLEPlugin: Stopping Scan, BluetoothAdapter: stopLeScan(), BluetoothAdapter: isLeEnabled(): ON,主要是在安卓的手机上发生,后面发现是要给存储权限,还有位置权限设为始终允许app获取位置,总之是权限问题导致的1.2 在android 9的华为手机上,可能是因为保护连续扫描几次,会过几秒扫描不了。用我同事android 10的vivo手机,弹出的框只有使用期间允许使用位置的选项,但
2020-12-23 11:49:44
118
原创 js(cordova) 百度地图 问题总结
文章目录1.v3.0版本白宫无法添加标注,国内可以,v2.0白宫也可以1.v3.0版本白宫无法添加标注,国内可以,v2.0白宫也可以
2020-12-18 16:27:32
49
1
原创 api:1 Failed to load resource: net::ERR_CLEARTEXT_NOT_PERMITTED
android应用内跳转WebView出现如标题的报错信息,原因是从Android 6.0开始引入了对Https的推荐支持,与以往不同,Android P的系统上面默认所有Http的请求都被阻止了。解决方法如下:在清单文件里加入android:usesCleartextTraffic="true"这句即可参考博客:网页无法打开…因为:net:ERR_CLEARTEXT_NOT_PERMITTED错误解决办法...
2020-12-18 11:00:13
24
原创 javascript 百度地图 undefined is not an object (evaluating ‘c.x‘)
是网络的问题导致js文件没有加载完全,我也不是很清楚,有时候我什么都不做,它又自己好了
2020-12-17 20:50:28
68
原创 原码 反码 补码
以一个byte为例正数:原码 反码 补码三合一1原码 反码 补码: 0000 0001负数:-1原码: 1000 0001反码:符号未不变,其他位取反:1111 1110补码:反码+1:1111 1111计算机都是用补码来存数据的负数在计算机中怎样存储原码/反码/补码计算器...
2020-12-15 13:59:02
21
原创 ios 广播里的kCBAdvDataLocalName字段和蓝牙名不一致的问题
文章目录1.用cordova-plugin-ble-central插件搜索到同一蓝牙设备,在android和iOS设备下打印出的data如下2.标题说的情况,只在iOS设备(iPhone)上偶尔会出现,android手机上是一致的且与iOS设备上的kCBAdvDataLocalName字段一致,当出现不同时蓝牙调试app搜索的时候显示的是广播里的kCBAdvDataLocalName,但iphone设置里的蓝牙显示的时候蓝牙名,如下图3.解决方法:判断一下平台,android平台用peripheral.na
2020-12-14 20:08:35
47
原创 cordova本地存储(存取): 读取项目里的本地文件
文章目录1.用到下面的插件2.代码3.打印截图4.下面的博客记录了我解决问题的过程1.用到下面的插件cordova-plugin-file github2.代码 window.resolveLocalFileSystemURL(cordova.file.applicationDirectory, function (dirEntry) { console.log('file system open: ' + dirEntry.name); consol
2020-12-12 20:52:05
106
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人 TA的粉丝