Skip to content

Hanging on send() #46

@ynnadkrap

Description

@ynnadkrap

c.Send(m) isn't returning and I'm not sure why. I created a client without error and am not receiving any errors on sent PNs.

    c, err := apns.NewClientWithFiles(apns.SandboxGateway, CERT_PEM, KEY_PEM)
    if err != nil {
        log.Println("Client error: ", err.Error())
    }

    go func() {
        for f := range c.FailedNotifs {
            log.Println("Notif", f.Notif.ID, " failed with ", f.Err.Error())
        }
    }()

    p := apns.NewPayload()
    p.APS.Alert.Body = content
    badge := 1
    p.APS.Badge = &badge
    p.APS.Sound = "bingbong.aiff"

    m := apns.NewNotification()
    m.Payload = p
    m.DeviceToken = author.PnId
    m.Priority = apns.PriorityImmediate
    m.ID = content

    log.Println("---")
    c.Send(m)
    log.Println("...")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions