0
votes

There is a default function in 'cloud/main.js' of parse-server-example which is working fine I can see 'Hi' response in my iOS app simulator.

Parse.Cloud.define('hello', function(req, res) 
{
     res.success('Hi');
});

After I added my own function into this file as followes:

Parse.Cloud.define(testFunction', function(req, res)
{
     res.success('Test function');
});

and run the following commands:

$ git add index.js
$ git commit -m "Changed configuration values"
$ git push heroku master

and call it in my app function it shows an error:

[PFCloud callFunctionInBackground:@"testFunction"
                       withParameters:nil
                                block:^(id object, NSError *error)
     {
         if (!error)
         {
             NSLog(@"%@",object);

         }
         NSLog(@"%@",error.debugDescription);
     }
     ];

[Error]: Invalid function. (Code: 141, Version: 1.13.0)

But the 'hello' function is working fine. How would that work?

1
Ok This issue has been resolved as I was committing wrong file to commit the cloud/main.js i did: $ git add ./cloud/main.js $ git commit -m "Changed configuration values" $ git push heroku master - viki donald
But now I have another issue the cloud running code responding {"code":1,"message":"Internal server error."} (Code: 1, Version: 1.13.0) - viki donald

1 Answers

1
votes
Parse.Cloud.define(testFunction', function(req, res)

You're missing a quote in front of testFunction'.