loup-v / beacons

Flutter beacons plugin for Android and iOS.
Apache License 2.0
78 stars 54 forks source link

Unregister ActivityLifecycleCallbacks #16

Open GabrieleVolpato opened 5 years ago

GabrieleVolpato commented 5 years ago

Any time the FlutterActivity registers for this plugin, the plugin itself registers to the ActivityLifecycleCallbacks. This is a problem because, if you close the FlutterActivity but not the application (by using the hardware back button, for instance), when you restart the activity, it registers again, causing a crash on the first onPause call. Since Flutter only uses one FlutterActivity, it's safe to unregister for the ActivityLifecycleCallbacks when it gets destroyed.

Steps to reproduce the problem:

lchinke commented 5 years ago

This is related to https://github.com/flutter/flutter/issues/20622

vinceramcesoliveros commented 5 years ago

Has anyone tested this out in iOS? I havent seen someone integrate other packages wih atlbeacon on iOS.

GabrieleVolpato commented 5 years ago

I did it, and it seems to be working as intended.

vinceramcesoliveros commented 5 years ago

Well, good to hear, because there are some packages(google_sign_in) that gives me an error 2 months ago.

I have a friend that has an iOS and macbook, I'll test it out later on.