Mobile notifications for iOS (#210)
* mobile: wire notification registration and listener
* implement backend components for push notifications
* refactor: agentic comment cleanup
* docs: use proper module name for particle processor
* set required env variables for push notifications
* bump version
* fix: always upsert push token on mobile start
* Revert "fix: always upsert push token on mobile start"
This reverts commit 90ff18a788.
* send push notifications regardless of online status
This commit was merged in pull request #210.
This commit is contained in:
@@ -21,7 +21,6 @@ func CreateOptionalBool(input bool) *bool {
|
||||
return &input
|
||||
}
|
||||
|
||||
// OptionalString converts a non-nil *string to the respective string or returns "".
|
||||
func OptionalString(input *string) string {
|
||||
if input == nil {
|
||||
return ""
|
||||
@@ -30,7 +29,6 @@ func OptionalString(input *string) string {
|
||||
return *input
|
||||
}
|
||||
|
||||
// OptionalInt converts a non-nil *int to the respective int, otherwise returns 0.
|
||||
func OptionalInt(input *int) int {
|
||||
if input == nil {
|
||||
return 0
|
||||
@@ -39,8 +37,7 @@ func OptionalInt(input *int) int {
|
||||
return *input
|
||||
}
|
||||
|
||||
// CreateOptionalInt when given a zero value int (0), it returns a nil *int.
|
||||
// Otherwise, it gives a proper *int with valid value.
|
||||
// Zero values become nil; the inverse of OptionalInt.
|
||||
func CreateOptionalInt(input int) *int {
|
||||
if input == 0 {
|
||||
return nil
|
||||
@@ -49,8 +46,7 @@ func CreateOptionalInt(input int) *int {
|
||||
return &input
|
||||
}
|
||||
|
||||
// CreateOptionalString when given an empty string, it returns a nil *string.
|
||||
// Otherwise, it gives a proper *string with valid value.
|
||||
// Empty string becomes nil; the inverse of OptionalString.
|
||||
func CreateOptionalString(input string) *string {
|
||||
if input == "" {
|
||||
return nil
|
||||
@@ -59,8 +55,7 @@ func CreateOptionalString(input string) *string {
|
||||
return &input
|
||||
}
|
||||
|
||||
// GetNumberFromString converts a string to a number.
|
||||
// Returns error if the query is not a number.
|
||||
// Returns an error if input contains non-digit characters or parses to <= 0.
|
||||
func GetNumberFromString(input string) (int, error) {
|
||||
for _, c := range input {
|
||||
if c < '0' || c > '9' {
|
||||
@@ -80,7 +75,6 @@ type Number interface {
|
||||
int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64
|
||||
}
|
||||
|
||||
// OptionalNumber converts a non-nil *NUMBER to the respective number value or returns 0.
|
||||
func OptionalNumber[T Number](input *T) T {
|
||||
if input == nil {
|
||||
return 0
|
||||
@@ -89,7 +83,7 @@ func OptionalNumber[T Number](input *T) T {
|
||||
return *input
|
||||
}
|
||||
|
||||
// CreateOptionalNumber when given an zero value NUMBER (0), it returns a nil *NUMBER, otherwise, it gives a proper *NUMBER with valid value.
|
||||
// Zero values become nil; the inverse of OptionalNumber.
|
||||
func CreateOptionalNumber[T Number](input T) *T {
|
||||
if input == 0 {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user