GithubHelp home page GithubHelp logo

kontaktio / kontakt-ios-sdk Goto Github PK

View Code? Open in Web Editor NEW
48.0 48.0 9.0 110.97 MB

This SDK makes it easy for you to configure, monitor, and securely update Kontakt.io Beacons through our Kontakt.io API.

Home Page: http://developer.kontakt.io

License: Other

Objective-C 86.55% Shell 1.60% C 11.59% Swift 0.25%

kontakt-ios-sdk's People

Contributors

dniklewicz-kio avatar jaceksoftnauts avatar stoprocent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kontakt-ios-sdk's Issues

Internal server error when trying to connect to read configuration from nearby devices

When trying to readConfigurationWithCompletion I get the following error:

Request failed: internal server error (500)

Does this mean that it's an error of the Kontakt.io server or is there an issue with my code or something else? I tried with Beacons of the firmwares 3.1 and 4.1. My beacons are not locked and the devices connected to the internet.

My objective-c code:

- (void)devicesManager:(KTKDevicesManager *)manager didDiscoverDevices:(NSArray<KTKNearbyDevice *> *)devices {
    for (KTKNearbyDevice *device in devices) {
        KTKDeviceConnection *connection = [[KTKDeviceConnection alloc] initWithNearbyDevice:device];
        
        [connection readConfigurationWithCompletion:^(KTKDeviceConfiguration* configuration, NSError* error) {
            if (error == nil) {
                NSLog(@"Configuration: uniqueId: %@, uniqueId from config: %@, uuid: %@, minor: %@", device.uniqueID, configuration.uniqueID, [configuration.proximityUUID UUIDString], configuration.minor);
            } else {
                NSLog(@"ERROR: beacon with uniqueId %@, error: %@", device.uniqueID, error.localizedDescription);
            }
        }];
    }
}

Get more results

Hello there!

[[KTKCloudClient sharedInstance] getObjects:[KTKDevice class] parameters:@{@"uniqueId":@"b05C6"} completion:^(KTKKontaktResponse * _Nullable response, NSError * _Nullable error) {
        NSLog(@"%@ ",response);   
    }];

I have used the method getObjects to get my gateway devices,and your tips tell me I can get more results when use the following example,but i found the value of response.nextResultsURL is nil.It will cause an error "unsupported URL".

// Call next result set ..
        [[KTKCloudClient sharedInstance] GET:response.nextResultsURL completion:^(KTKKontaktResponse * _Nullable response, NSError * _Nullable error) {
            // ... more results ?
        }];

Carthage update

Why does the README tell me to run $ carthage update when this repo is not a project. Carthage can't build this repo because it's already pre-built. I suggest that the Carthage instructions be completely removed because this repo is not compatible with Carthage.

$ carthage update
*** Fetching kontakt-ios-sdk
*** Skipped downloading kontakt-ios-sdk.framework binary due to the error:
	"Must specify two-factor authentication OTP code."
*** Checking out kontakt-ios-sdk at "v1.4.3"
*** xcodebuild output can be found in /var/folders/bk/6150wm5938gdxbyqqrklh_w00000gr/T/carthage-xcodebuild.RZaN4C.log
*** Skipped building kontakt-ios-sdk due to the error:
Dependency "kontakt-ios-sdk" has no shared framework schemes

If you believe this to be an error, please file an issue with the maintainers at https://github.com/kontaktio/kontakt-ios-sdk/issues/new

Kontakt iOS Management App

Hi,

In the iOS management application, once an Eddystone beacon is detected, the application is able to display its name. However, going through the KTKEddystone, I can't seem to find that property anywhere. How do we access those properties? Do we need to query the Rest API for that?

EDIT: As I understand, the KTKNearbyDevice is the one accessed in the management app. Is there any way to get the KTKEddystoneUUID from the a KTKNearbyDevice?

How to output the table as csv file in kontakt-ios-sdk/Examples/OSX/Kontakt Scanner/Kontakt Scanner.xcodeproj/

Hey @stoprocent , I just bought 4 beacons from Kontakt and I managed to run this example kontakt scanner(kontakt-ios-sdk/Examples/OSX/Kontakt Scanner/Kontakt Scanner.xcodeproj/) Currently I can see the RSSI valueS in the app:
screen shot 2016-08-17 at 9 11 49 pm
I would like to output the table to a local .csv file but I could not figure our a way to do it. Do you have any suggestions on how should I do that? Thanks in advance for your help.

beacon mac address

It is possible to get mac address from beaconManager:didRangeBeacons: inRegion: delegate method.
Something equivalent with android getAddress

KTKDeviceManger want to search only beacons Which are registered in my console

Hello ,

I am Using Kontakt.io latest sdk in Objective C.

In my mobile application i want to search ,only beacons which are registered in my console account.
Currently i have implemented my code as below.

// Setting API Key to Kontakt
[Kontakt setAPIKey:@"HNsIEXoeYNgnBnJFnADWytZrlSkjaZko"];

// Initializing KTKDeviceManager Obj
devicesManager = [[KTKDevicesManager alloc] initWithDelegate:self];

// Start discovering beacons
[devicesManager startDevicesDiscovery];

//Delegate method in my class
-(void)devicesManager:(KTKDevicesManager *)manager didDiscoverDevices:(NSArray<KTKNearbyDevice *> *)devices{
if(devices.count >0){
for(int i=0;i<devices.count;i++){
KTKNearbyDevice *device = [devices objectAtIndex:i];
NSLog(@"devicesManager Method Call - UniqueID -%@",device.uniqueID);
}
}

Here i am getting beacons which are registered in my console , and other beacon which is near by.

Please guide me how to get only beacons which are registered in my console.

respoons contacts is null

curl post

curl -X "GET" "https://ovs.kontakt.io/presence/contact/receiver?placeId=xxxxxxxxxxx&interval=M1&startTimestamp=1489631400&endTimestamp=1489631491&q=properties.accessLevel==4"
-H "Api-Key: xxxxxxxxxxxxx"
-H "Accept: application/vnd.com.kontakt+json;version=9"

respoons contacts is null

{"searchMeta":{"interval":"M1","placeId":"xxxxxxxx","startTimestamp":1489631400,"endTimestamp":1489631491,"startIndex":0,"maxResult":500,"prevResults":"","nextResults":"https://ovs.kontakt.io/presence/contact/receiver?placeId=xxxxxxxxxxxxxx&interval=M1&startTimestamp=1489631400&endTimestamp=1489631491&q=properties.accessLevel%3D%3D4&startIndex=500","filter":"properties.accessLevel==4"},"contacts":[]}

Problems kontakt.io SDK and geofences in one project.

kontaktio_geofencing_problem

If there is a CLLocationManager (Geofences) and a KTKBeaconManager (iBeacons) running in the same Swift project, the KTKBeaconManagerDelegate sometimes tries to handle a CLCircularRegion.
If I try to access the proximityUUID from the KTKBeaconRegion object in the methods didDetermineState:, didEnter: or didExitRegion: I get the following error:

libswiftFoundation.dylib`static Foundation.UUID._unconditionallyBridgeFromObjectiveC (Swift.Optional<__ObjC.NSUUID>) -> Foundation.UUID:

I have build a demo project to proof this.

https://github.com/patricks/kontaktio_geofencing_problem

bicode not recognized yet

Hi, after 1.0.3 upgradig, archive generator in xcode not recognize yet bitcode.

My error in detail:

ld: '/Users/manuel/x-code/bfm/Pods/GoogleUtilities/Libraries/libGTM_NSData+zlib.a(GTMNSData+zlib.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

thx

@import directive does not work with Obj-c++

Hi,

@import directive in framework headers don't allow the usage of the framework to be behind an obj-c++ implementation.

It is very easy to fix either by not using the @import directive or by doing it with this example code:

#if __has_feature(modules)
@import CoreLocation;
#else
#import <CoreLocation/CoreLocation.h>
#endif

Additionally, I'm not sure if the #ifdef for testing iOS 10 CoreBluetooth types is working well with iOS 10.1. At least, I had to disable it in my system but I didn't have a go to actually fix it.

Thanks!

Br,
Moises

No delegate methods gets called .

Hi
I am integrating your sdk to one of my project . I have followed the instruction provided on the website .
Here is my code snippet

KTKBeaconManager *beaconManager = [[KTKBeaconManager alloc] initWithDelegate:self];
NSUUID *uid = [[NSUUID alloc] initWithUUIDString:@"f7826da6-4fa2-4e98-8024-bc5b71e0893e"];

KTKBeaconRegion *beaconRegion = [[KTKBeaconRegion alloc] initWithProximityUUID:uid identifier:@"com.domnique.beaconDemo"];

switch ([KTKBeaconManager locationAuthorizationStatus]) {

    case kCLAuthorizationStatusNotDetermined:
        [beaconManager requestLocationAlwaysAuthorization];
        break;
    case kCLAuthorizationStatusDenied:
        NSLog(@"Denied");
        break;
    case kCLAuthorizationStatusRestricted:
        NSLog(@"Restricted");
        break;
    case kCLAuthorizationStatusAuthorizedWhenInUse:
        NSLog(@"in Use");
        break;
    case kCLAuthorizationStatusAuthorizedAlways:
        
        if ([KTKBeaconManager isMonitoringAvailable]) {
            
            [beaconManager startMonitoringForRegion:beaconRegion];
        }
        break;
        
    default:
        break;
}

Problem with me is that after asking permission for location , no delegate call backs . And even the app is also not get listed in location service for using location .

I have added the key in info.plist for locationServiceAlways.

P.S - This is the version i am using right now
// KontaktSDK
// Version: 1.3.2

Kindly revert .

Kontakt iOS SDK(8) - Region Failed

Hi there,

I am trying to get an iOS app going that connects to the kontakt beacons. I have one and have gone through the setting up documentation, but I can't seem to figure out how to detect the beacon or enter the region specified.

func beaconManager(_ manager: KTKBeaconManager, monitoringDidFailFor region: KTKBeaconRegion?, withError error: Error?) { print("Region Failed \(error!.localizedDescription)") }
It always fails and returns a "Could not resolve proximity"

Any help, guidance is highly appreciated.

Thank you

Monitoring & state detection not working with some identifiers

Hey,

I've been struggling with getting my KTKBeaconManagerDelegates methods called, I did everything as suggested in your GitHub README, your guide, I triple-checked everything and still couldn't find a cause for the issue.

So to make it short, when instantiating KTKBeaconRegion I provided an identifier Michal, with capital "M". After changing it to basically anything with first lowercase character, everything started working as expected.

Can you reproduce the issue? Is there really some magic that doesn't accept initial capital characters? Or have I missed something?

Thanks!
Michal

No bluetooth power/enabled alert

Normally, when an iOS app calls
CBCentralManager *centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil];
Then iOS automatically shows a popup alert message requesting the user to turn on Bluetooth in case it's off.

However, when we use the KTKDevicesManager to find beacons, there seems to be no iOS system alert in case bluetooth is disabled:

self.kontaktDevicesManager = [[KTKDevicesManager alloc] initWithDelegate:self];
[self.kontaktDevicesManager startDevicesDiscoveryWithInterval:1.0];

We would like to enable this warning for the user in case his device's bluetooth is powered off. Can this be accomplished with the Kontakt SDK without having to create a (unused) CBCentralManager solely for this bluetooth check?

KTKBeaconManager Monitoring Delegate methods are not triggering

Hi I'm using Kontakt iOS SDK and I have followed tutorial as mentioned

Through pods I'm installing SDK
pod out is :

Update all pods
Updating local specs repositories

CocoaPods 1.2.0.beta.1 is available.
To update use: sudo gem install cocoapods --pre
[!] This is a test version we'd love you to try.

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.2.0.beta.1

Analyzing dependencies
Downloading dependencies
Using KontaktSDK (1.3.2)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

My Code :
AppDelegate.h :

#import <UIKit/UIKit.h>
#import <KontaktSDK/KontaktSDK.h>

#define IS_OS_8_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)


@interface AppDelegate : UIResponder <UIApplicationDelegate,KTKBeaconManagerDelegate>

@property (strong, nonatomic) UIWindow *window;
@property(strong,nonatomic) KTKBeaconManager *beaconManager;

@end

AppDelegate.m

#import "AppDelegate.h"

@interface AppDelegate ()
@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
//    self.locationManger = [[CLLocationManager alloc] init];
//    self.locationManger.desiredAccuracy = kCLLocationAccuracyBest;
//    [self.locationManger setDelegate:self];
//    [self.locationManger startUpdatingLocation];

    [Kontakt setAPIKey:@"*****************"];
    
    [self beaconScan];

    return YES;
}


- (void)applicationWillResignActive:(UIApplication *)application {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}


- (void)applicationDidEnterBackground:(UIApplication *)application {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}


- (void)applicationWillEnterForeground:(UIApplication *)application {
    // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}


- (void)applicationDidBecomeActive:(UIApplication *)application {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}


- (void)applicationWillTerminate:(UIApplication *)application {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

-(void)beaconScan{
    NSLog(@"beaconScan"); 
    self.beaconManager = [[KTKBeaconManager alloc] initWithDelegate:self];
    
    NSUUID *myProximityUUID = [[NSUUID alloc] initWithUUIDString:@"*************"];
    KTKBeaconRegion *region1 = [[KTKBeaconRegion alloc] initWithProximityUUID:myProximityUUID identifier:@"Beacon region 1"];

    switch ([KTKBeaconManager locationAuthorizationStatus]) {
        case kCLAuthorizationStatusNotDetermined:
            [self.beaconManager requestLocationAlwaysAuthorization];
            break;
            
        case kCLAuthorizationStatusDenied:
        case kCLAuthorizationStatusRestricted:
            // No access to Location Services
            break;
            
        case kCLAuthorizationStatusAuthorizedWhenInUse:
            // For most iBeacon-based app this type of
            // permission is not adequate
            break;
            
        case kCLAuthorizationStatusAuthorizedAlways:
            if ([KTKBeaconManager isMonitoringAvailable]) {
                NSLog(@"kCLAuthorizationStatusAuthorizedAlways");
                [self.beaconManager startMonitoringForRegion:region1];
            }
            break;
    }
    
}
- (void)beaconManager:(KTKBeaconManager *)manager didChangeLocationAuthorizationStatus:(CLAuthorizationStatus)status {
    if (status == kCLAuthorizationStatusAuthorizedAlways) {
        NSUUID *myProximityUUID = [[NSUUID alloc] initWithUUIDString:@"****************"];
        KTKBeaconRegion *region1 = [[KTKBeaconRegion alloc] initWithProximityUUID:myProximityUUID identifier:@"Beacon region 1"];
        [self.beaconManager startMonitoringForRegion:region1];
    }else if (status == kCLAuthorizationStatusNotDetermined){
        [self.beaconManager requestLocationAlwaysAuthorization];
    }
}
- (void)beaconManager:(KTKBeaconManager *)manager didStartMonitoringForRegion:(__kindof KTKBeaconRegion *)region {
    // Do something when monitoring for a particular
    // region is successfully initiated
    NSLog(@"didStartMonitoringForRegion %@",region);
    [manager startRangingBeaconsInRegion:region];
}

- (void)beaconManager:(KTKBeaconManager *)manager monitoringDidFailForRegion:(__kindof KTKBeaconRegion *)region withError:(NSError *)error {
    NSLog(@"monitoringDidFailForRegion %@ %@error ",region,error);
}

- (void)beaconManager:(KTKBeaconManager *)manager didEnterRegion:(__kindof KTKBeaconRegion *)region {

    NSLog(@"didStartMonitoringForRegion %@",region);

    [manager startRangingBeaconsInRegion:region];
}

- (void)beaconManager:(KTKBeaconManager *)manager didExitRegion:(__kindof KTKBeaconRegion *)region {

    NSLog(@"didStartMonitoringForRegion %@",region);

    [manager stopRangingBeaconsInRegion:region];
}
-(void)beaconManager:(KTKBeaconManager *)manager didRangeBeacons:(NSArray<CLBeacon *> *)beacons inRegion:(__kindof KTKBeaconRegion *)region{
    NSLog(@"didRangeBeacons beacons %@ in region %@",beacons,region);
}
@end

For the first time I have run the app in device through xcode it is working properly
and second time running the app no delegate methods are calling, even the CLAuthorizationStatus is kCLAuthorizationStatusAuthorizedAlways,and app is in device privacy location service. if I uninstall the app and installed it again it is working fine for the first time and from second time as same no delegate methods are calling

Device : iPhone 5S
iOS Version : iOS 10,9

Estimated distance to beacon using KTKNearbyDevice

We are using Kontakt beacons for one of our project. Our goal is to detect user presence within 1 meter of range from beacon. So i was trying to use KTKDevicesManager and KTKNearbyDevice and it does not have any property that indicate distance/accuracy.

I know that CLBeacon have this property but for this we have to use region monitoring.

I think it is possible to get estimated distance for KTKNearbyDevice because both required parameters for distance calculation are there (RSSI, transmission power). How ?

Request state for region

Hi!

We have problem getting both state for a given regions and list of regions monitored (i saw there is already a bug opened for the last point).

Regarding requestStateForRegion: we never get any callback for any beacons. Is this something that is working on our test suite?

Best,
Loïc

Beacon Pros in iOS not firing Enter/Exit events

I have beacon pros using iOS app and they are not firing the Enter/Exit events. My code for Enter/Exit work for all other beacon types from Kontakt but beacon pros are not getting detected. I got the region based enter/exit but not getting the specific to beacon.

Reading Configuration returns CBErrorDomain 5

Hi, I can't seem to read the beacon configuration using the following code, It always return an NSError 5.

Here is the code, I've tried this with firmware 3.1 and 4.1 with the same results. The admin App is working.

In AppDelegate.swift
Kontakt.setAPIKey(Constants.BeaconAPI.kontakt)

Scanning for devices works and in the delegate I'm trying to read the config however it already returns an error

func devicesManager(manager: KTKDevicesManager, didDiscoverDevices devices: [KTKNearbyDevice]?) {

    for device in devices! {
        if (device.name == selectedBeacon?.beaconName) {
            self.kontaktNearBy = device
            kontaktManager!.stopDevicesDiscovery()
            self.tableView.reloadData()

            let connection = KTKDeviceConnection( nearbyDevice: self.kontaktNearBy!)

            connection.connectionTimeout = NSTimeInterval(10)

            var config : KTKDeviceConfiguration  // = KTKDeviceConfiguration()
            var error : NSError

            connection.readConfigurationWithCompletion { config, error in
                if (error == nil) {
                    // OK
                    //self.tableView.reloadData()
                }
            }


        }
    }
}

Unable to run project with SDK dependancy

Hi,

Trying to integrate the latest SDK, but got an error during app launching (either simulator or device):

dyld: Library not loaded: @rpath/KontaktSDK.framework/KontaktSDK
Referenced from: /var/mobile/Containers/Bundle/Application/5E332836-5379-48C4-96BD-4F0D7AC4C86D/goevent.app/goevent
Reason: image not found

I saw some commits friday and this morning, is it related?
Thanks.

Loïc

Beacon Proximity is Inconsistent

Hello,

We are having some strange issues now that we've upgraded to the latest SDK. It took a while to get used to the new structure of things and also the delegate callbacks (would have been great to have a better migration guide here). It looks like we are now getting all of the proper delegate callbacks after quite a struggle, but unfortunately we are seeing some strange behavior with the method: func beaconManager(_ manager: KTKBeaconManager, didRangeBeacons beacons: [CLBeacon], in region: KTKBeaconRegion) {

Essentially, I am here with an iPad running an app that is integrated with the latest Kontakt.io SDK and I have one of our beacons right next to me. The didRangeBeacons delegate method gets called over and over again as we would expect, but the proximity for the beacon keeps changing state between Unknown, Near, Immediate when it should always be Near/Immediate since I'm literally right next to the beacon. Very confused as to why it keeps giving back Unknown for stretches at a time and would rather not have to put in custom code to deal with this behavior. Note that I just updated via CocoaPods to the latest SDK version 1.3.3 and the beacon has the latest firmware 3.1. Also when I use the Kontakt.io iOS app it shows as the beacon being nearby and properly powered.

Here is some log output:

1885-35219 proximity: IMMEDIATE, 1
1885-35219 proximity: IMMEDIATE, 1
1885-35219 proximity: IMMEDIATE, 1
1885-35219 proximity: UNKNOWN, 0
1885-35219 proximity: UNKNOWN, 0
1885-35219 proximity: UNKNOWN, 0
1885-35219 proximity: UNKNOWN, 0
1885-35219 proximity: IMMEDIATE, 1
1885-35219 proximity: IMMEDIATE, 1
1885-35219 proximity: UNKNOWN, 0

Any info would be great. Not sure how to resolve this issue.

"didRangeBeacons" results empty array

Hi, Team

I'm using Kontakt.io sdk in my app. when I'm ranging beacon always I'm getting empty array even beacon immediate to device.

`
NSUUID *ProximityUUID = [[NSUUID alloc] initWithUUIDString:@"7244bebc-0084-4605-baef-0592ec35d589"];
self.KTKBRegion = [[KTKBeaconRegion alloc] initWithProximityUUID:ProximityUUID identifier:@"Beacon"];
self.KTKBManager = [[KTKBeaconManager alloc] initWithDelegate:self];
[self startMonitoring];

-(void)startMonitoring{
NSLog(@"Entered to start monitoring method");

if ([[self.KTKBManager monitoredRegions] containsObject:self.KTKBRegion]) {
    NSLog(@"this beacon region is already monitored %@",self.KTKBRegion.proximityUUID);
    [self.KTKBManager requestStateForRegion:self.KTKBRegion];
    
} else {
    
    NSLog(@"this beacon region is not monitored till %@ ",self.KTKBRegion.proximityUUID);
    [self.KTKBManager startMonitoringForRegion:self.KTKBRegion];
}

}

//Beacon Monitoring method
-(void)beaconManager:(KTKBeaconManager *)manager didStartMonitoringForRegion:(__kindof KTKBeaconRegion *)region{
NSLog(@"Beacon Monitoring Started for the region %@",region.proximityUUID);
[self.KTKBManager startRangingBeaconsInRegion:self.KTKBRegion];
}
//
-(void)beaconManager:(KTKBeaconManager *)manager didDetermineState:(CLRegionState)state forRegion:(__kindof KTKBeaconRegion *)region{
NSLog(@"Beacon Region State Determine ");

switch (state) {
    case CLRegionStateUnknown:
    {
        NSLog(@"Region state is unknown");
        [self.KTKBManager stopRangingBeaconsInRegion:self.KTKBRegion];
        break;
    }
    case CLRegionStateInside:
    {
        NSLog(@"Region state is In-Side");
        [self.KTKBManager startRangingBeaconsInRegion:self.KTKBRegion];
        break;
    }
    case CLRegionStateOutside:
    {
        NSLog(@"Region state is Out-Side");
        [self.KTKBManager stopRangingBeaconsInRegion:self.KTKBRegion];
        break;
    }
}

}

-(void)beaconManager:(KTKBeaconManager *)manager didRangeBeacons:(NSArray<CLBeacon *> *)beacons inRegion:(__kindof KTKBeaconRegion *)region{

  NSLog(@"we have ranged beacon %@ proximityUUID %@",beacons,region.proximityUUID);

}
`

KTKDevicesManager documentation confusion

I want to scan for Kontakt beacons and read the battery status on them.

It seems like KTKNearbyDevice returns the battery status, so I followed your tutorial and used the KTKDevicesManager.

One problem with the documentation is that:

  1. It initializes KTKDevicesManager as KTKBluetoothManager
  2. The code doesn't compile with 1.1.3, as there's no header for KTKBluetoothManager
@property KTKDevicesManager *devicesManager;
...
self.devicesManager = [[KTKBluetoothManager alloc] initWithDelegate: self];

It seems like there's an error in your documentation ?

It looks like it should be:

self.devicesManager = [[KTKDevicesManager alloc] initWithDelegate: self];

Just like in your example app.

Create new venue

Hello there!

I would like to create a new venue in the Kontakt Cloud, and is trying to use the createObject:completion: in the KTKCloudClient.

How do I specify the name and description of the venue? The name and description properties on the KTKVenue class is readonly, so I can't init a new KTKVenue object.

Right now I can do it this way, but I think it should be possible to use the createObject: method. Isn't that right?

NSDictionary *venueParameters = @{@"name": @"New venue",@"description":@"Created with the KontaktSDK"};

[[KTKCloudClient sharedInstance] POST:@"venue/create" parameters:venueParameters completion:^(KTKKontaktResponse * _Nullable response, NSError * _Nullable error) {

}];

Integration error

dyld: Library not loaded: @rpath/KontaktSDK.framework/KontaktSDK
Referenced from: /Users/Welcome/Library/Developer/CoreSimulator/Devices/1BFA5957-3059-4430-A537-A53711E00207/data/Containers/Bundle/Application/3EAE9BD0-7C21-4B4C-B038-B61A76EDC6D5/iBeaconsInt.app/iBeaconsInt
Reason: image not found

All beacons for Venue

GET /venue/:id response specifies that there should be a property returned that includes devices for venue, but only Device Count is available as a property. Was this removed or not yet added?

I need to get the minor numbers for all beacons at a specified venue, or the lowest and the highest, and this was the only way I could think to do it.

Reason: image not found

I am using the latest SDK which seems to be updated just 7 hours ago. Myproject name is "kontactTest" and i am having following issue (break point) before showing the initial Screen.

dyld: Library not loaded: @rpath/KontaktSDK.framework/KontaktSDK
Referenced from: /var/mobile/Containers/Bundle/Application/87DCAF8B-3111-4CD7-A054-60145DE1188B/kontactTest.app/kontactTest
Reason: image not found

I recieve an error in Swift

i have this code and the console prints "Optional("The operation couldn’t be completed. (KTKCentralManagerErrorDomain error 10.)")"

here is my code:
thanks in advance

import UIKit
import KontaktSDK

class ViewController: UIViewController, KTKEddystoneManagerDelegate {

var eddystoneManager: KTKEddystoneManager!
var namespaceRegion: KTKEddystoneRegion!
var domainRegion: KTKEddystoneRegion!
var secureNamespaceRegion: KTKSecureEddystoneRegion!


override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.

    Kontakt.setAPIKey("AyxUsOijBTYrCuKkQkqofPvUlDTtEgqE")

    self.eddystoneManager = KTKEddystoneManager.init(delegate: self)

}

override func viewWillAppear(animated: Bool) {

    // If should scan for all nearby Eddystones
    // Passing nil will look for all regions
    self.eddystoneManager.startEddystoneDiscoveryInRegion(nil)

    // Scan for Eddystones with specific namespace ID
    self.namespaceRegion = KTKEddystoneRegion.init(namespaceID: "f7826da6-4fa2-4e98-8024-bc5b71e0893e")
    self.eddystoneManager.startEddystoneDiscoveryInRegion(namespaceRegion)

     // Scan for Eddystone with specific domain in url
    self.domainRegion = KTKEddystoneRegion.init(URLDomain: "github.com")
    self.eddystoneManager.startEddystoneDiscoveryInRegion(domainRegion)

    // Scan for Secure Namespace Region
    self.secureNamespaceRegion = KTKSecureEddystoneRegion.init(secureNamespaceID: "416d786e4e41")
    self.eddystoneManager.startEddystoneDiscoveryInRegion(secureNamespaceRegion)

}

override func viewWillDisappear(animated: Bool) {

    self.eddystoneManager.stopEddystoneDiscoveryInAllRegions()

    // ... or you can just stop for one specific region by using
    self.eddystoneManager.stopEddystoneDiscoveryInRegion(domainRegion)
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}



// Eddystones

func eddystoneManager(manager: KTKEddystoneManager, didDiscoverEddystones eddystones: Set<KTKEddystone>, inRegion region: KTKEddystoneRegion?) {

    if region == self.domainRegion {
        print("Hola")
    }

}

func eddystoneManager(manager: KTKEddystoneManager, didUpdateEddystone eddystone: KTKEddystone, withFrame frameType: KTKEddystoneFrameType) {

}

func eddystoneManagerDidFailToStartDiscovery(manager: KTKEddystoneManager, withError error: NSError?) {
    print(error?.localizedDescription)
}

}

Not getting beacon information in "didRangeBeacons"

I have added SDK & code as per kontakt.io doc and also getting call in the method "didRangeBeacons" but getting the empty array of beacons.

This is how I did the setup:

// Initiate Beacon Manager
self.beaconManager = [[KTKBeaconManager alloc] initWithDelegate:self];

// Request Location Authorization
[self.beaconManager requestLocationAlwaysAuthorization];

// Kontakt.io proximity UUID
NSUUID *proximityUUID = [[NSUUID alloc] initWithUUIDString:@"f7826da6-4fa2-4e98-8024-bc5b71e0893e"];

// Create region instance
`self.region = [[KTKBeaconRegion alloc] initWithProximityUUID: proximityUUID identifier:@"identifier"];`

// Start Monitoring
`[self.beaconManager startMonitoringForRegion:self.region];`

// You can also start ranging ...

[self.beaconManager startRangingBeaconsInRegion:self.region];

Now call comes to "didRangeBeacons" method but beacon array is just empty.

Am I missed out anything here? Please let me know.

discovering set to true if stopDevicesDiscovery() is called.

I have instantiated KTKDevicesManager in my ViewController.

private var deviceManager: KTKDevicesManager!

In the function viewWillAppear() I start the device discovery

if deviceManager.discovering {
    return
}

deviceManager.startDevicesDiscoveryWithInterval(2)

and in the viewWillDisappear() function it stop it again.

This works without problems. But if I enter the ViewController a second time, the deivceManager.discovering Bool is true.

This should be false.

Is this a bug in the SDK version 1.2.2? Or did I forget something?

I have also created a demo project to reproduce the problem:

github.com/patricks/kontaktio_discovery_problem/

iOS Delegate Callbacks

Hi,

I'd like to ask whether or not the iOS SDK supports callbacks for when an Eddystone device is "lost".
In the Android SDK we get discovered, updated, and lost callbacks. Is this supported in iOS?

Lastly, for the updated callback, since this returns only a single Eddystone device, won't this method be called too many times especially if we poll a beacon every second?

Undefined symbols for architecture arm64

I use pods

pod 'KontaktSDK', '~> 1.1.3'

The Architectures settings on my project are:
$(ARCHS_STANDARD)
And valid architectures are:
arm64 armv7 armv7s

But i received this error:

Undefined symbols for architecture arm64: "_OBJC_CLASS_$_KTKBluetoothManager", referenced from: type metadata accessor for __ObjC.KTKBluetoothManager in AppDelegate.o "_OBJC_CLASS_$_KTKBeaconDevice", referenced from: Redar.AppDelegate.bluetoothManager (__ObjC.KTKBluetoothManager!, didChangeDevices : Swift.Set<__ObjC.NSObject>!) -> () in AppDelegate.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Thank you for you help!

Monitored regions nil

While ranging beacons work, region monitoring doesn't.

The code is unchanged from the Quickstart guide:

NSUUID *proximityUUID = [[NSUUID alloc] initWithUUIDString:uuid];

// Create region instance
KTKBeaconRegion *region = [[KTKBeaconRegion alloc] initWithProximityUUID:proximityUUID identifier:identifier];

// Start Monitoring
[self.beaconManager startMonitoringForRegion:region];

This delegate method is called with a nil region.

- (void)beaconManager:(KTKBeaconManager *)manager didStartMonitoringForRegion:(__kindof KTKBeaconRegion *)region

If I later log [self.beaconManager monitoredRegions] I also get nil.

I'm using KontaktSDK 1.0.5, and an iPhone 6s iOS 9.1. I'm testing with three beacons (iBeacon profile).

See major and minor og KTKNearbyDevice

Hello

How do you see the major and minor of a nearby device?
I see with how I configurate new major and minor for it.
But I want to know how do I see the Major and Minor of a iBeacon?

Get a KTKDevice UUID, major and minor

Hello

I'm trying to get some iBeacon devices from the Kontakt.io Cloud. I'm using the KTKCloudClient to get the objects, but I just realized that the KTKDevice model doesn't have properties for UUID, major and minor. So how do I get the iBeacon properties from the CloudClient?

KTKDevicesManagerDelegate Nullability

In KTKDevicesManager's didDiscoverDevices method, devices is marked _Nullable. The documentation does not explain why this parameter could be nil. That is, it is unclear why didDiscoverDevices would ever be called without discovered devices.

Similarly, the devicesManagerDidFailToStartDiscovery:withError: method marks error _Nullable. The documentation does not specify the circumstances under which this method would be called with a nil error parameter.

The use cases of both of these methods imply to me that the aforementioned parameters should never be nil. If that is true, they should be marked _Nonnull. If there are cases that I am overlooking, then the documentation should be updated to explain those cases.

Error when uploading app with new iOS sdk

I installed the new kontakt iOS sdk (Version: 1.0.4) as it's explained in the quick start guide.

I wrote code to detect my eddystone. In foreground and in background, it's ok :-)
I created an archive of my target => ok.

But when I try to upload this archive to the App Store, I see errors messages like on the screenshot.
capture d ecran 2016-02-10 a 10 22 25

Can you please tell me what I'm doing wrong ?

Thanks for your help

beacons detection problem with iOS7

Hello Team,
I want to support iOS7 and I wrote apple generic code for it.
Now, The problem is that, out beacons are discovering with iOS7 device.

Please give me some help link here!!

Thank you

iOS 9 Inquiry

Hey there,

I am working on an iOS implementation of our Android app, which will be targeting iOS 9+. My question for you is will the latest Kontakt iOS SDK work for iOS 9+? It mentions support for iOS 8 at the moment.

Thanks!
Lucas

Why is connection to beacons necessary for Kontakt.io specific data like uniqueId?

In the android version of the SDK, Kontakt.io specific fields like uniqueId, batteryLevel etc. are sent alongside the iBeacon specific fields like uuid, major, minor, accuracy etc. in the onIBeaconsUpdated event without a need to start a connection to the beacon (which requires the device to be connected to the internet) for the Kontakt.io specific fields.

In the iOS version, when I want to receive e.g. the uniqueId AND the uuid of the beacon, I have to start a KTKDeviceConnection which requires an internet connection of the device and is more power consuming. Why is this necessary on iOS and not necessary on Android?

This seems to be an issue with quite some people since the issues #19 , #20 and #15 which I looked at are related to this question.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.