/**
 * 推送桥接（当前关闭原生 gzfuts-fcm，避免 iOS 启动弹通知授权）。
 *
 * 恢复步骤：
 * 1. common/config/runtime-manifest.js → UI_FLAGS.nativePushEnabled = true
 * 2. _disabled_native/gzfuts-fcm 移回 uni_modules/gzfuts-fcm
 * 3. 用 features/push/push-bridge.native.js 覆盖本文件（或按 native 版合并）
 * 4. 重打自定义调试基座 / 正式包
 */
import appSettings from '@/core/config/app-settings'

function createNoopPushBridge() {
	const noop = () => {}
	return {
		boot: noop,
		handleNativeEvent: noop,
		onForegroundMessage: noop,
		pullNativeTokens: noop,
		queueServerReport: noop,
		uploadTokens: noop,
		retryAndroidInit: noop
	}
}

export function createPushBridge() {
	if (!appSettings.nativePushEnabled) {
		return createNoopPushBridge()
	}
	console.warn('[push-bridge] nativePushEnabled 为 true，但未集成 gzfuts-fcm，请将插件移回 uni_modules 并恢复 push-bridge.native.js')
	return createNoopPushBridge()
}
