我在目标C初学者.我的应用程序与一个灯塔正常工作.我正在使用"estimote SDK".我有很多问题,我想使用2或3个信标.我想为每个信标推送一个View.
我不明白我怎么能用多个信标做到这一点.
我不知道是否必须使用多个信标管理器.(ESTBeaconManager*beaconManager)
我不知道如何将不同区域传递给didRangeBeacons :( NSArray*)beacons inRegion:(ESTBeaconRegion*)region
我可以使用一个信标仅用于通知,而另外两个用于在我们关闭时弹出2个不同视图.(每个信标的一个不同视图)
谢谢你的帮助.
最好的祝福.
码:
#import "ESTViewController.h"
#import "PresentViewController.h"
#import <ESTBeaconManager.h>
#import <AudioToolbox/AudioToolbox.h>
@interface ESTViewController () <ESTBeaconManagerDelegate>
@property (nonatomic, strong) ESTBeaconManager* beaconManager;
@property (nonatomic, strong) ESTBeaconManager* beaconManager2;
@property (nonatomic, strong) ESTBeaconManager* beaconManager3;
@property (nonatomic, strong) ESTBeacon* selectedBeacon;
@end
@implementation ESTViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// should i create one manager instance or more ?
self.beaconManager = [[ESTBeaconManager alloc] init];
self.beaconManager.delegate = self;
self.beaconManager.avoidUnknownStateBeacons = NO;
//self.beaconManager2 = [[ESTBeaconManager alloc] init];
//self.beaconManager2.delegate = …Run Code Online (Sandbox Code Playgroud) 根据Estimote:
在一个地区可以包含多少个信标几乎没有限制(技术上,它超过40亿).
我们如何在一个区域中添加多个信标进行监控?
我们创建一个这样的区域:
UUID ESTIMOTE_PROXIMITY_UUID = UUID.fromString("B9407F30-F5F8-4568-AFF9-25556B57FE6D");
Region ALL_ESTIMOTE_BEACONS = new Region("regionId", ESTIMOTE_PROXIMITY_UUID, null, null);
Run Code Online (Sandbox Code Playgroud) 我查看了这个问题的答案,在大多数答案中,我发现在不知道设备的UUID的情况下检测iBeacon是不可能的.
但App Store上的一些应用也是如此.以下是这些应用程序的链接,这些应用程序正在检测未知的iBeacons.
如果可以检测到未知的iBeacon,请告诉我.
提前致谢.
我已经跟随AppCoda和Devfright的在线教程创建了一个iBeacon检测应用程序.我正在使用来自estimote的iBeacon,这是一款支持iOS 8的iPad 3.该应用程序根本无法检测到我的iBeacon,而其他iBeacon应用程序正在检测它.我无法理解我在代码中遗漏或做错了什么.
这是我的.h文件:
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
@interface ViewController : UIViewController<CLLocationManagerDelegate>
@property (nonatomic, strong) CLBeaconRegion *beaconRegion;
@property (nonatomic, strong) CLLocationManager *locManager;
@property (nonatomic, strong) IBOutlet UILabel *label1;
@property (nonatomic, strong) IBOutlet UILabel *label2;
@end
Run Code Online (Sandbox Code Playgroud)
这是我的.m文件:
#import "ViewController.h"
#import <CoreLocation/CoreLocation.h>
@interface ViewController () <CLLocationManagerDelegate>
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.locManager = [[CLLocationManager alloc] init];
self.locManager.delegate = self;
//default uuid for estimote beacons
NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@"B9407F30-F5F8-466E-AFF9-25556B57FE6D"];
self.beaconRegion = [[CLBeaconRegion alloc]initWithProximityUUID:uuid identifier:@"com.rk.testregion"]; …Run Code Online (Sandbox Code Playgroud) 我正在尝试通过我目前正在处理的iOS应用程序找到从我的信标访问电池电量的方法.我正在使用Kontakt的iBeacon设备.我浏览了Estimote iOS SDK,他们提供了实现此目的的方法.我想知道它是否能够访问原始信标数据包并手动提取数据,因为我知道信标数据包结构并且信息存在.
有关如何通过此处提到的方法或任何其他方式实现此目的的任何想法?
多谢你们.
我在我的Ionic应用程序中使用phonegap-estimotebeacons插件来定位一些信标.当它获得更新的信标信息时,我希望它更新视图,但我的列表不会更新,直到我切换到另一个选项卡然后切换回来.
这是我的视图,列出了所有找到的信标:
<ion-view view-title="Beacons">
<ion-content>
<ion-list>
<ion-item ng-repeat="beacon in beacons" type="item-text-wrap">
<span>{{beacon.macAddress}}</span>
<span>{{beacon.distance}}</span>
</ion-item>
</ion-list>
</ion-content>
</ion-view>
Run Code Online (Sandbox Code Playgroud)
这是呈现视图的控制器:
.controller('BeaconsCtrl', function($scope, Beacons) {
$scope.beacons = [];
Beacons.range($scope);
})
Run Code Online (Sandbox Code Playgroud)
然后Beacons工厂开始对信标进行测距,并在每次成功回调时更新范围:
.factory('Beacons', function() {
rangeBeacons = function($scope) {
var success = function(beaconInfo) {
$scope.beacons = beaconInfo.beacons;
};
var failure = function(errorMessage) {
alert(errorMessage);
};
EstimoteBeacons.startRangingBeaconsInRegion(
{},
success,
failure
);
};
return {
range: rangeBeacons
};
})
Run Code Online (Sandbox Code Playgroud)
从我看过的其他例子来看,看起来我的视图应该在我更新$scope对象时做出反应,但是我必须转到另一个选项卡然后返回以便我的视图更新.如果$scope修改变量,我该怎么做才能让视图更新?
更新
修改了控制器代码以显示我已尝试初始化$scope.beacons为空数组,但这没有区别.
Isssue 1:
我正在按照这个estimote教程创建我自己的Estimote应用程序.但是出现了这个错误:
未知类型名称'ESTBeaconRegion'; 你是说'CLBeaconRegion'吗?
怎么解决?
我已经包含了标题和代表
#import <EstimoteSDK/EstimoteSDK.h>
@interface AppDelegate () <UIApplicationDelegate,CLLocationManagerDelegate,ESTBeaconManagerDelegate>
Run Code Online (Sandbox Code Playgroud)
这是我的podFile
# Uncomment this line to define a global platform for your project
platform :ios, '7.0'
target 'Tabster' do
pod 'EstimoteSDK', '3.1.0'
end
Run Code Online (Sandbox Code Playgroud)
问题2: 为什么框架以红色突出显示?

更新:(尝试Juan Gonzalez建议的示例应用程序)

我写了一个代码,在Beacon范围内有弹出通知.
我的通知代码如下:
private void showNotification(String message){
Log.d("Hay8","DCM8");
Intent intent = new Intent(context, MainActivity.class);
Log.d("Hay9","DCM9");
PendingIntent pendingIntent = PendingIntent.getActivity(context,0,intent,PendingIntent.FLAG_UPDATE_CURRENT);
Log.d("Hay10","DCM10");
NotificationCompat.Builder builder = new NotificationCompat.Builder(context,"default")
.setSmallIcon(android.R.drawable.ic_dialog_info)
.setContentTitle("Notification1")
.setContentText(message)
.setDefaults(NotificationCompat.DEFAULT_ALL)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setContentIntent(pendingIntent);
Log.d("Hay11","DCM11");
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Log.d("Hay12","DCM12");
notificationManager.notify(NotiID++,builder.build());
}
Run Code Online (Sandbox Code Playgroud)
我尝试使用日志调试,我认为问题是关于NotificationManager方法.这是日志:
05-23 17:23:30.774 18668-18668/com.example.user.estimotebeacon D/Hay8: DCM8
05-23 17:23:30.774 18668-18668/com.example.user.estimotebeacon D/Hay9: DCM9
05-23 17:23:30.776 18668-18668/com.example.user.estimotebeacon D/Hay10: DCM10
05-23 17:23:30.780 18668-18668/com.example.user.estimotebeacon D/Hay11: DCM11
05-23 17:23:30.781 18668-18668/com.example.user.estimotebeacon D/Hay12: DCM12
05-23 17:23:30.788 18668-18668/com.example.user.estimotebeacon E/NotificationManager: notifyAsUser: tag=null, id=1, user=UserHandle{0}
05-23 17:23:30.798 18668-18668/com.example.user.estimotebeacon D/Hay20: DCM20
05-23 17:23:30.859 …Run Code Online (Sandbox Code Playgroud) 我正在尝试检测多个iBeacons.我已经在他们附近放了三个iBeacons.
问题是逐一检测.不在数组中.它应该返回3个iBeacons.
self.beaconManager = [[ESTBeaconManager alloc] init];
self.beaconManager.delegate = self;
self.region1 = [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID major:21668 minor:53482 identifier:@"EstimoteSampleRegion"];
self.region2= [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_MACBEACON_PROXIMITY_UUID major:3894 minor:57726 identifier:@"EstimoteSampleRegion2"];
self.region3= [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_IOSBEACON_PROXIMITY_UUID major:13067 minor:31901 identifier:@"EstimoteSampleRegion3"];
[self.beaconManager startRangingBeaconsInRegion:_region1];
[self.beaconManager startRangingBeaconsInRegion:_region3];
[self.beaconManager startRangingBeaconsInRegion:_region2];
Run Code Online (Sandbox Code Playgroud)
//委托方法
-(void)beaconManager:(ESTBeaconManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(ESTBeaconRegion *)region {
//checks bRegion, so you could have it searching for other beacons if you wanted after one is notified
NSLog(@"Start");
for (ESTBeacon *iBeacon in beacons) {
NSLog(@"%@",iBeacon.minor);
}
NSLog(@"Finish");
}
Run Code Online (Sandbox Code Playgroud)
控制台O/p
Start
57726
Finish
Start …Run Code Online (Sandbox Code Playgroud) 我正在尝试将Estimote SDK集成到Android应用中.我按照https://github.com/Estimote/Android-SDK上提供的SDK说明进行操作.我已将estimote-sdk-preview.jar文件添加到libs目录中.我有什么想法我做错了吗?
我收到的错误消息是:
这就是我尝试添加服务的方式
<service android:name="com.estimote.sdk.service.BeaconService"
android:exported="false"/>
Run Code Online (Sandbox Code Playgroud)
表现
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="company.com.application1" >
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
//----------THIS IS WHERE THE ERRORS ARE----------
<service android:name="com.estimote.sdk.service.BeaconService"
android:exported="false"/>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud) 除了预定义的UUID,major,minor和mpower值之外,是否可以从我们这边添加额外的数据到estimote信标?
我想将经验计算的RSSI常数添加到信标广告包中的距离公式中,以便公式在给定环境中更可靠,并且我的用户手机中的应用程序可以将此数据用于计算距离而不是默认一个.
初学者Estimote问题:添加多个Estimote信标及其各自的主要/未成年人的正确方法是什么,以便可以使用startRangingBeaconsInRegion单独检测所有信标?
此代码适用于单个信标:
// Single Beacon Region
ESTBeaconRegion* beaconRegion = [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID
major:11111 minor:11111
identifier: @"EstimoteSampleRegion"];
// Start ranging beacons
[self.beaconManager startRangingBeaconsInRegion:beaconRegion];
Run Code Online (Sandbox Code Playgroud)
但是,此代码不适用于多个信标:
// Beacon 1 Region
ESTBeaconRegion* beacon1Region = [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID
major:11111 minor:11111
identifier: @"EstimoteSampleRegion"];
// Beacon 2 Region
ESTBeaconRegion* beacon2Region = [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID
major:22222 minor:22222
identifier: @"EstimoteSampleRegion"];
// Beacon 3 Region
ESTBeaconRegion* beacon3Region = [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID
major:33333 minor:33333
identifier: @"EstimoteSampleRegion"];
// Start ranging beacons
[self.beaconManager startRangingBeaconsInRegion:beacon1Region];
[self.beaconManager startRangingBeaconsInRegion:beacon2Region];
[self.beaconManager startRangingBeaconsInRegion:beacon3Region];
Run Code Online (Sandbox Code Playgroud)
使用此代码,仅检测到最后一个信标.(因此在这种情况下,只检测到beacon3Region).
-
如果您知道如何使用ESTBeaconRegion和startRangingBeaconsInRegion添加和检测多个信标,我将非常感谢一个代码示例,它解释了如何执行此操作.
我使用了万向节信标和Estimote信标.我需要知道两者之间是否存在技术差异?
Estimote每个灯塔售价33美元,而万向节只需5美元!
比赛是什么?