PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile 2024
→
Calling ObjC function and passing results
Calling ObjC function and passing results
Started by Mike Stewart, Jun., 27 2017 1:31 PM - No answer
Connect yourself…
Mike Stewart
#1
Posted on June, 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
)
;
}
}
}
]
;
}
Report
0
0
→ Go back to WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text