JAALEE Beacon SDK not working - ios

I am using iBeacons manufactured by JAALEE, Liam trying get list go iBeacons near to me but i am not able to get it
// JLEConfigBeacon.m
// Example
//
// Created by jaalee on 14-4-23.
// Copyright (c) 2014年 jaalee. All rights reserved.
//
#import "BeaconList.h"
#import "JLEBeaconDevice.h"
#import "SWRevealViewController.h"
#import "PetFinderViewController.h"
#import "AdvertisementViewController.h"
#interface BeaconList ()
#property (nonatomic) NSMutableArray *mBeaconDeviceList;
#property (nonatomic) JLEBeaconConfigManager *mBeaconConfigManager;
#property (nonatomic) JLEBeaconDevice *mBeaconDevice;
#end
#implementation BeaconList
#synthesize destinationName;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
_mBeaconDeviceList = [[NSMutableArray alloc] init];
_mBeaconConfigManager = [[JLEBeaconConfigManager alloc] init];
_mBeaconConfigManager.delegate = self;
_sidebarButton.target = self.revealViewController;
_sidebarButton.action = #selector(revealToggle:);
if ([[self title] isEqualToString:#"Beacon List"]) {
[self setTitle:#"Pet Finder"];
}
}
-(void)viewDidAppear:(BOOL)animated
{
[_mBeaconDeviceList removeAllObjects];
[self.mTableView reloadData];
[_mBeaconConfigManager startJaaleeBeaconsDiscovery];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
#pragma mark - JLEBeaconConfigManager delegate
- (void)beaconConfigManager:(JLEBeaconConfigManager *)manager didDiscoverBeacon:(JLEBeaconDevice *)beacon RSSI:(NSNumber *)RSSI
{
for (int i = 0; i < _mBeaconDeviceList.count; i++) {
JLEBeaconDevice *temp = [_mBeaconDeviceList objectAtIndex:i];
if (temp == beacon) {
return;
}
}
[_mBeaconDeviceList addObject:beacon];
[self.mTableView reloadData];
}
#end
Dont know how to resolve this. i want to use this to get Proximity UUID from detected beacon.
GIT LINK OF SDK

If you ibeacon do not have any additional features as estimote ibeacons(accelerometers and temperature sensor), you must not use SDK.
Look at this tutorial for iOS 8 and change the UUID.
http://ibeaconmodules.us/blogs/news/14279747-tutorial-ibeacon-app-development-with-corelocation-on-apple-ios-7-8

Related

Rotation IOS Simulator vs Reality

I am having issues with Storyboards AutoRotation and the iPhone. I've put together a VERY simple project with 3 view controllers which I uploaded to gitHub to demonstrate the issue
I've tested this on the following devices:
IPAD 3
IPHONE 5s
Simulator (iphone / ipad)
Everything seems to work perfectly on the iPad & Simulator (Iphone/Ipad) but when I run it on the 5s it does not rotate correctly.
On the iPhone it will rotate the alert view but not the view controller it appears
On the simulator this is the result (which looks correct)
Code for sample project can be found at:
https://github.com/jlss/RotationIssues
I am happy and willing to try ANY suggestions anybody has.
Things of Note: (I am using the call objc_msgSend([UIDevice currentDevice], #selector(setOrientation:), UIInterfaceOrientationLandscapeLeft); ) but as far as I can tell this should be ok.
RotationControlledViewController.m
//
// RotationControlledViewController.m
// ASGAARD
//
// Created by Jeff Stein on 2/16/14.
// Copyright (c) 2014 Jeff Stein. All rights reserved.
//
#import "RotationControlledViewController.h"
#interface RotationControlledViewController ()
#end
#implementation RotationControlledViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(BOOL)shouldAutorotate
{
BOOL ret = [[self.viewControllers lastObject] shouldAutorotate];
// NSLog(#"--Auto Roatate Reported %d", ret);
return ret;
}
-(NSUInteger)supportedInterfaceOrientations
{
NSUInteger ret = [[self.viewControllers lastObject] supportedInterfaceOrientations];
// NSLog(#"--supportedInterfaceOrientations: %d", ret);
return ret;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
UIInterfaceOrientation ret = [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
// NSLog(#"--preferredInterfaceOrientationForPresentation: %ld",ret);
return ret;
}
#end
PortraitViewController.m
//
// PortraitViewController.m
// ASGAARD
//
// Created by Jeff Stein on 2/16/14.
// Copyright (c) 2014 Jeff Stein. All rights reserved.
//
#import "PortraitViewController.h"
#import "objc/message.h"
#interface PortraitViewController ()
#end
#implementation PortraitViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
objc_msgSend([UIDevice currentDevice], #selector(setOrientation:), UIInterfaceOrientationPortrait);
}
- (void)viewDidAppear:(BOOL)animated {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#"Portrait Alert" message:#"This is portrait view" delegate:self cancelButtonTitle:#"ok" otherButtonTitles:nil];
[alert show];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationPortrait;
}
#end
LandscapeViewController
//
// LandscapeViewController.m
// ASGAARD
//
// Created by Jeff Stein on 2/16/14.
// Copyright (c) 2014 Jeff Stein. All rights reserved.
//
#import "LandscapeViewController.h"
#import "objc/message.h"
#interface LandscapeViewController ()
#end
#implementation LandscapeViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
objc_msgSend([UIDevice currentDevice], #selector(setOrientation:), UIInterfaceOrientationLandscapeLeft);
NSLog(#"Issuing a rotation message (hopefully");
}
- (void)viewDidAppear:(BOOL)animated {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#"Landscape Alert" message:#"This is landscape view" delegate:self cancelButtonTitle:#"ok" otherButtonTitles:nil];
[alert show];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeLeft;
}
#end
And lastly i have a simple storyboard with:
Unfortunately you cannot do this if you are using push segues. You have to use modal.

Pass parse.com cloud backend data from TableView to DetailViewController

I have a problem with my parse backend app.
On Parse I have a Class like this: name (string) , imageFile (File) and help (string).
Everything works great except the Images. When I tap on a cell, I am pushed to the DetailViewController the 2 Strings appear but the ImageView (PFImageView) is empty. The ImageView does not show my Images.
Maybe there is a problem with passing the image file?
Here is my code:
MechanikViewController.h:
#import <UIKit/UIKit.h>
#import <Parse/Parse.h>
#interface MechanikViewController : PFQueryTableViewController
#end
MechanikViewController.m:
#import "MechanikViewController.h"
#import "MechanikDetailViewController.h"
#import "Mechanik.h"
#interface MechanikViewController ()
#end
#implementation MechanikViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
-(id)initWithCoder:(NSCoder *)aCoder
{
self = [super initWithCoder:aCoder];
if (self) {
self.parseClassName = #"Mechanik";
self.textKey = #"name";
self.pullToRefreshEnabled = YES;
self.paginationEnabled = NO;
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}
-(PFQuery *)queryForTable
{
PFQuery *query = [PFQuery queryWithClassName:self.parseClassName];
if ([self.objects count] == 0) {
query.cachePolicy = kPFCachePolicyCacheThenNetwork;
}
[query orderByAscending:#"name"];
return query;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object
{
static NSString *simpleTableIdentifier = #"MechanikCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
}
cell.textLabel.text = [object objectForKey:#"name"];
return cell;
}
- (void) objectsDidLoad:(NSError *)error
{
[super objectsDidLoad:error];
NSLog(#"error: %#", [error localizedDescription]);
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:#"showDetail"]) {
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
MechanikDetailViewController *destViewController = segue.destinationViewController;
PFObject *object = [self.objects objectAtIndex:indexPath.row];
Mechanik *mechanik = [[Mechanik alloc] init];
mechanik.name = [object objectForKey:#"name"];
mechanik.imageFile = [object objectForKey:#"imageFile"];
mechanik.help = [object objectForKey:#"help"];
destViewController.mechanik = mechanik;
}
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
#end
MechanikDetailViewController.h:
#import <UIKit/UIKit.h>
#import <Parse/Parse.h>
#import "Mechanik.h"
#interface MechanikDetailViewController : UIViewController
#property (weak, nonatomic) IBOutlet PFImageView *formelImage;
#property (weak, nonatomic) IBOutlet UILabel *helpLabel;
#property (nonatomic, strong) Mechanik *mechanik;
#end
MechanikDetailViewController.m:
#import "MechanikDetailViewController.h"
#interface MechanikDetailViewController ()
#end
#implementation MechanikDetailViewController
#synthesize formelImage;
#synthesize helpLabel;
#synthesize mechanik;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
self.title = mechanik.name;
self.helpLabel.text = mechanik.help;
self.formelImage.file = mechanik.imageFile;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
#end
Mechanik.h:
#import <Foundation/Foundation.h>
#import <Parse/Parse.h>
#interface Mechanik : NSObject
#property (nonatomic, strong) NSString *name;
#property (nonatomic, strong) PFFile *imageFile;
#property (nonatomic ,strong) NSString *help;
#end
Mechanik.m:
#import "Mechanik.h"
#implementation Mechanik
#synthesize name;
#synthesize imageFile;
#synthesize help;
#end
Please help me.
Create a PFObject in DetailViewController
#property (nonatomic, strong)PFObject *object
Pass a PFObject from master to detail
PFObject *object = [self.objects objectAtIndex:indexPath.row];
destViewController.object = object;
Set data in ViewDidAppear
pfImageView.imageFile = [object objectForKey:#"imageFile"];
[pfImageView loadInBackground];

When trying to segue, nothing happens

I have an app I am working on, and I am trying to have the logo on for a bit longer, and fade out/slide out/effect when it's done.
Here's my setup:
The Tab Bar controller is not letting me place an Image View inside it, so I created a view to have it on.
I am trying to have the logo stay on for a bit, fade out, then automatically switch the view (Segue) to the Tab Bar controller.
This is what I get out of it: http://youtu.be/l4jL0BfpR2k
So here's my code:
//
// BDNLogoViewController.m
// Bronydom Network
//
// Created by name on 10/1/13.
// Copyright (c) 2013 name. All rights reserved.
//
#import "BDNLogoViewController.h"
#import "BDNTabBarController.h"
#import "BDNFirstViewController.h"
#interface BDNLogoViewController ()
#end
#implementation BDNLogoViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
[UIView animateWithDuration:1 animations:^{
_imageview.alpha = 0;
}];
//BDNTabBarController *viewController = [[BDNTabBarController alloc] init];
//[self.navigationController pushViewController:viewController animated:YES];
(void)#selector(seguePerform:);
}
- (void)seguePerform:(id)sender
{
//BDNTabBarController *myNewVC = [[BDNTabBarController alloc] init];
// do any setup you need for myNewVC
[self performSegueWithIdentifier:#"open" sender:sender];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#end
Yes, "open" is defined as the segue id.
Do you guys have any ideas on how I could fix this?
To fix, add this
- (void) viewDidAppear:(BOOL)animated
{
[super viewDidAppear:YES];
[self performSegueWithIdentifier:#"open" sender:self];
}
Remove this from your code
(void)#selector(seguePerform:);
// and all other unnecessary segue stuff you had

cannot set the text of label in DetailViewController after passing data between different viewController

pass data from FirstViewController to DetailViewController. i can not set the text of label in DetailViewController; FirstViewController is a tableview and it is good.
i use method updateRowNumber to set the rowNumber . and in DetailViewController, i can use debugger to see the rowNumber is correct. but the label's text is not showed on the view.
anyone can help me out?
in my FirstViewController
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (dvController == nil)
{
DetailViewController *aController = [[DetailViewController alloc] initWithNibName:#"DetailViewController" bundle:nil];
self.dvController = aController;
[aController release];
}
[[self navigationController] pushViewController:dvController animated:YES];
[dvController updateRowNumber:indexPath.row];
}
in my DetailViewController.h
#import <UIKit/UIKit.h>
#interface DetailViewController : UIViewController
{
int rowNumber;
IBOutlet UILabel *message;
}
#property(readwrite) int rowNumber;
#property(nonatomic, retain) IBOutlet UILabel *message;
- (void) updateRowNumber:(int) theindex;
#end
in my DetailViewController.m
#import "DetailViewController.h"
#interface DetailViewController ()
#end
#implementation DetailViewController
#synthesize message, rowNumber;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void) updateRowNumber: (int) theindex
{
rowNumber = theindex + 1;
message.text = [NSString stringWithFormat:#"row %i was clicked", rowNumber];
}
- (void)dealloc
{
[message release];
[super dealloc];
}
- (void)viewDidLoad
{
message.text = [NSString stringWithFormat:#"row %i was clicked ", rowNumber];
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Do any additional setup after loading the view from its nib.
}
- (void)viewWillAppear:(BOOL)animated
{
//message.text = [NSString stringWithFormat:#"row %i was clicked ", rowNumber];
[super viewWillAppear: animated];
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear: animated];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#end
You'll need to learn how the view is loaded, the process is well described in the documentation
What happens is that the view and all the outlets are nil until the view is loaded, you can make sure it is loaded by calling self.view; before configuring the outlet at updateRowNumber:
Please also note, you are better to call [super viewDidLoad] in the beginning of the overridden viewDidLoad, it makes sense as you need to let UIViewContorller to do it's staff before you do some customized logic, the dealloc is different as you need to do your logic before the standard NSObject -dealloc fires. Hope it's understandable.

ios5 passing data from calloutAccessoryControlTapped to another controller

I am trying to send a nsmutablearray from one navigational embedded view controller to another viewcontroller after this method
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control{NSLog(#"tapped %# %d",view.annotation.title,[res count]);
gpDetailViewController *gpDetailView = [[gpDetailViewController alloc] init];
gpDetailView.title = #"Details";
gpDetailView.detailArray = res;
[self.navigationController pushViewController:gpDetailView animated:YES];
}
is executed.
Here is the interface and implementation files for gpDetailViewController.
//
// gpDetailViewController.h
// livewell prototype
//
// Created by MyOxygen Mobile on 02/05/2012.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
#interface gpDetailViewController : UIViewController{
NSMutableArray *detailArray;
}
#property (nonatomic,retain) NSMutableArray *detailArray;
#end
and gpDetailViewController.m
//
// gpDetailViewController.m
// livewell prototype
//
// Created by MyOxygen Mobile on 02/05/2012.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import "gpDetailViewController.h"
#interface gpDetailViewController ()
#end
#implementation gpDetailViewController
#synthesize detailArray;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
detailArray = [[NSMutableArray alloc]init];
NSLog(#"%#",[self.detailArray count]);
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
#end
I am getting a null value when i am trying to print the array elements size.
What could be the reason?
Instead of
NSLog(#"%#",[self.detailArray count]);
try this
NSLog(#"%d",[self.detailArray count]);
count is an integer, not a class

Resources