Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. The 2022.2 beta is now available for testing. To find out what's new, have a look at our 2022.2 feature highlights.
    Dismiss Notice
Dismiss Notice
Submit bug reports tagged with #Beta2022Win_Unity when you encounter unknown issues while testing the 2022.2 betas for a chance to win a year of Unity Pro. For more information, have a look at our Beta Sweepstakes Announcement.

Integration Unity as a library in native iOS app

Discussion in '2019.3 Beta' started by PavelLU, May 27, 2019.

  1. vishal

    vishal

    Joined:
    Aug 8, 2012
    Posts:
    14
    I am experiencing some issues when I am trying to launch an object tracking feature of ARkit.The integration of the AR XCode project with my native XCode project was successful. My Unity project has two features of AR (Object tracking and plane detection) Plane detection is working fine but object tracking is not working.

    During debugging in xcode, I did not get any error. It is working fine up to the session tracking the state of AR session.

    Unity 2019.3.0b6
    AR Foundation 3.0.0 preview 3
    AR Subsystem 3.0.0 preview 3
    ARkit XR Plugin 3.0.0 preview 3
    XCODE 11.1 (Target iOS 12.0)

    I also tested my application on both the iOS devices (12 and 13) but still facing the same issue.

    Update: Issue resolved by putting object scanned data (.arobject file) in native app XCODE project.
     
    Last edited: Oct 23, 2019
  2. vishal

    vishal

    Joined:
    Aug 8, 2012
    Posts:
    14

    Make sure
    1. In General / Embedded Binaries, you linked your UnityFramework.framework properly. If it is already added, first remove old one and reimport from unity xcode project.
    2. Your NativeCallProxy.h file is UnityFramework enabled in traget Membership and It also has public visibility.
     
  3. sethm

    sethm

    Joined:
    Dec 19, 2016
    Posts:
    3
    Do you have a screenshot as to what the hierarchy looks like?

    I'm still getting complaints about the Reference Image Library.

    2019-10-25 15:35:32.447793-0400 NativeiOSApp[960:660571] [framework] CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: 'com.nativeiOSApp'

    2019-10-25 15:35:32.448023-0400 NativeiOSApp[960:660571] [framework] CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: 'com.nativeiOSApp'

    2019-10-25 15:35:32.448532-0400 NativeiOSApp[960:660571] [General] Error while opening catalog named "Assets" in bundle "(null)": Error Domain=NSCocoaErrorDomain Code=260 "RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: com.nativeiOSApp" UserInfo={NSLocalizedDescription=RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: com.nativeiOSApp}


    NativeiOSApp[898:643020] [General] No resource group with name "ReferenceImageLibrary_13FD68D4-3BEE-476D-97A8-8B40F381AF2D" found

    InvalidOperationException: Failed to set requested image library 'ReferenceImageLibrary' on ARKit - there is no matching resource group, or the resource group does not contain any reference images.



    EDIT:

    Was able to solve this by doing the following:

    In the Unity-iPhone project, there is a folder called Unity-iPhone which contains the ARReferenceImages.xcassets folder. This contains your AR Reference Images. Copy this folder over to your Native iOS project and make sure its Target Membership is the native iOS project.
     
    Last edited: Oct 28, 2019
    Slashik likes this.
  4. badumon_unity

    badumon_unity

    Joined:
    Oct 28, 2019
    Posts:
    1
    integrated unityframework (unity ar app) with my ios native app,unity is loaded but the ar is not showing on the screen.unity app working perfectly as standalone app but not with integration
    Please help me i have done all the steps provided by you
     
  5. sethm

    sethm

    Joined:
    Dec 19, 2016
    Posts:
    3
    What happens when you load the Unity scene? Does it crash?
     
  6. Vipatronon

    Vipatronon

    Joined:
    Aug 23, 2016
    Posts:
    11
    Thank you Instinct to share your integration code!

    I've followed all steps, but Unity's screen is not showing up... I think it is loading correctly, because the app doesn't crash, and Xcode's console doesn't seems to point to any error...

    2019-10-31 19:52:26.996468-0300 SwiftUIApp[5565:499006] Built from '2019.3/staging' branch, Version '2019.3.0b8 (7eb5456f98b4)', Build type 'Release', Scripting Backend 'il2cpp'

    -> applicationDidFinishLaunching()

    2019-10-31 19:52:27.069815-0300 SwiftUIApp[5565:499006] Metal API Validation Enabled

    -> applicationWillEnterForeground()

    -> applicationDidBecomeActive()

    GfxDevice: creating device client; threaded=1

    Initializing Metal device caps: Apple A8X GPU

    Initialize engine version: 2019.3.0b8 (7eb5456f98b4)

    UnloadTime: 10.664583 ms

    Setting up 1 worker threads for Enlighten.

    Thread -> id: 170d6f000 -> priority: 1


    I'm using SwiftUI to build my native app's interface

    I'm new in iOS development, so I think this issue is just a matter of displaying the Unity's screen in the right way

    The button that triggers the action:

    Code (CSharp):
    1. var body: some View {
    2.         VStack {
    3.             Button(action: UnityEmbeddedSwift.showUnity) {
    4.                 Text("Open Unity")
    5.             }
    6.             NavigationView{
    7. ...
    Any ideas?


     
  7. ArpitTyagi01

    ArpitTyagi01

    Joined:
    Feb 21, 2018
    Posts:
    14
    Hello ,
    Can we use Xcode Workspace instead of Xcode project while using this functionality ??
     
  8. bambamyi

    bambamyi

    Joined:
    Nov 26, 2008
    Posts:
    90
    Unity, thank you for providing an example project.. but I see problems that I think that needs to be pointed out.
    If unity 2019 is pushing for unity as library as main feature, the implementation details provided in this thread and githup project needs little more care and documentation for wide audience base.

    1. MainViewController.mm combines UnityFramework, viewcontroller, and appdelegate... really? Was it difficult having three different files? >.<

    2. I got the swift version working to certain degree but there is something missing. Most iOS devs these days are using Swift... unity.. time to up the game and provide us swift xcode project.

    3. One gracious user provided a great way to use Swift but nobody from Unity has participated in the discussions. Is this how you guys run your business? Fire up a simple yet not so great integration example and just forget about it? Multiple users have reported unity window not showing up when using the swift translation example, nothing from unity.

    I am very disappointed by lack of interests and support from Unity and I think it is time to up the game. Your silence looks like ignorance of the paying customers.
     
    Last edited: Nov 8, 2019
  9. ArpitTyagi01

    ArpitTyagi01

    Joined:
    Feb 21, 2018
    Posts:
    14
    Hello , the given xcode project is in objective c can we use swift instead of objective c if yes than how ?
     
  10. vishal

    vishal

    Joined:
    Aug 8, 2012
    Posts:
    14
    Yes we can.
    Swift implementation is already explained in the same thread by @Instinct
    I tested with my current project and it is working fine with some modifications.
     
  11. freddyready

    freddyready

    Joined:
    Nov 2, 2019
    Posts:
    16
    Hi, did you ever find a solution for this?
     
  12. Basher207

    Basher207

    Joined:
    Mar 13, 2015
    Posts:
    3
    This is amazing. Thank you so much for being a good Samaritan and making it so easy for the rest of us <3

    One question tho if you have the time, it appears that the minimum size I can get an empty unity project, in an empty swift project. to be is like 160mb (around 20mb unity app standalone, and a couple of mb swift project) x<
    I was told by a friend of mine that they think this is just a side effect of swift bad optimization when including non swift frameworks.
    If you have any tips it would go a long way <3
     
  13. bambamyi

    bambamyi

    Joined:
    Nov 26, 2008
    Posts:
    90
    I am curious to find out what kind of modifications you did. I have mine working as well but it still crashes when I try to close the unity side. Would you mind sharing?
     
  14. Basher207

    Basher207

    Joined:
    Mar 13, 2015
    Posts:
    3
    Hey!
    I ran into the same thing when trying to unload unity from the unity loop "stack" (no idea what's the proper term for it).
    The solution was to add a . DispatchQueue delay in swift, and make that calls unload unity.
    That way the unloadUnity is being called from the main swift loop, seems to work just fine :))

    Here is how i'm using it

    Code (CSharp):
    1.  
    2.     static func hideUnity() {
    3.         UnityEmbeddedSwift.instance?.hideUnityWindow()
    4.         DispatchQueue.main.asyncAfter(deadline: .now(), execute: {
    5.             self.unloadUnity();
    6.         })
    7.     }
     

    Attached Files:

    Last edited: Nov 13, 2019
  15. igdeman

    igdeman

    Joined:
    May 15, 2015
    Posts:
    4
    Try building with ios device attached to your computer instead simulator. That should do the trick.
     
  16. dylan_unity563

    dylan_unity563

    Joined:
    Nov 18, 2019
    Posts:
    3
    @PavelLU Just caught something with Unity 2019.3.0b11 - on line 216 in MainViewController.mm, 'unloadApplication: true' should just be 'unloadApplication' as the interface seems to have changed to not require an argument. After removing, seems to work for me, for now.
     
  17. melodydrew

    melodydrew

    Joined:
    Sep 9, 2019
    Posts:
    2
    Hi all,

    I'm trying to integrate UaaL into a React Native project and having only a varying level of success.

    I've managed to make it as far as creating a native UI module that, when the component is added, will start Unity and present it.

    The problem I'm having is I'd really like to have the Unity UIView render inside another UIView that I can return as a native UI module. I was hoping I'd be able to access the UnityFramework's rootView and add that to my UIView, but as soon as I start the Unity instance using runEmbeddedwithArgc it completely takes over the screen and my React Native components are no longer visible.

    Is what I'm trying to do actually possible using UaaL? I'm trying to access the rootView and add it to a wrapper UIView this way:

    Code (ObjectiveC):
    1.  
    2.   [self setUfw:UnityFrameworkLoad()];
    3.  
    4.   UIView *unityView = [[[self ufw] appController] rootView];
    5.  
    6.   UILabel * label = [[UILabel alloc] init];
    7.  
    8.   UIView * wrapper = [[UIView alloc] init];
    9.  
    10.   [wrapper addSubview:unityView];
    11.  
    12.   return wrapper;
    13.  
    But if I add this line...

    Code (ObjectiveC):
    1.  
    2.   [[self ufw] runEmbeddedWithArgc:gArgc argv:gArgv appLaunchOpts:gLaunchOptions];
    3.  
    ... Unity takes over the entire screen and my React Native components disappear.

    Am I barking up the wrong tree here? I freely admit my UIKit knowledge is limited at best, so if anyone can help me out it'd be massively appreciated!
     
    chairmin likes this.
  18. bambamyi

    bambamyi

    Joined:
    Nov 26, 2008
    Posts:
    90
    Ah thank you!!! I will have to try this today! Cheers!
     
  19. dylan_unity563

    dylan_unity563

    Joined:
    Nov 18, 2019
    Posts:
    3
    Maybe it has to do with a Unity setting? If I remember correctly, Unity is set to be fullscreen by default and that hides the bottom navigation buttons on android. Might be something similar. That's my best guess so far since I probably know even less about UIKit than you.

    I'm also trying to put UaaL in React and ideally React can display over it, so I'll let you know if I make any progress when I get to that stage.
     
    chairmin likes this.
  20. melodydrew

    melodydrew

    Joined:
    Sep 9, 2019
    Posts:
    2
    Hi dylan,

    We have managed to make some progress, but not in the way I'd planned.

    Because UaaL is creating its own UIWindow and plonking that on top of the screen, it was obscuring the React Native UIWindow. After taking a look at this project (https://github.com/CGS-Canada/react-native-unity) I saw that he'd overcome this by adding the React Native view as a child of the UaaL window, so we tried that and it works!

    It's not 100% ideal as it means the Unity window is running in the background of the app at all times, so if we need to show it the screen we navigate to needs to have a transparent background - but it does work. So far we've only tried it out with iOS, the next step is to get it all working on Android!
     
  21. rkiOSDeveloper

    rkiOSDeveloper

    Joined:
    Aug 2, 2019
    Posts:
    17
    Hello everyone ,
    thanks for giving nice information than Apple developer forums ,
    Please give me solution for this
    "How to navigate back to native screen from unity window"
    here i am using this code

    self.instance.hideUnity()

    self.instance.unloadUnity()

    self.instance.showMainView()

    DispatchQueue.main.asyncAfter(deadline: .now() + 2.0, execute: {

    self.navigationController?.popViewController(animated: true)

    })



    Thanks in advance
     
  22. rkiOSDeveloper

    rkiOSDeveloper

    Joined:
    Aug 2, 2019
    Posts:
    17
    Hi bro ,
    unloading is working fine but here i need to navigate to back from unity
    give me any solution on this
    here i used code
    self.instance.hideUnity()

    self.instance.unloadUnity()

    self.instance.showMainView()

    DispatchQueue.main.asyncAfter(deadline: .now() + 2.0, execute: {

    self.navigationController?.popViewController(animated: true)

    })



    Thanks
     
  23. rkiOSDeveloper

    rkiOSDeveloper

    Joined:
    Aug 2, 2019
    Posts:
    17
    Hi bro ,
    unloading is working fine but here i need to navigate to back from unity
    give me any solution on this
    here i used code
    self.instance.hideUnity()

    self.instance.unloadUnity()

    self.instance.showMainView()

    DispatchQueue.main.asyncAfter(deadline: .now() + 2.0, execute: {

    self.navigationController?.popViewController(animated: true)

    })
     
  24. dylan_unity563

    dylan_unity563

    Joined:
    Nov 18, 2019
    Posts:
    3
    @PavelLU I do understand that Unity can't run in the simulator, but one small request from me is I'd prefer it just crash the app if accessed instead of not being visible in simulator builds entirely.

    Unity is a relatively small part of our app and my team primarily works in the simulator to test the rest of their features so it's a shame to have to figure out some conditional compiling just to make simulator builds possible.
     
  25. tppurchase

    tppurchase

    Joined:
    Oct 23, 2019
    Posts:
    4
    Does Unity plan on making Unity as a Library feature available for simulator builds as well ? Can anyone from the unity team confirm this ?
     
  26. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    81
    :) I am tried call the 'load unity view' and send message to gameobject ,then call
     ufw.unloadApplication() 
    . The message is received for the first time, and cannot be received after the second time.

    This is my flow!

    1st
    native app -> load unity view
    native app -> send message to unity
    unity app -> received message (It's working)
    native app -> unload unity app

    2ed
    native app -> load unity view
    native app -> send message to unity
    unity app -> received message (It's not working)
    native app -> unload unity app

    Dose anyone have ideas?

    ---- Fixed-----

    We need call
    Code (CSharp):
    1. ARLibraryEmbeddedSwift.ufw.unregisterFrameworkListener(self)
    2. ARLibraryEmbeddedSwift.ufw = nil
    More info check it out: https://github.com/Unity-Technologi...tiveiOSApp/NativeiOSApp/MainViewController.mm
    unityDidUnload
     
    Last edited: Dec 16, 2019
  27. yurykorzun

    yurykorzun

    Joined:
    Oct 29, 2015
    Posts:
    41
    So, the way unity framework works in iOS, after initialization, it creates a second UIWindow that hosts unity view controller and a unity view. Is it possible to move a controller and a view into a UINavigatonController, for example? I was able to create animated transition from my main UIWIndow to unity UIWindow, but I am curious if it would allow more flexibility.
     
  28. yurykorzun

    yurykorzun

    Joined:
    Oct 29, 2015
    Posts:
    41
    Support for Android emulators is being dropped, I think there is a chance same could happen to simulator support.
     
  29. yurykorzun

    yurykorzun

    Joined:
    Oct 29, 2015
    Posts:
    41
    I was able to add a React Native view as a root view in my app and add Unity in a second UIWindow.

    Code (CSharp):
    1. @implementation AppDelegate
    2.  
    3. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    4. {
    5.   appLaunchOpts = launchOptions;
    6.  
    7.   [self initUnity];
    8.  
    9.   RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
    10.   RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
    11.                                                    moduleName:@"LibraryTestRN"
    12.                                             initialProperties:nil];
    13.  
    14.   rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
    15.  
    16.   self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    17.  
    18.   UIViewController *rootViewController = [UIViewController new];
    19.   self.navController = [[UINavigationController alloc]initWithRootViewController:rootViewController];
    20.  
    21.   //self.navController.navigationBarHidden = YES;
    22.   rootViewController.view = rootView;
    23.  
    24.   self.window.rootViewController = self.navController;
    25.   [self.window makeKeyAndVisible];
    26.  
    27.  
    28.   return YES;
    29. }
    30.  
    Code (CSharp):
    1. - (void)ShowMainView
    2. {
    3.     if(![self unityIsInitialized]) {
    4.         NSLog(@"Unity is not initialized Initialize Unity first");
    5.     } else {
    6.       UIWindow* unityWindow = [[[self ufw] appController] window];
    7.      
    8.       CGRect viewRect = CGRectMake(self.window.rootViewController.view.frame.origin.x+500, self.window.rootViewController.view.frame.origin.y, self.window.rootViewController.view.frame.size.width, self.window.rootViewController.view.frame.size.height);
    9.       CGRect endViewRect = CGRectMake(self.window.rootViewController.view.frame.origin.x, self.window.rootViewController.view.frame.origin.y, self.window.rootViewController.view.frame.size.width, self.window.rootViewController.view.frame.size.height);
    10.      
    11.       UIView* unityView = [[[self ufw] appController] rootView];
    12.       unityView.frame = viewRect;
    13.       [unityWindow makeKeyAndVisible];
    14.      
    15.       [UIView animateWithDuration:0.5 animations:^{
    16.           unityView.frame = endViewRect;
    17.       }
    18.        completion:^(BOOL finished) {
    19.  
    20.        }];
    21.     }
    22. }
    23.  
    24. - (void)showHostMainWindow
    25. {
    26.     UIView* unityView = [[[self ufw] appController] rootView];
    27.    
    28.     CGRect endViewRect = CGRectMake(unityView.frame.origin.x+500, unityView.frame.origin.y, unityView.frame.size.width, unityView.frame.size.height);
    29.    
    30.     [UIView animateWithDuration:0.5 animations:^{
    31.         unityView.frame = endViewRect;
    32.     }
    33.      completion:^(BOOL finished) {
    34.         [self.window makeKeyAndVisible];
    35.      }];
    36.  
    37. }
     
    chairmin likes this.
  30. kushwahakush1991

    kushwahakush1991

    Joined:
    Dec 4, 2019
    Posts:
    1
    Totally i follow up this steps Both project is successfully run and My unity is launched according to log but window is not showing
    I created bridge also
    Lititle bit confuse only c# file and in bride swift file import. Can you share any one for look like file
     
  31. kushwaha03

    kushwaha03

    Joined:
    Dec 18, 2019
    Posts:
    39
    Im get same issues (didn't get any error still unity is launch but unity window is not showing
     
  32. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    81
  33. kushwaha03

    kushwaha03

    Joined:
    Dec 18, 2019
    Posts:
    39
  34. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    81
    Can u show your code?
    U need get the navigationcontroller from native-app , and get unity rootViewController .
     
  35. kushwaha03

    kushwaha03

    Joined:
    Dec 18, 2019
    Posts:
    39
    simply i added navigation with viewcontroller and then press btn and written your lines
    secound thing I also try to add this in UnityEmbeddedSwift.showunitywindow method.

    please let me know where i can put this
    please help me im so tired of this. im beginner please share some example or steps for understand bcz now i didnt understand
    Thank you
     
  36. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    81
    no problem.I will write some demos for you.But you need to let me know which language you speak, Swfit Or OC?
     
  37. kushwaha03

    kushwaha03

    Joined:
    Dec 18, 2019
    Posts:
    39
    Im using Swift
     
  38. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    81
    Last edited: Dec 19, 2019
  39. kushwaha03

    kushwaha03

    Joined:
    Dec 18, 2019
    Posts:
    39
    Thank you so much finally its working
    I really appreciate for helping.:)
    But I have doubt If I integrate my own ios app
    everything I mentioned whatever you have written in your app
    simply I drop drown your UnityEmbeddedSwift file and add code in app delegate and view controller but still Unity is not showing. can You suggest what i missed.:D
     
    Last edited: Dec 20, 2019
  40. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    81
    U need add navigation controller to your native app Main.storyboard and pushed your unity view to native app.
    Can u upload your code or project(demo) for me? Let me help you see what problems exist.
     
  41. chairmin

    chairmin

    Joined:
    Nov 19, 2019
    Posts:
    2
    At the beginning I also encountered this problem, do not use the simulator, because the project generated by unity by default does not support the simulator.
     
  42. Skyhex

    Skyhex

    Joined:
    May 9, 2018
    Posts:
    1
    i think your texture size is too big for that
     
  43. kushwaha03

    kushwaha03

    Joined:
    Dec 18, 2019
    Posts:
    39
    Thanks for helping me , please let me know how can communicate b/w ios app and unity. in Unityframework we can pass msg only unity to unity , but I want to make function both side and pass function from unity to ios and vise versa (onlyprint "hello" for both side )
    How can be do

    And i have one doubt. Here we are used Workspace then added to both app. how can be used unityframework as like library and framework. prevoisly i used just import as framework or others use cocoapod but here we also added Unity-App export by unityproject
    is that possible to save n copy only framework and use import and paste in any native app.
     
    Last edited: Dec 23, 2019
  44. NSWell

    NSWell

    Joined:
    Jul 30, 2017
    Posts:
    81
    Send Message
    1. Unity app send message to Native app
    U need make some bridge for unity app, You can find relevant information from Unity's uaal demo.
    Unity's UAAL demo : https://github.com/Unity-Technologies/uaal-example
    More info about building plugin for ios : https://docs.unity3d.com/Manual/PluginsForIOS.html
    2. Native app send to Unity app
    U need create a gameobject and add a C# script to it. Write some func in C# file.
    E.g.
    Code (CSharp):
    1. Game Name : Bridge
    2. Script Name : Bridge Unity Demo
    3.  
    4. private void BidgePrint(string _nativeMsg)
    5. {
    6.     Debug.Log(_nativeMsg);
    7. }
    8.  
    9.  
    10. //--------- iOS
    11.  
    12. ufw.sendMessageToGOWithName("Bridge","BidgePrint","This message is from native app-iOS")
    13.  


    Import as framework
    Sorry bro, I have tried but failed.There is currently no solution.
    Here are some tutorial and source code :
    https://github.com/Luka-M/unity-in-framework
    https://www.kodbiro.com/blog/a-great-way-to-integrate-unity-into-the-native-ios-app/

    Any ideas please tell me!thank you!
     
  45. kushwaha03

    kushwaha03

    Joined:
    Dec 18, 2019
    Posts:
    39
    Using swift, communicate is not working. everything I followed the instruction . already give nativecall target unityframework with public and data target is giving
    bridge also create but still is not communicate o_O
     
  46. kushwaha03

    kushwaha03

    Joined:
    Dec 18, 2019
    Posts:
    39
    Finally Communication is working
    last time we are not send anything from ios to unity so I create button and added on unity controller(appcontroller rootviw) so now button is working both side.
    Thank you so much..
    Now I just want to know how can we use as a library or swift package and cocoapod framework
    it is possible..
     
    Last edited: Dec 26, 2019
  47. chairmin

    chairmin

    Joined:
    Nov 19, 2019
    Posts:
    2
  48. kushwaha03

    kushwaha03

    Joined:
    Dec 18, 2019
    Posts:
    39
    Thanks for quick response but Im using Native iOS (swift ) , i'll check it because i dont have idea about react....

    Please tell me anyone how can be use unity framework in ios app without workspace
     
    Last edited: Dec 26, 2019
  49. bibloc

    bibloc

    Joined:
    Jan 31, 2018
    Posts:
    17
    Hello everyone,
    We get wrong values from Input.compass with unity as library integration after a device orientation occured.

    As you can see on the attached picture, the unity application (on the right side) indicates correct north (regardless of device orientation) while the native application (on the left side) indicates incorrect north (after device orientation occured).
    We tried it on android (with unity as library integration) and it's working properly.

    Also in the picture, you can see the Unity Input.compas values (red text) and the native iOS CoreLocation magneticHeading and trueHeading values on the left side (white text in red box).
    As you can see, the native values are correct but the Unity Input.compass values have a wrong orientation.

    Does anyone have a solution?
     

    Attached Files:

  50. Asseks

    Asseks

    Joined:
    Nov 22, 2019
    Posts:
    13
    My Unity game contains Firebase analytics and when I tried to integrate this game to iOS app I get error when I try to launch game:

    6.14.0 - <AppMeasurement>[I-ACS036000] Found unknown associated object: APMScreen


    I realized that this issue related with Firebase. Looks like it not initialized.
    How initialize firebase from native app?
     
unityunity