Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live Activity support added #217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ozamanav
Copy link

Changes

  • added test util TestPushTypeLiveActivityHeader
  • new EPushType added (PushTypeLiveActivity)
  • In aps payload added following 4 new payload keys (ContentState, DismissalDate, Event, Timestamp)
  • Added set functions to set this values inside apns object

Let me know if you guys have any questions 馃槃

Copy link

@CommanderNULL CommanderNULL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 馃憤

@jan-xyz
Copy link

jan-xyz commented Dec 28, 2022

Hey @ozamanav I started playing around with your fork, and noticed that the timestamps are float64, is there a specific reason for it to not use int64? I am using float64(time.Now().Unix()) to get a float which seems a bit strange, given that it gets JSON encoded anyways.

Comment on lines +117 to +124
// SetDismissalDate sets the aps dismissal-date on the payload.
// This will end live activity on dismissal date timestamp.
//
// {"aps":{"dismissal-date": DismissalDate }}`
func (p *Payload) SetEvent(event ELiveActivityEvent) *Payload {
p.aps().Event = event
return p
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the doc string is still wrong here, something like this maybe?

Suggested change
// SetDismissalDate sets the aps dismissal-date on the payload.
// This will end live activity on dismissal date timestamp.
//
// {"aps":{"dismissal-date": DismissalDate }}`
func (p *Payload) SetEvent(event ELiveActivityEvent) *Payload {
p.aps().Event = event
return p
}
// SetEvent sets the aps event type on the payload.
// This can either be `LiveActivityEventUpdate` or `LiveActivityEventEnd`
//
// {"aps":{"event": Event }}`
func (p *Payload) SetEvent(event ELiveActivityEvent) *Payload {
p.aps().Event = event
return p
}

froodian added a commit to braze-inc/apns2 that referenced this pull request Jan 27, 2023
@froodian
Copy link

FYI I've submitted #219 based on this PR

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

Successfully merging this pull request may close these issues.

None yet

4 participants