我在几周内与ibeacons合作,当iphone击中beaconregion(靠近附近时)时,我试图发布一些本地通知.
当应用程序在后台锁定并显示时,它工作正常,但当我的显示变黑时,didRangeBeacons方法停止被调用.
我知道通过使用
region.notifyEntryStateOnDisplay = true;
Run Code Online (Sandbox Code Playgroud)
我们可以在显示时收到通知.
有什么方法可以实现发布通知,而应用程序是后台锁定和显示关闭.
请帮帮我.
我正在尝试唤醒我的应用程序(重新启动它),当它进入我定义的信标区域但我无法让它工作.这是我正在使用的步骤和代码.
监控我的CLBeaconRegion
NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@"EBEFD083-70A2-47C8-9837-E7B5634DF524"];
beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"daRegion"];
beaconRegion.notifyEntryStateOnDisplay = NO;
beaconRegion.notifyOnEntry = YES;
beaconRegion.notifyOnExit = YES;
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
[self.locationManager startMonitoringForRegion:beaconRegion];
Run Code Online (Sandbox Code Playgroud)实现委托方法
- (void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region;
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region;
- (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region;
Run Code Online (Sandbox Code Playgroud)我有一台带蓝牙4.0的笔记本电脑,或蓝牙低能耗的笔记本电脑.
出于测试目的,我想将这台Windows 8笔记本电脑变成一个假的iBeacon UUID/MajorID/MinorID,这样我就可以测试我写的App.
有没有可以用来广播信标的软件?或者我可以(轻松)自己编写的任何API或库?
像这样,但是对于Windows:https://github.com/timd/MactsAsBeacon
一个真正的iBeacon正在这里,但我很想在此期间进行一些测试.
我正在使用AltBeacon库来定位我的设备附近的信标.我使用的是库的所有默认值,即扫描周期为1100毫秒,扫描周期为0毫秒.
该库每1100毫秒调用一次我的监听器,但问题是在很多这样的调用中,没有信标检测.信标仅被检测到大约30%-40%的呼叫,另外70%的呼叫表示周围没有信标.
我该怎么做才能解决这个问题?
问候
是否有任何参考显示ibeacon与HTML5网络应用程序的使用.我使用HTML5和javascript构建一个Web应用程序,我想在我的应用程序中集成ibeacon.它可能吗?
谢谢
我正在尝试使用指定的值创建一个NSUUID:
let uuidString = "000000-0000-0000-0000-000000000000"
let beaconUUID:NSUUID = NSUUID(UUIDString: uuidString)
Run Code Online (Sandbox Code Playgroud)
第二行给出错误消息:
调用额外参数'UUIDString'
看文档似乎应该有用.有任何想法吗?
我脑水肿还添加as String后uuidString,同样的问题.
我一直在尝试从AltBeacon 修改参考应用程序以检测iBeacons.
在RangingActivity中,我取代了
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ranging);
beaconManager.bind(this);
}
Run Code Online (Sandbox Code Playgroud)
同
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ranging);
BeaconParser bp = new BeaconParser();
bp.setBeaconLayout("m:0-3=4c000215,i:4-19,i:20-21,i:22-23,p:24-24");
List<BeaconParser> lbp = beaconManager.getBeaconParsers();
lbp.add(bp);
beaconManager.bind(this);
}
Run Code Online (Sandbox Code Playgroud)
为了应用修改来检测我在这里找到的iBeacon .
但是这会抛出lbpjava.util.Collections $ UnmodifiableRandomAccessList.我是Java的新手,但我想这是一个我无法添加项目的列表,并且在第二个链接中的解决方案之间的库中必须更改某些内容.
有人知道BeaconParser在这里添加新的或者我做错的正确方法是什么?
我有一个与灯塔交互的iOS应用程序.还具有检测来自信标的信号的功能,如果信号超出范围,我想在数据库中存储某些东西(在这种情况下是核心数据)
func updateDistance(distance: CLProximity) {
UIView.animateWithDuration(1.0) { [unowned self] in
switch distance {
case .Unknown:
self.view.backgroundColor = UIColor.grayColor()
self.distanceReading.text = "No Beacon Signal Detected"
updateDatabaseWithLocation()
}
}
}
Run Code Online (Sandbox Code Playgroud)
所以只要应用程序在前台运行,应用程序就可以正常运行.我的理解是,当用户没有主动使用应用程序并仍然从信标获取信号时,我也可以在后台使用该应用程序.如果是这样,我该如何完成这项任务?
我将以下内容添加到info.plist中仍然无法正常工作.
也可以更新数据库吗?
我们如何检测iOS应用何时被暂停?
在UIApplicationDelegate官方文档中没有提及此方法。
这些是应用程序可以具有的状态:

(来源:apple.com)
用例:
我想记录由于位置事件而唤醒应用后停止运行的时间。例如,我有一个iBeacon,该应用程序正在跟踪。我激活了iBeacon,该应用程序在后台成功启动(持续10秒钟)。我想,当应用程序停止运行这10秒钟后,检测经过。但是,似乎没有AppDelegate方法允许拦截此事件(请考虑我正在调查此特定情况。
上一个问题: 我问过一个类似的问题,但没有得到回答。请在这里找到它。
我正在开发一个信标检测应用程序,目前非常适合kontakt品牌信标.
客户给我发了一些我从未见过的新信标,我用谷歌搜索过,但我找不到他们的品牌.
以下信息与他们给我的这个灯塔有关:
uuid: fda50693-a4e2-4fb1-afcf-c6eb07647825
pass: 000000
name: ion_beacon00021
major: 16789
minor: 24532
Run Code Online (Sandbox Code Playgroud)
我已经将我的代码转换为监视两个uuid而不使其工作
for (index, beaconID) in beaconsIds.enumerated() {
let beaconUUID = UUID(uuidString: beaconID)!
let identifier = "BLERegionBeacon \(index)"
let beaconRegion = CLBeaconRegion(proximityUUID: beaconUUID, identifier: identifier)
self.locationManager?.startMonitoring(for: beaconRegion)
self.locationManager?.startRangingBeacons(in: beaconRegion)
}
func configureLocationManager() {
self.locationManager = CLLocationManager()
self.locationManager!.delegate = self
self.locationManager!.desiredAccuracy = kCLLocationAccuracyBest
self.locationManager!.distanceFilter = kCLDistanceFilterNone;
self.locationManager!.activityType = CLActivityType.automotiveNavigation;
for region in self.locationManager!.monitoredRegions {
self.locationManager?.stopMonitoring(for: region)
}
if CLLocationManager.authorizationStatus() != CLAuthorizationStatus.authorizedAlways {
self.locationManager?.requestAlwaysAuthorization()
}
self.locationManager!.startUpdatingLocation()
}
Run Code Online (Sandbox Code Playgroud)
如果没有找到如何让这个新iBeacon显示工作,我已经使出了第三方应用程序(如MyBeacon, …