以下是从 Firebase 获取的常见 XML/Plist 示例:
我为获取此文件所做的工作:
1- 为 Android 实施谷歌分析并在谷歌 API 控制台中创建一个项目,然后
2- 实施 Google Analytics for iOS 链接到同一个 Google API 项目,然后
3- 基于相同的 Google API 项目创建 Firebase 项目。
适用于 Android 的 XML 配置文件:
{
"project_info": {
"project_number": "MYAPP_PROJECT_NUMBER",
"firebase_url": "MYAPP_FIREBASE_URL",
"project_id": "MYAPP_PROJECT_ID",
"storage_bucket": "MYAPP_STORAGE_BUCKET"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "MYAPP_MOBILESDK_APP_ID",
"android_client_info": {
"package_name": "MYAPP_PACKAGE_NAME"
}
},
"oauth_client": [
{
"client_id": "MYAPP_CLIENT_ID_STARTING_WITH_PROJECT_NUMBER_1",
"client_type": 1,
"android_info": {
"package_name": "MYAPP_PACKAGE_NAME",
"certificate_hash": "MYAPP_CERT_HASH"
}
},
{
"client_id": "MYAPP_CLIENT_ID_STARTING_WITH_PROJECT_NUMBER_2_DIFFERENT_THAN_OAUTH_CLIENT_ID_ABOVE",
"client_type": 3
}
],
"api_key": [
{
"current_key": "MYAPP_CURRENT_KEY"
}
],
"services": {
"analytics_service": {
"status": 2,
"analytics_property": {
"tracking_id": "MYAPP_TRACKING_ID_FROM_GOOGLE_ANALYTICS"
}
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
iOS 的 Plist 配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AD_UNIT_ID_FOR_BANNER_TEST</key>
<string>MYAPP_AD_UNIT_ID_FOR_BANNER_TEST</string>
<key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>
<string>MYAPP_AD_UNIT_ID_FOR_INTERSTITIAL_TEST</string>
<key>TRACKING_ID</key>
<string>MYAPP_TRACKING_ID</string>
<key>CLIENT_ID</key>
<string>MYAPP_CLIENT_ID</string>
<key>REVERSED_CLIENT_ID</key>
<string>MYAPP_REVERSED_CLIENT_ID</string>
<key>API_KEY</key>
<string>MYAPP_CURRENT_KEY</string>
<key>GCM_SENDER_ID</key>
<string>MYAPP_PROJECT_NUMBER</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>MYAPP_BUNDLE_ID</string>
<key>PROJECT_ID</key>
<string>MYAPP_PROJECT_ID</string>
<key>STORAGE_BUCKET</key>
<string>MYAPP_STORAGE_BUCKET</string>
<key>IS_ADS_ENABLED</key>
<true/>
<key>IS_ANALYTICS_ENABLED</key>
<true/>
<key>IS_APPINVITE_ENABLED</key>
<false/>
<key>IS_GCM_ENABLED</key>
<true/>
<key>IS_SIGNIN_ENABLED</key>
<true/>
<key>GOOGLE_APP_ID</key>
<string>MYAPP_MOBILESDK_APP_ID</string>
<key>DATABASE_URL</key>
<string>MYAPP_FIREBASE_URL</string>
</dict>
</plist>