GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
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
Conecte-se…
Mike Stewart
#1
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
n
ObjC_ResultInt
(
char
RESULT
.
tokenCacheStoreItem.accessToken
)
{
RETURN
saveToken
(
char
)
;
}
}
}
]
;
}
Denunciar
0
0
→ Voltar para WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versões anteriores)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto