0

I want to get "ServerDate" on back4app.com using PFCloud. Currently I am facing the below issue:

Invalid function: "getServerDate" (Code: 141, Version: 1.13.0) When i used below code:

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

          NSLog(@"%@",serverDate);
      }
      else
      {
          [self getServerCurrentDate];
      }
   }];

I am beginner Please Explain How to implement and get javascript code on objective c?

4

1 回答 1

1

你得到的错误是因为你的main.js文件中没有一个名为"getServerDate".

确保您在main.js文件中正确定义了它,如下所示:

Parse.Cloud.define("getServerDate", function(request,response){

//Your javascript logic comes here and return the server date to the response

});
于 2017-04-09T08:24:22.893 回答