@AndreyFomin wrote:
Hi,
How to send a string from Objective-C to JavaScript by JSB Reflection?
I need to get Advertiser ID from Objective-C to my JavaScript Cocos2d-JS 3.8. Trying this:
function getAID() {
return jsb.reflection.callStaticMethod("RootViewController", "getAID");
}And in RootViewController.mm:
+(const char *)getAID
{
ASIdentifierManager *adMgr = [ASIdentifierManager sharedManager];
NSString *appleAdId = [[adMgr advertisingIdentifier] UUIDString];
const char *sss([appleAdId UTF8String]);
return sss;
}But get error in XCode: not support return type = r *
Posts: 2
Participants: 1