import ExpoModulesCore

// this is an ExpoAppDelegateSubscriber subclass which allows us to hook into application(_:didFinishLaunchingWithOptions:)
// we read the appKey from Info.plist
public class ExpoMarigoldDelegate: ExpoAppDelegateSubscriber {
  public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
    do {
        // must be called before startEngine
        Marigold().setInAppNotificationsEnabled(false)

        let appKey = Bundle.main.object(forInfoDictionaryKey: "SAILTHRU_API_KEY") as! String
        try Marigold().startEngine(appKey, with: .noRequest)
    } catch {
        // Handle error
    }
    return true
  }
}