Git Product home page Git Product logo

Comments (19)

ataylor09 avatar ataylor09 commented on June 13, 2024 1

Yes, project works fine on its own without ionic integration.

Doing some more investigation I found this:
https://stackoverflow.com/questions/51523567/error-undefined-symbols-for-architecture-arm64-when-embed-unityvuforia-in-ios/51547613

Which would indicate an issue with Vuforia versions >= 7.2.

I will attempt to apply that fix and report my findings

from unityionicintegration.

yasirkula avatar yasirkula commented on June 13, 2024 1

I'd suggest you to compare your Unity build's Xcode folder structure and "Link Binary With Libraries" section with your final Ionic+Unity Xcode project's ones (especially the Unity group) and see if there are any additional directories or libraries in Unity's Xcode project.

from unityionicintegration.

yasirkula avatar yasirkula commented on June 13, 2024 1

Glad it works now! IonicComms.FinishActivity is a static function. To call it from a button, you need to add the following function to one of your C# scripts and then add it to your button's "On Click()":

public void ReturnToIonic( string returnMessage )
{
	IonicComms.FinishActivity( returnMessage );
}

from unityionicintegration.

yasirkula avatar yasirkula commented on June 13, 2024 1

For example, if you are calling unityARCaller.sendMessage( "SwitchAnchor", "GroundPlane2" ); in Ionic, you can add the following code inside the IonicComms C# script:

public GameObject anchor1, anchor2; // Assign these values from the IonicComms object's Inspector

public void SwitchAnchor( string anchorName )
{
	if( anchorName == "GroundPlane1" )
	{
		// set anchor1 as active anchor
	}
	else if( anchorName == "GroundPlane2" )
	{
		// set anchor2 as active anchor
	}
}

from unityionicintegration.

yasirkula avatar yasirkula commented on June 13, 2024 1

I don't know how changing the active anchor works, so I left the implementation part to you. You need to write the code that changes the active anchor under those commented lines.

from unityionicintegration.

yasirkula avatar yasirkula commented on June 13, 2024

Can you compile and run the Unity project alone in Xcode (without Ionic integration)?

from unityionicintegration.

ppkantorski avatar ppkantorski commented on June 13, 2024

I am getting this error too. Working on iOS 12.1, latest Xcode, latest Unity, latest Vuforia and latest ionic. I imported all of the frameworks through copying, changed the prefix statements on the build settings to that of Unity. Was getting the il2cpp and mscorlib errors, after importing the frameworks I now get that error, symbols not linked for arm64... any advice on how to fix this? I noticed it says something about arm64 for androids in the walkthrough but not for iOS. What else can I do to get this working?

from unityionicintegration.

juan9506 avatar juan9506 commented on June 13, 2024

Are you trying to build to a real iphone device?
I was getting this error too but when I was trying to build to an emulator, but when I built for my iphone it worked perfect.

from unityionicintegration.

ppkantorski avatar ppkantorski commented on June 13, 2024

Glad to hear it’s still working. Yeah I’m building it for my iPhone X device, not an emulator. I tried deleting the unity ads plugin and cleaning up my unity project more, hopefully this time around it compiles properly. I’m not sure why the arm64 error was coming up though. I set the project to compile to arm64 in unity with no luck, set it back to universal. I noticed that there is only an arm64 setting for some reason. I’m using Vuforia btw, did your project include Vuforia? Really want to get this working, any additional advice would be great. Thanks again.

update: still no luck.. not sure why though. Here's some pics.
Screen Shot 2019-05-10 at 5 14 47 PM
Screen Shot 2019-05-10 at 5 15 05 PM

I noticed that there was a difference between the C language dialects in my Unity project and my Ionic integrated project. Not sure if this is causing any issues..
Screen Shot 2019-05-10 at 4 54 17 PM
Screen Shot 2019-05-10 at 5 10 46 PM

Also, here is a picture of my unity build player settings.
Screen Shot 2019-05-10 at 5 18 16 PM
Screen Shot 2019-05-10 at 5 18 28 PM

from unityionicintegration.

