【问题标题】:Swift: Perfect Server: How to send Push Notification?Swift:完美服务器:如何发送推送通知?
【发布时间】:2017-02-16 16:28:12
【问题描述】:

我正在使用PerfectlySoft Perfect-Notifications 并尝试通过以下方式导入它:

.Package(
        url:"https://github.com/PerfectlySoft/Perfect-Notifications.git",
        majorVersion: 2)

但我总是收到以下错误:

Packages/PerfectNotifications-2.1.2/Sources/NotificationPusher.swift:278:8: error: value of type 'NetTCPSSL' has no member 'initializedCallback'

还有其他方法可以导入和使用吗?或者其他方式从 swift 服务器发送推送通知?

【问题讨论】:

    标签: push-notification perfect


    【解决方案1】:

    我前段时间遇到过这个问题,是包依赖顺序的问题,尝试新建一个新项目:

    mkdir test
    cd test
    swift package init
    

    现在编辑 package.swift,添加这个包

    import PackageDescription
    
    let package = Package(
        name: "test",
        dependencies: [ 
            .Package(url:"https://github.com/PerfectlySoft/Perfect-Notifications.git", majorVersion: 2)
        ]
    )
    

    现在你可以构建它了:

    swift build
    

    告诉我它是否适合你。

    【讨论】:

      【解决方案2】:

      您还可以查看我使用 Swift Perfect Server 和其他“完美”工具制作的简单推送服务器示例。它可以在安卓和iOS设备上发送推送,也有管理网页https://github.com/AlexShubin/SwiftPushServer

      【讨论】:

        猜你喜欢
        • 2017-09-07
        • 1970-01-01
        • 2014-07-11
        • 2019-10-30
        • 1970-01-01
        • 2017-05-26
        • 2016-09-27
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多