umair13adil / simple_beacons_flutter

A flutter plugin project to range & monitor iBeacons.
Apache License 2.0
35 stars 42 forks source link

Not working on ios #27

Closed yossefEl closed 3 years ago

yossefEl commented 3 years ago

@umair13adil Thanks a lot for this plugin! This plugin is working on android, but for some reasons it's not scanning on iOS I'm using the example app with a little change (I created a Beacon model class) the version I'm using : beacons_plugin: ^1.0.17 AppDelegate.swift

import UIKit
import Flutter
import CoreLocation

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {

    let locationManager = CLLocationManager()

    override func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {

        locationManager.requestAlwaysAuthorization()
        GeneratedPluginRegistrant.register(with: self)

        return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    }
}

the debug log

flutter: isRunning false
flutter: beacons_plugin: Region Added.
flutter: beacons_plugin: Region Added.
flutter: beacons_plugin: App will run in background? true
flutter: beacons_plugin: Started scanning Beacons.
flutter:  isRunning true

flutter doctor -v

[✓] Flutter (Channel stable, 1.22.1, on Mac OS X 10.15.3 19D76, locale en-MA)
    • Flutter version 1.22.1 at /Users/utilisateurq/development/flutter
    • Framework revision f30b7f4db9 (4 weeks ago), 2020-10-08 10:06:30 -0700
    • Engine revision 75bef9f6c8
    • Dart version 2.10.1

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/utilisateurq/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.10.0

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 48.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.48.0)
    • VS Code at /Users/utilisateurq/Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.14.1

[✓] Connected device (2 available)
    • iPhone (mobile)            • a2f032ec0e5b522be1861894f38cad48003ae2e3 • ios • iOS 12.4.5
    • iPhone 11 Pro Max (mobile) • 98648157-1169-425A-8B56-6B0AADF39480     • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-6
      (simulator)
yossefEl commented 3 years ago

@umair13adil can you please take a look here and thanks in advance!

umair13adil commented 3 years ago

@yossefEl Which beacons model are you using? Please share its details.

yossefEl commented 3 years ago

@umair13adil this is my code beacons plugin example gist

umair13adil commented 3 years ago

@yossefEl Does your beacon manufacturer supports iBeacon?

yossefEl commented 3 years ago

@umair13adil I forgot to mention that the button stucks in 'Stop scanning' and when I click nothing changed However, I'm using beacon_broadcast plugin to create virtual beacons so based on the documentation:

Android beacon will advertise as the AltBeacon manufactured by RadiusNetwork. You can change it with setLayout() and setManufacturerId() methods.

For iOS, beacon will advertise as an iBeacon, it can't be changed

umair13adil commented 3 years ago

@yossefEl I see, I will check it out, meanwhile can you please create a virtual beacon using this app: Beacon Simulator? Please let me know if that worked on the iPhone or not.

yossefEl commented 3 years ago

@umair13adil I already tested it with this app and it still not working if you want to take a look at my code I'll share it with you but I'm sure I configured properly the app!

yossefEl commented 3 years ago

Hi @umair13adil ! Is there any news please about the iOS version 🤔 Thanks