This PR is a workaround fix for the Application Installed events not firing when setting the config via dart and not via a file (info.plist), issue #26.
Fix Details:
Due to the method sequence and the way the native library works, described here, we need to either call the dart code Segment.config() in didFinishLaunchingWithOptions(), similar to how the configFromFile works or send the Application Installed event when we call the dart code Segment.config().
As I dont think there is an easy way to call Segment.config() in the native code didFinishLaunchingWithOptions(), I have instead opted to add a similar method to the way the native code works when sending Application Installed / Application Updated events, this code is here.
This will make use of the same NSUserDefaults keys as the native library and manually send the events.
This maybe isn't the best way to explain this fix so happy to chat. Also keep up the good work 💙.
Context
This PR is a workaround fix for the
Application Installed
events not firing when setting the config via dart and not via a file (info.plist
), issue #26.Fix Details:
Due to the method sequence and the way the native library works, described here, we need to either call the dart code
Segment.config()
indidFinishLaunchingWithOptions()
, similar to how the configFromFile works or send theApplication Installed
event when we call the dart codeSegment.config()
.As I dont think there is an easy way to call
Segment.config()
in the native codedidFinishLaunchingWithOptions()
, I have instead opted to add a similar method to the way the native code works when sendingApplication Installed
/Application Updated
events, this code is here.This will make use of the same
NSUserDefaults
keys as the native library and manually send the events.This maybe isn't the best way to explain this fix so happy to chat. Also keep up the good work 💙.