首页 > 解决方案 > 如何使用 Swift 4.2 创建应用商店应用更新通知机制?

问题描述

我的场景,我正在尝试notification为我的应用程序实施应用程序更新。我试过SirenPod 但它正在显示no module found。请给我一个解决方案或替代想法。

警笛吊舱

警笛链接

在这里,我No Module Found也正在安装 pod。

Import Siren // No module found 

标签: iosswiftpush-notification

解决方案


你打开你的.xcworkspace.xcodeproj?如果您不小心打开了.xcodeproj.


按照 cocoapods 的Siren 安装说明,您将在“终端”窗口中执行以下操作。具体来说,如果您尚未创建Podfile

$ cd MyApp
$ pod init

你可以编辑你的Podfile,比如:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'MyApp' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for MyApp
  pod 'Siren'
end

然后你可以从“终端”安装你的 Cocoapods:

$ pod install
Analyzing dependencies
Downloading dependencies
Installing Siren (4.2.1)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `MyApp.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

[!] Automatically assigning platform `ios` with version `12.1` on target `MyApp` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

注意警告:

请关闭所有当前的 Xcode 会话并MyApp.xcworkspace从现在开始用于此项目。

现在打开工作区,而不是.xcodeproj

$ open MyApp.xcworkspace

推荐阅读