export function isIos() {
    return navigator.userAgent.match(/iphone|ipod|ipad/gi)
}


export function popWindow() {
    try {
        window["my"].postMessage({type: "popWindow"});
    } catch (e) {
        console.log(e)
    }

    mdEvent({
        pageView: "leaveGame",
    });

}

export const gameId = "2171020205274922";


export function mdEvent(options) {
    const {pageView, clickName, additionalInfo} = options;

    try {
        window["my"].postMessage({
            type: "tngdMPEventTagging",
            pageView: `${pageView}-${gameId}`,
            clickName: clickName,
            additionalInfo: additionalInfo,
        });
    } catch (e) {
        console.log(e)
    }
}