ppkantorski avatar ppkantorski commented on June 13, 2024

I deleted DynamicLibEngineAPI.o and DynamicLibEngineAPI.mm as a reference and it fixed my problems. Now to the runtime error.. One weird thing I noticed is that when I click on button I'm using to open Unity, theres a plugin icon on the screen for like a second or so. I edited the info on the build to add the camera privacy settings request. And it works! I am now in Unity.. However my return to ionic button via FinishActivity doesn't appear to do a thing.

Here's what it looks like in Unity.
Screen Shot 2019-05-11 at 5 55 33 AM

Am I missing something?

from unityionicintegration.

ppkantorski avatar ppkantorski commented on June 13, 2024

One other thing that I really wanted to add but couldn't quite figure out... I am using the "plane finder" object along with the "ground plane" to position an object onto a surface. I know that doesn't necessarily belong to issues #49, but its an issue I am trying to figure out..

I want to send a message from ionic with a message associated with the button that I am clicking. (in my case it's an image). I am trying to figure out how to receive the message on the Unity side and switch the anchor to a second ground plane with a 3d object associated with the message.

Screen Shot 2019-05-16 at 7 26 13 PM
Screen Shot 2019-05-16 at 7 32 46 PM

ionic message -> unity receive message -> plane finder automatically loads anchor associated with message

Can you please help me figure out how I can modify my plane finder to load it's anchor according to the message received? Thanks again for all the assistance.

from unityionicintegration.

ppkantorski avatar ppkantorski commented on June 13, 2024

hey again, appreciate the advice. do I have to uncomment
// set anchor1 as active anchor
and
// set anchor2 as active anchor?

when I try to run my program on unity uncommenting those lines I appear to get a compilation error.

from unityionicintegration.

ppkantorski avatar ppkantorski commented on June 13, 2024

Thanks for the help before. Trying to recompile my script now and I am running into another error...

Screen Shot 2019-06-07 at 2 07 03 AM

What my issue came down to is:

Undefined symbols for architecture arm64: "_VuforiaRenderEvent", referenced from: -[AppDelegate shouldAttachRenderDelegate] in AppDelegate.o ld: symbol(s) not found for architecture arm64

in AppDelegate.mm, it is having some type of issue with Vuforia.. any advice for this one?

One last thing, my player settings changed a little. Do you think that any of these settings are causing issues?

Screen Shot 2019-06-07 at 2 11 15 AM

from unityionicintegration.

yasirkula avatar yasirkula commented on June 13, 2024

First, I'd recommend you to take a look at this post: #16

Then, open your Unity build's Xcode project and see if its folder organization, referenced libraries, Prefix.pch etc. have any obvious differences than what you achieve after integrating that build to your Ionic Xcode project. In other words, compare the two Xcode projects to see if the latest version of Vuforia requires any additional steps/files/references.

from unityionicintegration.

ppkantorski avatar ppkantorski commented on June 13, 2024

First, I'd recommend you to take a look at this post: #16

Then, open your Unity build's Xcode project and see if its folder organization, referenced libraries, Prefix.pch etc. have any obvious differences than what you achieve after integrating that build to your Ionic Xcode project. In other words, compare the two Xcode projects to see if the latest version of Vuforia requires any additional steps/files/references.

I got it to compile again! The only thing that made it work is skipping the step:
for Vuforia users: in AppDelegate.mm, uncomment the lines marked with //for vuforia:

After skipping it Unity appears to still have the same functionality that I was expecting. I am not sure if this is causing other issues though..

One other thing, when using the ReturnToIonic function that you defined, do you know how to return to Ionic without prompting a pop-up with defined/undefined message on the Ionic side that you have to click OK to continue?

I am still trying to write a functioning script to change the anchors as well..

private StateManager stateManager;
PositionalDeviceTracker positionalDeviceTracker;
ContentPositioningBehaviour contentPositioningBehaviour;

[SerializeField] PlaneFinderBehaviour planeFinder = null;

AnchorBehaviour planeAnchor;

[Header("Placement Anchors")]
[SerializeField] public GameObject Anchor1 = null;
[SerializeField] public GameObject Anchor2 = null;

void OnVuforiaStarted()
{
Debug.Log("OnVuforiaStarted() called.");

stateManager = TrackerManager.Instance.GetStateManager();

}

public void SwitchAnchor( string message )
{
// Reset trackers
this.positionalDeviceTracker = TrackerManager.Instance.GetTracker<PositionalDeviceTracker>();
this.positionalDeviceTracker.Reset();

// Define positional behaviour
this.contentPositioningBehaviour = this.planeFinder.GetComponent<ContentPositioningBehaviour>();

// Interpret message to set anchor
if( message == "anchor1" )
{
this.contentPositioningBehaviour.AnchorStage = this.Anchor1.GetComponentInParent<AnchorBehaviour>();
}
if( message == "anchor2" )
{
this.contentPositioningBehaviour.AnchorStage = this.Anchor2.GetComponentInParent<AnchorBehaviour>();
}
}

public void HandleInteractiveHitTest(HitTestResult result)
{
planeFinder.HitTestMode = HitTestMode.AUTOMATIC;

if (result == null)
{
Debug.LogError("Invalid hit test result!");
return;
}
else
{
Debug.Log("HandleInteractiveHitTest() called.");

this.contentPositioningBehaviour.DuplicateStage = false;

this.contentPositioningBehaviour.PositionContentAtPlaneAnchor(result);

}
}

This is what I added my IonicComms.cs. I then attached IonicComms.cs to the Plane FInder and removed the Content Positioning Behavior script, attached the planefinder and anchors objects in the inspector, and replaced the "On Interactive Hit Test" with the IonicComms.HandleInteractiveHitTest script. When clicking on a link from ionic, I wanted this to execute SwitchAnchor with the message "anchor1" or "anchor2", changing the content positioning behavior anchor stage. Then when performing an InteractiveHitTest, I wanted it to then position the content at the plane anchor without duplicating the stage. Its still not working properly though.. can't quite figure it out. Any advice..?

from unityionicintegration.

yasirkula avatar yasirkula commented on June 13, 2024

The pop up might be triggered by an alert function in the Ionic code, the plugin itself isn't supposed to show any dialogs.

When are you calling the SwitchAnchor function? I think the most ideal place for it would be inside the IonicComms.OnMessageReceivedFromIonic function. You can simply call SwitchAnchor(message); there. Then, in your Ionic code, you can start Unity-side like this: unityARCaller.launchAR( "anchor1", this.uReturnedFromUnity, this.uMessageReceivedFromUnity );

from unityionicintegration.

ppkantorski avatar ppkantorski commented on June 13, 2024

I'll look into the alert function.. Something is triggering an alert on ionic when Unity is completed. Also, do we have to click "OK" every time we enter unity as well after it prompts something about the camera usage? I think that was happening the other day.

As for my program, maybe I should just attempt a simpler way of doing this. Is it possible to use a on click from ionic to open a particular scene in unity? If that works I can just save each scene on its own with the desired anchors and then call them from ionic.

ionic > click link 1 > load scene 1
ionic > click link 2 > load scene 2
etc.

Any ideas on if this is possible? Thanks again for everything

from unityionicintegration.

yasirkula avatar yasirkula commented on June 13, 2024
  • I don't think it will ask camera permission more than once
  • You can launch Unity like this: unityARCaller.launchAR( "name of the scene", this.uReturnedFromUnity, this.uMessageReceivedFromUnity );
    • Then, you can call UnityEngine.SceneManagement.SceneManager.LoadScene(message) inside IonicComms.OnMessageReceivedFromIonic

We should discuss further issues via email because it is getting off-topic now.

from unityionicintegration.

ShaliniShanmugam7 avatar ShaliniShanmugam7 commented on June 13, 2024

Currently i'm working on Mapbox+Unity+Ionic app integration with this plugin on iOS12.2 - Fixed this arm64 issue by adding ARkit Framework under "Linked Frameworks and Libraries"

from unityionicintegration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.