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

IOS adapter not set in BLEExplorer demo #72

Open
phice opened this issue Jan 31, 2018 · 2 comments
Open

IOS adapter not set in BLEExplorer demo #72

phice opened this issue Jan 31, 2018 · 2 comments

Comments

@phice
Copy link

phice commented Jan 31, 2018

I've managed to get it work with Android, with IOS I get a null reference error because in the Appdelegate the adapter is not set (like in android):

App.SetAdapter(new Robotics.Mobile.Core.Bluetooth.LE.Adapter());

how can I fix it?

@henrikberg
Copy link

I added SetAdaptor() in AppDelegate.cs.

     public override bool FinishedLaunching(UIApplication app, NSDictionary options)
     {
         global::Xamarin.Forms.Forms.Init();
  •        App.SetAdapter(Adapter.Current);
           LoadApplication(new App());
           return base.FinishedLaunching(app, options);
       }
    

Today (2020) in iOS you also need to add some lines to info.plist

<key>NSBluetoothAlwaysUsageDescription</key>
<string>Connection to ... require Bluetooth. Please accept the connection.</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Connection to ... require Bluetooth. Please accept the connection.</string>

After that the demo worked.

@CONSISSFBanuelos
Copy link

CONSISSFBanuelos commented Jun 18, 2020

using Robotics.Mobile.Core.Bluetooth.LE;

in AppDelegate.cs.

making reference and complementing the solution of: @henrikberg(up)

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

3 participants