import { EampluginCommon } from './common';
import { Application as app} from "@nativescript/core";

var eam = EAMAppDelegate;
export class Eamplugin extends EampluginCommon {

    public launchEAM() {
        console.log('launch eam');
        try {
        const  vc = EAMLoginViewController.new();
        vc.modalPresentationStyle = UIModalPresentationStyle.FullScreen;
        app.ios.rootController.presentViewControllerAnimatedCompletion(vc,true,null);

        } catch (error) {
            alert(JSON.stringify(error));
        }
       
    }
    public stopEAM() {
        console.log('stop eam'); 
        app.ios.rootController.dismissViewControllerAnimated(true, null);
       
    }
}


    export function getInfo() {
        return EAMAppDelegate.prototype
    }

    export class CustomDelegate extends EAMAppDelegate  {} 

    export { eam };