Unity send message to iOS
-
Drag libRGToIos.a ToiOS.h UnityToIos.cs into the folder(Plugins/iOS/)
-
In unity code use the static function "ToIos"" of UnityToIos to send message to iOS
public static void ToIos(string key,string value)
-
Grag the RGToIOSManaager to Xcode project Classes/
-
In "UnityAppController" add
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions ... [RGToIOSManaager sharedManager]; ...
-
In "RGToIOSManaager"
- (void)receive:(NSNotification *)noti{ NSDictionary *dic = noti.object; /** { key: @"key", value: @"value" } */ Wirte you code }