Tutorial for the SDK

Can some one make a tutorial for IOS on how can we use the SDK please.

the examples that we have is using a UITableVIew and we need to make the app to scan for the beacons in the background and when it found one it should send a notification and load a url.

thanx

Search the tutorial about running in the background.
use startRangingBeaconsInRegion or startMonitoringForRegion to scan beacons

Hi Rose, thank you for your replay, where can i find this tutorial ? or you mean the GitHub example ?

this is my code :

#import "ViewController.h"
#import "AppDelegate.h"
#import "ABTransmitters.h"

@interface ViewController ()

@property (nonatomic, strong) ABBeaconManager *beaconManager;
@property (strong, nonatomic) ABBeaconRegion *region;


@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    
    self.beaconManager = [[ABBeaconManager alloc] init];
    _beaconManager.delegate = self;
    
    [self startMonitoringForRegion];
    
 
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)startMonitoringForRegion
{
    ABTransmitters *tran = [ABTransmitters sharedTransmitters];
    [[tran transmitters] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        NSUUID *proximityUUID = [[NSUUID alloc] initWithUUIDString:obj[@"uuid"]];
        NSString *regionIdentifier = obj[@"uuid"];
        
        ABBeaconRegion *beaconRegion;
        beaconRegion = [[ABBeaconRegion alloc] initWithProximityUUID:proximityUUID
                                                          identifier:regionIdentifier];
        beaconRegion.notifyOnEntry = YES;
        beaconRegion.notifyOnExit = YES;
        beaconRegion.notifyEntryStateOnDisplay = YES;
        [_beaconManager startRangingBeaconsInRegion:beaconRegion];
       
        NSLog(@"UUID : %@",beaconRegion);
    }];

}


-(void)beaconManager:(ABBeaconManager *)manager didEnterRegion:(ABBeaconRegion *)region
{
    NSLog(@"From App Delegate1");
    UILocalNotification *notification = [[UILocalNotification alloc] init];
    notification.alertBody = @"Enter monitoring region";
    notification.soundName = UILocalNotificationDefaultSoundName;
    [[UIApplication sharedApplication] presentLocalNotificationNow:notification];
    [self runWebView];
}

-(void)runWebView
{
    NSString *urlstring = [NSString stringWithFormat:@"http://demo.phillipecw.com/azzam/test.php?uuid=%@",_beacon.proximityUUID.UUIDString];
    
    
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlstring ]];
    
    
    NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
    
    NSError *jsonParsingError = nil;
    NSArray *publicTimeline = [NSJSONSerialization JSONObjectWithData:response options:0 error:&jsonParsingError];
    NSString *jsonString = [publicTimeline objectAtIndex:0];
    
    NSURL *url = [NSURL URLWithString:jsonString];
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
    [self.webView loadRequest:requestObj];
    
    

}


@end

This is the way how you scan the beacons. you can use startMonitoringForRegion to scan beacons in the background, but you only can scan no more than 20 regions.if you want to scan more regions, you need make your app run in the background, which is out of the range of our SDK.