PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV Mobile 2024 → Calling ObjC function and passing results
Calling ObjC function and passing results
Iniciado por Mike Stewart, jun., 27 2017 1:31 PM - Sem resposta
Publicado em junho, 27 2017 - 1:31 PM
I am trying to call an objective C function and save the resulting string. It is saying that the line calling the function has a fault but I cannot work out what it is.
I am using Handle(getToken()) to call the following

void getToken : (BOOL) clearCache
parent:(UIViewController*) parent
completionHandler:(void (^) (NSString*, NSError*))completionBlock;
{
AppData* Data = [AppData getInstance];
IF(Data.userItem){
completionBlock(Data.userItem.accessToken, nil);
RETURN;
}

ADAuthenticationError *Error;
authContext = [ADAuthenticationContext authenticationContextWithAuthority:Data.authority Error:&Error];
authContext.parentController = parent;
NSURL *redirectUri = [[NSURL alloc]initWithString:Data.redirectUriString];

[ADAuthenticationSettings sharedInstance].enableFullScreen = Yes;
[authContext acquireTokenWithResource:Data.resourceId
clientId:Data.clientId
redirectUri:redirectUri
promptBehavior:AD_PROMPT_AUTO
userId:Data.userItem.userInformation.userId
extraQueryParameters: @"nux=1"
completionBlock:^(ADAuthenticationResult *RESULT) {

IF (RESULT.status != AD_SUCCEEDED)
{
completionBlock(nil, RESULT.error);
}
ELSE
{
Data.userItem = RESULT.tokenCacheStoreItem;
completionBlock(RESULT.tokenCacheStoreItem.accessToken, nil);
char nObjC_ResultInt(char RESULT.tokenCacheStoreItem.accessToken)
{
RETURN saveToken(char);
}
}
}];

}