1

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:javascript-key=JavascriptKey@api.parse.com/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.

Community
  • 1
  • 1
user2747220
  • 863
  • 3
  • 12
  • 31

1 Answers1

1

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.

Julien Genestoux
  • 31,046
  • 20
  • 66
  • 93
  • Thanks. Superfeedr hasn't been able to send a single notification so far so isn't this the same problem? I understand superfeedr doesn't get a 200 code from Parse and I am not sure why since the callback url is clearly accessible using curl. – user2747220 Dec 12 '15 at 10:09
  • This is the first time I use webhooks so I've tried this: http://stackoverflow.com/questions/29924967/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. – user2747220 Dec 12 '15 at 12:51
  • Please, send us an email (all info on site) with details. It's hard to debug without at least your login name... Thanks! – Julien Genestoux Dec 13 '15 at 19:52
  • @user2747220 Do you know if Superfeedr isn't sending the notification at all, or do you know its being sent but that you aren't receiving it? One test for this would be to configure a callback url in the Superfeedr subscription to point to something like http://requestb.in and you can easily see in real time if something is being sent. – Matthew Dec 19 '15 at 20:59