A Go server that monitors Online-Go.com games and sends iOS push notifications when it's your turn to play.
- Automatic Turn Monitoring: Continuously checks your OGS games every few minutes
- iOS Push Notifications: Sends consolidated notifications when new turns are detected
- Deep Linking: Notifications include both web URLs and iOS app URLs for seamless game access
- Smart Notifications: Combines multiple new turns into a single notification to avoid spam
- Persistent Tracking: Remembers which moves you've already been notified about
- Go 1.19 or later
- Apple Developer account with push notification capabilities
- APNs authentication key (.p8 file) from Apple Developer portal
-
Clone and build:
git clone <repository-url> cd ogs-notifications-server go mod download go build -o ogs-server
-
Configure environment variables:
cp .env.example .env # Edit .env with your APNs credentials -
Required environment variables:
APNS_KEY_PATH: Path to your .p8 authentication key fileAPNS_KEY_ID: Your APNs key ID (10 characters)APNS_TEAM_ID: Your Apple Developer team ID (10 characters)APNS_BUNDLE_ID: Your iOS app's bundle identifierAPNS_DEVELOPMENT: Set totruefor development,falsefor productionCHECK_INTERVAL_MINUTES: How often to check for new turns (default: 3)ENVIRONMENT: Deployment environment name (optional, defaults to "none")
# Load environment and start server
source .env
./ogs-serverThe server will:
- Start on port 8080
- Begin checking all registered users every few minutes
- Send push notifications automatically when new turns are detected
POST /register
Content-Type: application/json
{
"user_id": "your_ogs_user_id",
"device_token": "your_ios_device_token_here"
}GET /check/:user_idReturns JSON with current game status and sends notifications if needed.
GET /diagnostics/:user_idReturns comprehensive user status including device registration, monitored games, and last notification time.
GET /users-by-token/:device_tokenReturns all user IDs that are registered to a specific device token. Useful for iOS apps to discover which OGS users are monitored on the current device.
- Go to your profile on Online-Go.com
- Your user ID is the number in the URL:
https://online-go.com/user/view/YOUR_ID_HERE
- Log into Apple Developer portal
- Go to Certificates, Identifiers & Profiles
- Create an APNs authentication key (.p8 file)
- Note your Key ID and Team ID for configuration
- Single Game: "You have a new turn in Go Game!"
- Multiple Games: "You have 3 new turns in Go games!"
- Each notification includes a deep link to one of the games
- Only sends notifications for newly detected turns (not existing ones)
The server uses moves.json to persist:
- Move timestamps for each user's games (prevents duplicate notifications)
- Device token registrations
- Ensure you're using .p8 token authentication (not .p12 certificates)
- Verify your bundle ID matches your iOS app exactly
- Check that your device token is correctly registered
- Verify APNs credentials are valid
- Ensure your iOS app has push notification permissions
# Kill existing server instances
pkill -f ogs-serverCHECK_INTERVAL_MINUTES=1 ./ogs-servercurl -X POST http://localhost:8080/register \
-H "Content-Type: application/json" \
-d '{"user_id": "YOUR_USER_ID", "device_token": "YOUR_DEVICE_TOKEN"}'
curl http://localhost:8080/check/YOUR_USER_IDMIT License - see LICENSE file for details.