Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very Long Connection Times on iPad Pro #39

Open
duffek opened this issue Sep 2, 2017 · 0 comments
Open

Very Long Connection Times on iPad Pro #39

duffek opened this issue Sep 2, 2017 · 0 comments

Comments

@duffek
Copy link

duffek commented Sep 2, 2017

When trying to connect to a bean on the iPad pro I'm seeing VERY long connect times. As in 3-4 minutes. On iPhone it is an instant connection. This did not used to happen until I updated the SDK. I have the pod file using the latest version of the SDK (3.0.6 I believe).

UPDATE: This is not an issue on 3.0.1 and starts happening right after any update. If you are having connectivity issues on iPad connectivity then I suggest installing pod 'Bean-iOS-OSX-SDK', '3.0.1'

You can see my example code here:

    //
    //  ViewController.m
    //  Test
    //
    //  Created by David Nelson on 9/1/17.
    //  Copyright © 2017 Duffek Mobile. All rights reserved.
    //

    #import "ViewController.h"

    @interface ViewController ()

    @property (nonatomic, retain) PTDBeanManager *beanManager;
    @property (nonatomic, retain) PTDBean *testBean;
    @property (weak, nonatomic) IBOutlet UILabel *beanLabel;



    @end

    @implementation ViewController
    @synthesize beanManager, testBean, beanLabel;

    - (void)viewDidLoad {
        [super viewDidLoad];
        // Do any additional setup after loading the view, typically from a nib.
        
        beanManager = [[PTDBeanManager alloc] initWithDelegate:self];
    }


    #pragma mark - BeanManagerDelegate Callbacks

    - (void) beanManager:(PTDBeanManager *)beanManager didDiscoverBean:(PTDBean *)bean error:(NSError *)error
    {
        NSLog(@"Discovered a bean: %@ id: %@", bean.name, bean.identifier.UUIDString);
        testBean = bean;
        [beanLabel setText:[NSString stringWithFormat:@"Bean Name: %@", testBean.name]];
        
        
        if (error)
        {
            NSLog(@"Error discovering bean: %@", [error description]);
            return;
        }
    }

    - (void)beanManagerDidUpdateState:(PTDBeanManager *)manager
    {
        if(manager.state == BeanManagerState_PoweredOn)
        {
            // if we're on, scan for advertisting beans
            NSError* scanError;
            [manager startScanningForBeans_error:&scanError];
            if (scanError)
            {
                NSLog(@"%@", [scanError localizedDescription]);
            }
        }
        else if (manager.state == BeanManagerState_PoweredOff)
        {
            return;
        }
    }

    -(void) beanManager:(PTDBeanManager *) beanManager didConnectBean:(PTDBean *)bean error:(NSError *)error
    {
        NSLog(@"Did connect called!");
        if (error)
        {
            NSLog(@"Did connect error: %@", error.localizedDescription);
            return;
        }
        
    }

    -(void) beanManager:(PTDBeanManager *)beanManager didDisconnectBean:(PTDBean *)bean error:(NSError *)error
    {
        NSLog(@"Disconnected...");
    }

    - (IBAction)testPressed:(id)sender {
        NSLog(@"Trying to connect to: %@", testBean.name);
        
        NSError *error;
        [beanManager connectToBean:testBean error:&error];
        if (error != nil) {
            NSLog(@"error: %@", error.localizedDescription);
        }
        
    }

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

Verified on iPhone that it connects. iPad it hangs for about 5-6 minutes before it will connect.

pull bot pushed a commit to nazt/Bean-iOS-OSX-SDK that referenced this issue Nov 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant