Let me walk through the complete solution for procurement workflow push notifications:
APNs Certificate Setup:
Your production certificate is valid, which is good. However, verify it’s properly installed on your Manhattan server with the correct private key. Test the certificate using a tool like Knuff or manual curl command:
curl -v -d '{"aps":{"alert":"test"}}' \
--cert apns-cert.pem:password \
--http2 https://api.push.apple.com/3/device/[token]
If this fails, your certificate configuration has issues even if it appears valid.
Device Token Registration:
This is likely your main problem. The iOS app needs this implementation:
func application(_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let token = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()
ManhattanSDK.registerDeviceToken(token, userId: currentUser.id)
}
The Manhattan SDK must send this token to the procurement module’s notification service. Check server logs for POST requests to /api/notifications/register or similar endpoint. If tokens aren’t arriving, the SDK registration call is failing.
Payload Format Validation:
Manhattan’s procurement workflow should generate payloads like:
{
"aps": {
"alert": {
"title": "PO Approval Required",
"body": "PO-12345 awaits your approval"
},
"badge": 1,
"sound": "default"
},
"poId": "12345",
"workflowType": "approval"
}
Common mistakes: Missing “aps” wrapper, incorrect alert structure, or exceeding 4KB limit with custom data.
Debugging Steps:
- Enable APNs logging on Manhattan server to see delivery attempts and responses
- Use Xcode Console to monitor device-side registration and notification receipt
- Verify the workflow engine is triggering notification events - check procurement module configuration
- Test with a known-good device token using manual API call
Configuration Check:
In Manhattan’s procurement module, verify notification triggers are enabled for approval workflow states. The workflow might be executing but not configured to send notifications.
Token Lifecycle Management:
Implement token refresh logic. iOS regenerates tokens after app reinstall or OS updates. Your app should re-register tokens on each launch, and the server should update its database accordingly.
Most likely, your device tokens aren’t reaching the Manhattan server due to SDK integration issues. Fix the registration flow first, then validate payload format.