Integrating Unity game view inside a Native iOS Application view

I would like to know whether my approach to integrate unity game in native iOS application is good enough and will not face issues going further with the same.

  1. Built the UnityFramework target in the iOS application exported from the Unity game.
  2. Added the framework in the existing native iOS application
  3. Added the required User-defined settings in the existing native iOS application’s build settings
  4. In the existing application viewController’s button action method, called the below method to launch the unity window.

[[UnityFramework getInstance] runEmbeddedWithArgc:args.count argv:cargs appLaunchOpts:rage:{}];

  1. Added a subclass for UnityAppController and in the preStartUnity method resized the window.
    Eg.
    -(void) preStartUnity {

[self.window setFrame:CGRectMake(0, 0, 150, 150)];

}
Any suggestions on dismissing the view. For now, I did
[[UnityFramework getInstance] unloadApplicaion:YES]; + UnityAppController.window hidden and then called showUnityWindow to display the game again.
Also, incase if I need to access any app delegate functionalities I can call them from my existing AppDelegate to the UnityAppController subclass
Please let me know, if there are any simple and better approaches for integration

Yeah this is a nightmare and the solution keeps changing

I haven’t tried the new UnityFramework feature but it sounds promising. A few years ago I did this in Unity 5.2.1. Here’s a prototype I built to demonstrate it: GitHub - samizzo/UnityNativePrototype I don’t know if my prototype still works but the fundamentals should be good I think. Anyway probably it’s best to go with the UnityFramework stuff but I just thought I’d point out an alternative.

Yeah exactly. Thats why thought to post and get a suggestion

Thanks for the suggestion. Unity project that is built from the latest version looks different from the one which is posted in the GitHub link you provided.