Skip to content

Instantly share code, notes, and snippets.

@vanessaaleung
Last active May 28, 2019 11:52
Show Gist options
  • Save vanessaaleung/52a879e004d403d77713f302b8b50e7e to your computer and use it in GitHub Desktop.
Save vanessaaleung/52a879e004d403d77713f302b8b50e7e to your computer and use it in GitHub Desktop.
unityToIOS
extern "C" void unityToIOS(char *str) {
//add things you want to pass to iOS here
//e.g. I want to pass a string, I save the string in NSDictionary and assign it to userInfo
NSString* objcstring = @(str);
NSDictionary* dict = @{ @"data": objcstring};
[[NSNotificationCenter defaultCenter] postNotificationName:@"NotificationName"
object:nil userInfo:dict];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment