Skip to content

Commit d7b3431

Browse files
Merge pull request #13 from pschmitt/send-updated-push-url
2 parents f5248cd + b3d297a commit d7b3431

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

main.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,14 @@ func (k *Kernel) registerDevice(ctx context.Context) (api.Registration, error) {
355355

356356
// updateRegistration updates app registration data
357357
func (k *Kernel) updateRegistration(ctx context.Context, registration api.Registration) error {
358-
err := k.api.UpdateRegistration(ctx, api.UpdateRegistrationRequest{
358+
pushUrl, err := k.config.GetPushUrl()
359+
if err != nil {
360+
log.Println("Push notifications will not work with your current config")
361+
}
362+
err = k.api.UpdateRegistration(ctx, api.UpdateRegistrationRequest{
359363
AppData: api.AppData{
360364
PushToken: registration.PushToken,
361-
PushURL: k.config.Notifications.PushURL,
365+
PushURL: pushUrl,
362366
},
363367
AppVersion: Version,
364368
DeviceName: k.api.DeviceName,

0 commit comments

Comments
 (0)