NATIVE IOS CODE CALLBACKS

16 views
Skip to first unread message

Hasni Faiçal

unread,
Sep 4, 2019, 10:46:21 AM9/4/19
to CodenameOne Discussions
If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA
Desktop OS
Simulator
Device

As you mentioned in native iOS call back to call a function from iOS with NSString arg 

public static void callback(String arg) {
}

we should use fromNSString this a call like:
fromNSString(CN1_THREAD_GET_STATE_PASS_ARG nsStringValue); 


how to do the same to call this interface from iOS:

public static void callback(byte[] arg) {
}

My objective is to call an interface with byte[] arg with NSDataargument (NSData represent a data from an image)

Steve Hannah

unread,
Sep 4, 2019, 12:30:47 PM9/4/19
to codenameone...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/7a40c34d-e4b1-407a-bc55-f3378ae3c2ec%40googlegroups.com.


--
Steve Hannah
Software Developer
Codename One

Hasni Faiçal

unread,
Sep 5, 2019, 4:45:34 AM9/5/19
to CodenameOne Discussions
Thank you Steve for this hint, I used the same logic and it solved my problem.


On Wednesday, September 4, 2019 at 5:30:47 PM UTC+1, Steve Hannah wrote:
On Wed, Sep 4, 2019 at 7:46 AM Hasni Faiçal <hasni....@gmail.com> wrote:
If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA
Desktop OS
Simulator
Device

As you mentioned in native iOS call back to call a function from iOS with NSString arg 

public static void callback(String arg) {
}

we should use fromNSString this a call like:
fromNSString(CN1_THREAD_GET_STATE_PASS_ARG nsStringValue); 


how to do the same to call this interface from iOS:

public static void callback(byte[] arg) {
}

My objective is to call an interface with byte[] arg with NSDataargument (NSData represent a data from an image)

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages