我目前正在开发一个应用程序使用Nativescript。
对于本地模拟器上的Firebase,一切都很好,但是当我在iPhone上测试应用程序时,会得到以下错误
CONSOLE LOG file:///app/vendor.js:2172:24: Error in firebase.login: ReferenceError: Can't find variable: FIRAuth我想这可能与我初始化Firebase的位置有关,所以我将firebase.init()从app.models.ts移到了第一个视图中,就像在其他论坛文章中看到的那样。
我真的很困惑,为什么这是完美地工作在模拟器上,而不是在我的设备上。
如果有人能给我一点启示那就太棒了。
Stack:
iPhone SE,
Nativescript (Angular)
Firebase
nativescript-plugin-firebase如果你需要更多的信息,请不要犹豫。
GoogleService-info.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>CLIENT_ID</key>
<string>xxxxxxxxx.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.xxxxxxxxxxxx</string>
<key>API_KEY</key>
<string>xxxxxxxxxxxxxxxxxxxxxxxxxxx</string>
<key>GCM_SENDER_ID</key>
<string>xxxxxxxxx</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>org.nativescript.xxxxxxxxx</string>
<key>PROJECT_ID</key>
<string>xxxxxxxx</string>
<key>STORAGE_BUCKET</key>
<string>xxxxxxxx.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<false></false>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:xxxxxxxxx:ios:xxxxxxxxx</string>
<key>DATABASE_URL</key>
<string>https://xxxxxxxxx.firebaseio.com</string>
</dict>
</plist>firebase.nativescript.json
{
"external_push_client_only": false,
"using_ios": true,
"using_android": true,
"firestore": true,
"realtimedb": true,
"authentication": true,
"remote_config": false,
"performance_monitoring": false,
"messaging": false,
"in_app_messaging": false,
"crashlytics": false,
"storage": true,
"functions": false,
"facebook_auth": false,
"google_auth": false,
"admob": false,
"dynamic_links": false,
"ml_kit": false
}发布于 2019-08-26 22:41:43
如果使用nativescript-plugin-firebase,似乎无法在物理设备上预览。
您将得到以下错误:
Plugin nativescript-plugin-firebase is not included in preview app on device 3CDExxxx-xxxx-xxxx-xxxx-960121C3xxxx and will not work.应用程序将运行,但您将无法使用任何Firebase模块。
我希望这对有同样问题的人有帮助。
如果有人知道附近的工作,不需要购买许可证从苹果进行测试,请在评论中让我知道。
https://stackoverflow.com/questions/57664098
复制相似问题