Skip to content
This repository was archived by the owner on Aug 25, 2020. It is now read-only.
This repository was archived by the owner on Aug 25, 2020. It is now read-only.

Sync Process #5

Description

@oxxy

Does it support Sync. process ? like calling a function that return a value from the service response and waiting the response to come back

  • (BOOL)checkUserExistence{
    NSInteger callID;

    _jsonRPCService =[[DSJSONRPC alloc] initWithServiceEndpoint:[NSURL URLWithString:@"http://serv.m-diet.com/Persons.ashx"]];

    DSJSONRPCCompletionHandler completionHandler = ^(NSString *methodName, NSInteger callId, id methodResult, DSJSONRPCError *methodError, NSError *internalError) {
    if (methodError) {
    NSLog(@"\nMethod %@(%i) returned an error: %@\n\n", methodName, callId, methodError);
    return NO;
    }
    else if (internalError) {
    NSLog(@"\nMethod %@(%i) couldn't be sent with error: %@\n\n", methodName, callId, internalError);
    return NO;
    }
    else {
    NSLog(@"\nMethod %@(%i) completed with result: %@\n\n", methodName, callId, methodResult);
    NSMutableDictionary *responceDictionary = (NSMutableDictionary *)methodResult;
    return [[responceDictionary objectForKey:@"result"]boolValue];
    }
    };

    callID = [_jsonRPCService callMethod:@"CheckPersonID" withParameters:@{ @"PersonID" : @"sam@am.com"} onCompletion:completionHandler];
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions