class QQCommon {
	constructor () {

	}

	static getInstance() {
        if (!QQCommon.instance && CC_QQPLAY) {
            QQCommon.instance = new QQCommon();
        }
        return QQCommon.instance;
	}
	
	ShareAppMessage(data, callback) {
		BK.Share.share({
			qqImgUrl: data.imgurlData,
			summary: data.title,
			isToFriend: true,
			extendInfo: data.extendInfo || '',
			success: function(res) {
				BK.Console.log('分享成功', res.code, JSON.stringify(res.data));

				if(res.data.ret == 0) {
					callback && callback(res.data)
				}
			},
			fail: function(res) {
				BK.Console.log('分享失败', res.code, JSON.stringify(res.msg));
			},
			complete: function(res) {
				BK.Console.log('分享完成，不论成功失败');
			}
		})
	}

	GetSystemInfo() {
		var systemInfo = BK.getSystemInfoSync();
		return systemInfo;
	}
}

module.exports = QQCommon.getInstance();
