Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

sent successfully, but can't get any push message.Lubuntu 16.04 #42

Open
carlhung opened this issue Apr 27, 2017 · 2 comments
Open

sent successfully, but can't get any push message.Lubuntu 16.04 #42

carlhung opened this issue Apr 27, 2017 · 2 comments

Comments

@carlhung
Copy link

carlhung commented Apr 27, 2017

I am running Lubuntu 16.04 on virtual machine.
I reinstall whole Lubuntu again. I still got the same result.
actually, I reinstalled lubuntu, swift 3.1.1, libcurl4-openssl-dev.
then, i compiled the project. and let the module scanned the version of curl and let it update.
I checked the result. sent successfully, but can't get any push message.

    guard var opt = try? Options(topic: "message.share", certPath: "/home/carl/swift/time/pem/crt.pem", keyPath: "/home/carl/swift/time/pem/key.pem"), let vaporAPNS = try? VaporAPNS(options: opt) else {
        send(error: "APN initalised fail.", code: .unknown, to: response)
        return
    }
    opt.forceCurlInstall = true
    let payload = Payload(message: "Your push message comes here")
    let pushMessage = ApplePushMessage(priority: .energyEfficient, payload: payload, sandbox: true)
    let result = vaporAPNS.send(pushMessage, to: token)
    if case let .success(messageId,deviceToken, serviceStatus) = result, case .success = serviceStatus {
        print ("Success!")
    }

// print "Success!"

@carlhung carlhung changed the title sent successfully, but can't get any push message. sent successfully, but can't get any push message. Ubuntu 16.04.2 Apr 28, 2017
@carlhung carlhung changed the title sent successfully, but can't get any push message. Ubuntu 16.04.2 sent successfully, but can't get any push message.Lubuntu 16.04 Apr 28, 2017
@matthijs2704
Copy link
Owner

I need an error log otherwise I can't really help... By the way message.share is not a valid topic to send notifications to. You need to set that to your app bundle identifier

@carlhung
Copy link
Author

carlhung commented Apr 30, 2017

actually the topic is real. i will change the topic's name in the future. I found that the push notification didn't work as the app didn't open. now the problem is I got the push message when the app opens. but if the app is terminated, I can't get push message.
when i use the other tool for testing the push notification. the push notification would work even the app is terminated.
thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants