A minimal iOS application for receiving push notifications from Online Go Server (OGS) and opening game URLs.
- 📱 Receives push notifications for OGS game events
- 🔗 Opens game URLs in Safari when notifications are tapped
- 🎯 Supports deep linking via
ogs://URL scheme - ⚡ Minimal UI - focuses purely on notification handling
- iOS 14.0 or later
- Xcode 15.2 or later
- Physical iOS device (push notifications don't work in simulator)
- Apple Developer account for code signing
git clone <repository-url>
cd ogs-notifications-app
open NotificationApp.xcodeproj- Open the project in Xcode
- Select the
NotificationApptarget - Go to "Signing & Capabilities"
- Set your Team and Bundle Identifier
- Ensure "Push Notifications" capability is enabled
- Connect a physical iOS device
- Select your device as the build target
- Build and run the project (⌘+R)
- Grant notification permissions when prompted
- Check Xcode console for device token output
- Copy the device token for server configuration
- Provide token to your OGS server for push notifications
The app automatically handles push notifications with this payload format:
{
"aps": {
"alert": {
"title": "Your turn in Go!",
"body": "It's your turn in: Game Name"
},
"badge": 1,
"sound": "default"
},
"web_url": "https://online-go.com/game/12345",
"app_url": "ogs://game/12345",
"action": "open_game"
}- Tap notification: Opens the game URL in Safari
- Direct URL:
ogs://game/12345redirects to web version
Current: online-go-server-push-notification
- Scheme:
ogs - Format:
ogs://game/{gameId} - Behavior: Redirects to
https://online-go.com/game/{gameId}
- Development: Uses APNs development environment
- Production: Change
aps-environmentinNotificationApp.entitlements
NotificationApp/
├── AppDelegate.swift # Push notification setup & handling
├── SceneDelegate.swift # URL scheme handling
├── ViewController.swift # Minimal UI
├── Info.plist # App configuration & URL schemes
├── NotificationApp.entitlements # Push notification capabilities
└── Assets.xcassets/ # App icons and resources
- Notification Registration:
AppDelegate.swift:9-16 - Notification Tap Handling:
AppDelegate.swift:35-44 - URL Scheme Handling:
SceneDelegate.swift:40-49
- Build and run on physical device
- Note device token from console
- Use server or testing tool to send notifications
- Test both notification taps and direct URL schemes
No device token printed
- Ensure you're running on a physical device
- Check notification permissions are granted
- Verify push notifications capability is enabled
Notification not opening URL
- Check console for any error messages
- Verify notification payload includes
web_urlandaction: "open_game" - Ensure Safari is available on device
URL scheme not working
- Verify URL format:
ogs://game/{gameId} - Check Info.plist has correct URL scheme registration
- Test with Safari address bar: type URL directly
- Device tokens are printed to Xcode console
- URL handling debug info in
SceneDelegate.handleURL - Notification payload accessible in notification handlers
This app works with the OGS server component for sending push notifications. See server repository for backend implementation details.
[Add your license information here]