您好我需要知道如何通过withParameters:方法发送两个对象。
这是我的代码:
NSDictionary *numberparam = [NSDictionary dictionaryWithObject:phoneNumber forKey:@"number"];
NSDictionary *messageparam = [NSDictionary dictionaryWithObject:message forKey:@"message"];
[PFCloud callFunctionInBackground:@"inviteWithTwilio" withParameters:numberparam messageparam block:^(id object, NSError *error) {
NSString *message1 = @"";
如果我从PFCloud调用中取出messageparam但是我需要包含它,一切正常。我该怎么做?
答案 0 :(得分:6)
你将它们放在字典中:
NSMutableDictionary * params = [NSMutableDictionary new];
params[@"number"] = phoneNumber;
params[@"message"] = message;
[PFCloud callFunctionInBackground:@"inviteWithTwilio" withParameters:params block:^(id object, NSError *error) {
NSString *message1 = @"";
}];
然后,在云端使用
var phoneNumber = request.number;
var message = request.message;