gpt4 book ai didi

ios - Firebase 插件无法在 IOS( ionic )上运行

转载 作者:行者123 更新时间:2023-12-01 16:12:17 26 4
gpt4 key购买 nike

我正在开发一个 Ionic 应用程序,但我在 IOS 应用程序和 Firebase/FCM 插件方面遇到了一些问题。

安卓应用与安装的以下插件完美配合:

ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated
npm install @ionic-native/fcm

至于 IOS应用我尝试了几个插件,但都没有工作:

Option 1:


ionic cordova plugin add cordova-plugin-fcm
npm install @ionic-native/fcm

该应用程序正在成功构建,但在 iPhone 上启动时失败。调试时,我收到此错误消息:
Terminating app due to uncaught exception 'com.firebase.core', reason: 'Configuration fails. It may be caused by an invalid GOOGLE_APP_ID in GoogleService-Info.plist or set in the customized options.'

Option 2:


ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated
npm install @ionic-native/fcm

使用此插件构建时,我在 xCode 中收到以下错误:
** ARCHIVE FAILED **


The following build commands failed:
CompileC /Users/walid/Library/Developer/Xcode/DerivedData/Nutripro-aabwvacmftjwnefthwnyidfyxswx/Build/Intermediates.noindex/ArchiveIntermediates/Nutripro/IntermediateBuildFilesPath/Nutripro.build/Release-iphoneos/Nutripro.build/Objects-normal/arm64/FCMPlugin.o /Users/walid/Documents/www/nutripro/platforms/ios/Nutripro/Plugins/cordova-plugin-fcm-with-dependecy-updated/FCMPlugin.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
xcodebuild: Command failed with exit code 65
[ERROR] An error occurred while running subprocess cordova.

我搜索了很多以找到解决此错误的方法,但找不到任何解决方案。

Option 3:


ionic cordova plugin add cordova-plugin-firebase
npm install @ionic-native/firebase

我可以使用这个插件成功构建一个应用程序,我可以在我的 iPhone 上运行它并生成一个 token ,我可以正常接收推送通知。
但是这里的问题是在将应用程序上传到 App Store 时发生的
  • 在 xCode 上存档成功
  • 分发/上传应用程序时,我收到以下错误:
  • ERROR ITMS-90771: "Missing Info.plist value. The Info.plist key 'BGTaskSchedulerPermittedIdentifiers' must contain a list of identifiers used to submit and handle tasks when 'UIBackgroundModes' has a value of 'processing'. For more information, refer to the Information Property List Key Reference at https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Introduction/Introduction.html."

    我在网上搜索了一下,发现 this article声明我必须将以下内容添加到我的 info.plist 文件中
    <key>BGTaskSchedulerPermittedIdentifiers</key>
    <array>
    <string>com.nutripro.mobile</string>
    </array>

    添加它并重新提交我的申请后,我收到了来自 Apple 的电子邮件
    Dear Developer,

    We identified one or more issues with a recent delivery for your app, "NutriPro" 1.1.11 (1.1.11). Please correct the following issues, then upload again.

    ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).

    Best regards,

    The App Store Team

    如果我删除插件,则该应用程序正在上传和批准。

    奇怪的是,@ionic-native/firebase 上的文档说他们摆脱了 UIWebView 并正在使用 WKWebView

    N.B:在每个选项之后,我正在卸载已安装的包和节点模块,并且正在删除平台文件夹。

    你们知道我该如何解决这个问题吗?我一直在尝试找出解决方案将近 1 周,但我找不到任何解决方案!

    最佳答案

    经过大量研究和不成功的尝试,我找到了解决方案。

    对于 Android,我使用的是 fcm-with-dependecy-updated

    ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated
    npm install @ionic-native/fcm

    对于IOS,我使用 firebase-messaging
    ionic cordova plugin add cordova-plugin-firebase-messaging
    npm install @ionic-native/firebase-messaging

    关于ios - Firebase 插件无法在 IOS( ionic )上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61951838/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com