notifications

package
v0.0.0-...-e6b71c9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApnsCertificate

func ApnsCertificate(scheme string) (cert tls.Certificate, err error)

ApnsCertificate handles finding the proper certificate depending on app scheme and envrionment

func ApnsCertificatePassword

func ApnsCertificatePassword(scheme string) (password string)

ApnsCertificatePassword determines the credential for the apns cert password depending on environment

func DeviceTokensForUser

func DeviceTokensForUser(userID uuid.UUID) (tokens []string, err error)

DeviceTokensForUser fetches all the device tokens stored for a user by ID

func ItemsAdded

func ItemsAdded(userID uuid.UUID, storeID interface{}, numItemsAdded int, appScheme string)

ItemsAdded sends a push notification to store users about a new item

func MealRemoved

func MealRemoved(meal models.Meal, appScheme string)

MealRemoved sends a push notification about a meal being removed from a meal plan

func MealUpdated

func MealUpdated(meal models.Meal, origMealName string, appScheme string)

MealUpdated sends a push notification about a meal being updated in a meal plan

func MealUserTokens

func MealUserTokens(meal *models.Meal) (tokens []string, err error)

MealUserTokens fetches apns device tokens for all meal users

func NewMeal

func NewMeal(meal *models.Meal, appScheme string)

NewMeal sends a push notification about a new meal

func Send

func Send(title string, body string, token string, entityName string, entityID string, scheme string)

Send sends a push notification

func SetNotificationPayload

func SetNotificationPayload(title string, body string, entityName string, entityID string) (p *payload.Payload)

SetNotificationPayload sets the APNS payload for the

func SetNotificationTopic

func SetNotificationTopic(scheme string) (topic string)

SetNotificationTopic determines the correct topic for the notification This should match the bundle ID depending on environment i.e. "bradpurchase.GroceryTime.beta"

func StoreDeviceToken

func StoreDeviceToken(token string, userID uuid.UUID) (device *models.Device, err error)

StoreDeviceToken creates a Device record to store device tokens for iOS push notifications

func StoreUserTokens

func StoreUserTokens(storeID uuid.UUID, userID uuid.UUID) (tokens []string, err error)

StoreUserTokens fetches apns device tokens for all store users associated with the item provided, excluding for those users who have disabled notifications in store user preference settings

func UserJoinedStore

func UserJoinedStore(user models.User, storeID interface{}, appScheme string)

UserJoinedStore sends a push notification when a user joins a store via share code

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL