My iOS app sends RSS subscription requests to superfeedr like so:
func subscribe(feed: String) {
let parameters = ["hub.mode" : "subscribe", "hub.topic" : feed, "format" : "json" , "hub.callback" : "https://AppID:[email protected]/1/functions/superfeedrnew"]
let user = "user"
let token = "token"
let str = "\(user):\(token)"
let utf8str = str.dataUsingEncoding(NSUTF8StringEncoding)
if let base64Encoded = utf8str?.base64EncodedStringWithOptions(NSDataBase64EncodingOptions(rawValue: 0))
{
let headers = ["Authorization": "Basic \(base64Encoded)"]
Alamofire.request(.POST, "https://push.superfeedr.com", parameters: parameters, headers: headers)
.responseJSON { response in
debugPrint(response)
}
}
}
The feed registers fine in superfeedr and superfeedr should send a notification to my Parse callback URL which is for now just an hello world function which should at least print the input.
Parse.Cloud.define("superfeedrnew", function(request, response) {
response.success('** WEBHOOK WORKING **' + request);
});
My problem is that the notification is never received/function not executed using this approach and I don't know why. I can however execute the function fine using curl:
curl -X POST \
-H "X-Parse-Application-Id: app ID" \
-H "X-Parse-REST-API-Key: rest key" \
-H "Content-Type: application/json" \
-d '{}' \
https://api.parse.com/1/functions/superfeedrnew
Edit: This is the first time I use webhooks so I've tried this: Update Parse.com User from Stripe Webhook and it works perfectly with stripe. Superfeedr still isn't able to call my cloud code function though. Drives me nuts. I also get a notification delivery failure message on my superfeedr dashboard.
Since you use your superfeedr credentials (login + token) and no
hub.verify
value, Superfeedr will actually not need to perform a verification of intent. You can check your Superfeedr subscription list from the website and you will should your subscription.